public class JGroupReceiver extends java.lang.Object implements org.jgroups.blocks.RequestHandler, DistributableReceiverInterface
| Constructor and Description |
|---|
JGroupReceiver(DistributableEntityManager entityManager,
java.lang.String clusterName,
java.lang.String peerName)
Constructor of the receiver
|
| Modifier and Type | Method and Description |
|---|---|
Peer |
getMyPeer()
Return the peer associated with the receiver
|
java.lang.Object |
handle(org.jgroups.Message msg)
When received a message
|
void |
setEntityManager(DistributableEntityManager entityManager)
Set the entity manager
|
void |
start()
Start the receiver
|
void |
stop()
Stop the receiver
|
public JGroupReceiver(DistributableEntityManager entityManager, java.lang.String clusterName, java.lang.String peerName)
entityManager - Manager that will execute commandsclusterName - Name of the clusterpeerName - Name of the peerpublic Peer getMyPeer()
DistributableReceiverInterfacegetMyPeer in interface DistributableReceiverInterfacepublic void start()
throws java.lang.Exception
start in interface DistributableReceiverInterfacejava.lang.Exception - Exceptionpublic void stop()
throws java.lang.Exception
stop in interface DistributableReceiverInterfacejava.lang.Exception - Error during closing the connectionpublic void setEntityManager(DistributableEntityManager entityManager)
setEntityManager in interface DistributableReceiverInterfaceentityManager - Entity manager to modifypublic java.lang.Object handle(org.jgroups.Message msg)
throws java.lang.Exception
handle in interface org.jgroups.blocks.RequestHandlermsg - Message receivedjava.lang.Exception