org.ourgrid.corepeer
Class CorePeerImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.ourgrid.common.rmi.OurgridUnicastRemoteObject
                  extended by org.ourgrid.corepeer.CorePeerImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, CorePeer, CorePeerStatusProvider
Direct Known Subclasses:
RestrictedCorePeerImpl

public class CorePeerImpl
extends OurgridUnicastRemoteObject
implements CorePeer, CorePeerStatusProvider

Description: Implementation of CorePeer interface.

Version:
1.0 Date24/09/2004
See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial identification of the class.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
CorePeerImpl()
          Default constructor.
 
Method Summary
 java.util.List<ObjectID> getKnownPeers(ObjectID peerId)
          Returns a list of known peers in the OurGrid Community.
 java.util.Collection<ObjectID> getPeerList()
          Gets a collection of know peers.
 java.util.List<ObjectID> hereIAm(ObjectID peerID)
          Called when a peer wants to join the OurGrid Community.
 void newPeerArrived(ObjectID peerID)
          Add a peer to knowPeers list.
 void removePeer(ObjectID peerID)
          Remove a peer from knowPeers list.
 void setFailureDetector(CorePeerFailureDetector fd)
           
 void setPingerFactory(PingerFactory pingerFactory)
           
 void shutdown()
          Shutdown a core peer.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial identification of the class. It need to be changed only if the class interface is changed.

See Also:
Constant Field Values
Constructor Detail

CorePeerImpl

public CorePeerImpl()
             throws java.rmi.RemoteException
Default constructor.

Throws:
java.rmi.RemoteException - If could not create the object.
Method Detail

hereIAm

public java.util.List<ObjectID> hereIAm(ObjectID peerID)
                                 throws java.rmi.RemoteException
Description copied from interface: CorePeer
Called when a peer wants to join the OurGrid Community.

Specified by:
hereIAm in interface CorePeer
Parameters:
peerID - The id of the caller peer.
Returns:
the list of already known peers (including the caller peer).
Throws:
java.rmi.RemoteException - If cannot contact the core peer.
See Also:
CorePeer.hereIAm(ObjectID)

newPeerArrived

public void newPeerArrived(ObjectID peerID)
Description copied from interface: CorePeer
Add a peer to knowPeers list.

Specified by:
newPeerArrived in interface CorePeer
Parameters:
peerID - informations about the peer

removePeer

public void removePeer(ObjectID peerID)
Description copied from interface: CorePeer
Remove a peer from knowPeers list.

Specified by:
removePeer in interface CorePeer
Parameters:
peerID - informations about the peer
See Also:
CorePeer.removePeer(org.ourgrid.common.id.ObjectID)

shutdown

public void shutdown()
Description copied from interface: CorePeer
Shutdown a core peer. It will stop running threads and also prepare this object to be unbided.

Specified by:
shutdown in interface CorePeer

setFailureDetector

public void setFailureDetector(CorePeerFailureDetector fd)

getKnownPeers

public java.util.List<ObjectID> getKnownPeers(ObjectID peerId)
                                       throws java.rmi.RemoteException
Description copied from interface: CorePeer
Returns a list of known peers in the OurGrid Community.

Specified by:
getKnownPeers in interface CorePeer
Parameters:
peerId - The identification of the caller "peer".
Returns:
The list of already known peers.
Throws:
java.rmi.RemoteException - If cannot contact the core peer.

getPeerList

public java.util.Collection<ObjectID> getPeerList()
Description copied from interface: CorePeerStatusProvider
Gets a collection of know peers.

Specified by:
getPeerList in interface CorePeerStatusProvider

setPingerFactory

public void setPingerFactory(PingerFactory pingerFactory)