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()
DistributableReceiverInterface
getMyPeer
in interface DistributableReceiverInterface
public void start() throws java.lang.Exception
start
in interface DistributableReceiverInterface
java.lang.Exception
- Exceptionpublic void stop() throws java.lang.Exception
stop
in interface DistributableReceiverInterface
java.lang.Exception
- Error during closing the connectionpublic void setEntityManager(DistributableEntityManager entityManager)
setEntityManager
in interface DistributableReceiverInterface
entityManager
- Entity manager to modifypublic java.lang.Object handle(org.jgroups.Message msg) throws java.lang.Exception
handle
in interface org.jgroups.blocks.RequestHandler
msg
- Message receivedjava.lang.Exception