public class SqlSpacesReceiver extends java.lang.Object implements info.collide.sqlspaces.commons.Callback, DistributableReceiverInterface
Constructor and Description |
---|
SqlSpacesReceiver(DistributableEntityManager entityManager,
java.lang.String clusterName,
java.lang.String peerName)
Create a SqlSpaces Receiver using localhost server
|
SqlSpacesReceiver(DistributableEntityManager entityManager,
java.lang.String clusterName,
java.lang.String peerName,
java.lang.String ipAddress,
int port)
Create a SqlSpaces Receiver using an external server
|
Modifier and Type | Method and Description |
---|---|
void |
call(info.collide.sqlspaces.commons.Callback.Command c,
int seq,
info.collide.sqlspaces.commons.Tuple afterTuple,
info.collide.sqlspaces.commons.Tuple beforeTuple) |
Peer |
getMyPeer()
Return the peer associated with the receiver
|
void |
setEntityManager(DistributableEntityManager entityManager)
Set the entity manager
|
void |
start()
Start the receiver
|
void |
stop()
Stop to listen on the interface
|
public SqlSpacesReceiver(DistributableEntityManager entityManager, java.lang.String clusterName, java.lang.String peerName)
entityManager
- Entity manager that will receive commandsclusterName
- Name of the clusterpeerName
- Name of the peerpublic SqlSpacesReceiver(DistributableEntityManager entityManager, java.lang.String clusterName, java.lang.String peerName, java.lang.String ipAddress, int port)
entityManager
- Entity manager that will receive commandsclusterName
- Name of the clusterpeerName
- Name of the peeripAddress
- Ip address of the SQLSpaces Serverport
- Port of the SQLSpaces Serverpublic void setEntityManager(DistributableEntityManager entityManager)
DistributableReceiverInterface
setEntityManager
in interface DistributableReceiverInterface
entityManager
- Entity manager to modifypublic Peer getMyPeer()
DistributableReceiverInterface
getMyPeer
in interface DistributableReceiverInterface
public void start() throws java.lang.Exception
start
in interface DistributableReceiverInterface
java.lang.Exception
- Exceptionpublic void call(info.collide.sqlspaces.commons.Callback.Command c, int seq, info.collide.sqlspaces.commons.Tuple afterTuple, info.collide.sqlspaces.commons.Tuple beforeTuple)
call
in interface info.collide.sqlspaces.commons.Callback
public void stop() throws java.lang.Exception
DistributableReceiverInterface
stop
in interface DistributableReceiverInterface
java.lang.Exception
- Error during closing the connection