|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.messaging.core.distributed.PeerSupport
The class that mediates the access of a distributed destination instance to the group. Provides generic behavior in top of which subclasses must layer their specific behavior.
Field Summary | |
protected RpcDispatcher |
dispatcher
|
protected boolean |
joined
|
protected java.io.Serializable |
peerID
|
protected RpcServer |
rpcServer
|
static long |
TIMEOUT
|
protected ViewKeeper |
viewKeeper
|
Constructor Summary | |
PeerSupport(java.io.Serializable peerID,
java.io.Serializable groupID,
RpcDispatcher dispatcher)
Use this to create a PeerSupport with an internal ViewKeeper. |
|
PeerSupport(java.io.Serializable peerID,
ViewKeeper viewKeeper,
RpcDispatcher dispatcher)
Use this to create a PeerSupport with an external ViewKeeper. |
Method Summary | |
protected abstract RemotePeer |
createRemotePeer(RemotePeerInfo newRemotePeerInfo)
Create a local representation of a remote peer. |
protected abstract void |
doJoin()
|
protected abstract void |
doLeave()
|
void |
exclude(PeerIdentity originator)
Method invocation received by all group peers when a peer wants to leave the group. |
RpcDispatcher |
getDispatcher()
|
java.io.Serializable |
getGroupID()
|
java.io.Serializable |
getID()
Return the ID under which server object is registered with the RpcServer. |
PeerIdentity |
getPeerIdentity()
|
protected abstract RemotePeerInfo |
getRemotePeerInfo()
Create a representation of myself to be returned to other peers that need this information. |
java.util.Set |
getView()
Returns a Set of PeerIdentity instances corresponding to peers that are part of the group. |
boolean |
hasJoined()
|
RemotePeerInfo |
include(RemotePeerInfo newPeerInfo)
Method invocation received by all group peers when a new peer wants to join the group. |
void |
join()
Connects the peer to the distributed destination. |
void |
leave()
Stops the peer and disconnects it from the distributed destination. |
java.util.Set |
ping()
Return a Set of PeerIdentity instances corresponding to peers that are part of the group, as a result of a dynamic query. |
PeerIdentity |
ping(PeerIdentity originator)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long TIMEOUT
protected RpcDispatcher dispatcher
protected RpcServer rpcServer
protected ViewKeeper viewKeeper
protected java.io.Serializable peerID
protected boolean joined
Constructor Detail |
public PeerSupport(java.io.Serializable peerID, java.io.Serializable groupID, RpcDispatcher dispatcher)
java.lang.IllegalStateException
- in case the dispatcher is not configured with an RpcServerpublic PeerSupport(java.io.Serializable peerID, ViewKeeper viewKeeper, RpcDispatcher dispatcher)
viewKeeper
- must contain the valid group ID. This peer support will use the group ID
obtained from the viewKeeper to connect to the group.
java.lang.IllegalStateException
- in case the dispatcher is not configured with an RpcServerMethod Detail |
public java.io.Serializable getGroupID()
getGroupID
in interface Peer
public PeerIdentity getPeerIdentity()
getPeerIdentity
in interface Peer
public boolean hasJoined()
hasJoined
in interface Peer
public RpcDispatcher getDispatcher()
getDispatcher
in interface Peer
public java.util.Set getView()
Peer
getView
in interface Peer
public void join() throws DistributedException
Peer
join
in interface Peer
DistributedException
- - a wrapper for exceptions thrown by the distributed layer.public void leave() throws DistributedException
Peer
leave
in interface Peer
DistributedException
- - a wrapper for exceptions thrown by the distributed layer.public java.util.Set ping() throws DistributedException
Peer
ping
in interface Peer
DistributedException
public java.io.Serializable getID()
ServerFacade
getID
in interface ServerFacade
public RemotePeerInfo include(RemotePeerInfo newPeerInfo) throws java.lang.Throwable
PeerFacade
include
in interface PeerFacade
java.lang.Throwable
- - negative acknowledgment. The join is vetoed (willingly or unwillingly)
by this member.public void exclude(PeerIdentity originator)
PeerFacade
exclude
in interface PeerFacade
public PeerIdentity ping(PeerIdentity originator)
ping
in interface PeerFacade
protected abstract void doJoin() throws DistributedException
DistributedException
protected abstract void doLeave() throws DistributedException
DistributedException
protected abstract RemotePeer createRemotePeer(RemotePeerInfo newRemotePeerInfo)
protected abstract RemotePeerInfo getRemotePeerInfo()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |