|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.messaging.core.distributed.PeerSupport
org.jboss.messaging.core.distributed.replicator.ReplicatorPeer
org.jboss.messaging.core.distributed.replicator.Replicator
A Replicator is a distributed receiver that replicates synchronously or asynchronously a message to multiple receivers living in different address spaces. A replicator could have multiple inputs and multiple outputs. Messages sent by an input are replicated to every output.
The replication of messages is done efficiently by multicasting, but message acknowledment is handled by the replicator (so far) in a point-to-point manner. For that reason, each replicator peer must be able to synchronously reach any other peer. When it is configured to be synchronous, the replicator works pretty much like a distributed PointToMultipointRouter. The Replicator is NOT a Receiver. It returns a Set of deliveries instead of a single delivery. TODO: Refactor Replicator so it won't be forced to provide noop implementation for Distributor's methods: http://jira.jboss.org/jira/browse/JBMESSAGING-192
Field Summary | |
protected boolean |
cancelOnMessageRejection
|
protected AcknowledgmentCollector |
collector
|
protected MessageStore |
ms
|
Fields inherited from class org.jboss.messaging.core.distributed.PeerSupport |
dispatcher, joined, peerID, rpcServer, TIMEOUT, viewKeeper |
Constructor Summary | |
Replicator(java.io.Serializable replicatorID,
RpcDispatcher dispatcher,
MessageStore ms,
boolean cancelOnMessageRejection)
Creates a replicator peer. |
Method Summary | |
boolean |
add(Receiver receiver)
TODO http://jira.jboss.org/jira/browse/JBMESSAGING-192 |
void |
clear()
TODO http://jira.jboss.org/jira/browse/JBMESSAGING-192 |
void |
close()
|
boolean |
contains(Receiver receiver)
TODO http://jira.jboss.org/jira/browse/JBMESSAGING-192 |
protected RemotePeer |
createRemotePeer(RemotePeerInfo thatPeerInfo)
Create a local representation of a remote peer. |
boolean |
doesCancelOnMessageRejection()
|
protected void |
doJoin()
|
protected void |
doLeave()
|
java.util.Set |
getOutputs()
Return a set of PeerIdentities corresponding to the replicator's outputs. |
Peer |
getPeer()
|
protected RemotePeerInfo |
getRemotePeerInfo()
Create a representation of myself to be returned to other peers that need this information. |
java.io.Serializable |
getReplicatorID()
|
java.util.Set |
handle(DeliveryObserver observer,
Routable routable,
Transaction tx)
Returns a Set of Deliveries, a delivery for each replicator output in the group. |
java.util.Iterator |
iterator()
TODO http://jira.jboss.org/jira/browse/JBMESSAGING-192 |
boolean |
remove(Receiver receiver)
TODO http://jira.jboss.org/jira/browse/JBMESSAGING-192 |
java.lang.String |
toString()
|
Methods inherited from class org.jboss.messaging.core.distributed.PeerSupport |
exclude, getDispatcher, getGroupID, getID, getPeerIdentity, getView, hasJoined, include, join, leave, ping, ping |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.messaging.core.distributed.Distributed |
join, leave |
Field Detail |
protected AcknowledgmentCollector collector
protected MessageStore ms
protected boolean cancelOnMessageRejection
Constructor Detail |
public Replicator(java.io.Serializable replicatorID, RpcDispatcher dispatcher, MessageStore ms, boolean cancelOnMessageRejection)
cancelOnMessageRejection
- - if 'true', the replicator will cancel an on-going delivery
on first asynchronous message rejection it receives from its outputs. If false,
message rejections are ignored.Method Detail |
public Peer getPeer()
getPeer
in interface Distributed
public void close() throws DistributedException
close
in interface Distributed
DistributedException
public java.util.Set handle(DeliveryObserver observer, Routable routable, Transaction tx)
handle
in interface Router
tx
- - not currently usedpublic boolean contains(Receiver receiver)
contains
in interface Distributor
public java.util.Iterator iterator()
iterator
in interface Distributor
public boolean add(Receiver receiver)
add
in interface Distributor
public boolean remove(Receiver receiver)
remove
in interface Distributor
public void clear()
clear
in interface Distributor
public java.io.Serializable getReplicatorID()
public boolean doesCancelOnMessageRejection()
public java.util.Set getOutputs()
public java.lang.String toString()
protected void doJoin() throws DistributedException
doJoin
in class PeerSupport
DistributedException
protected void doLeave() throws DistributedException
doLeave
in class PeerSupport
DistributedException
protected RemotePeerInfo getRemotePeerInfo()
PeerSupport
getRemotePeerInfo
in class PeerSupport
protected RemotePeer createRemotePeer(RemotePeerInfo thatPeerInfo)
PeerSupport
createRemotePeer
in class PeerSupport
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |