public class JGReplicator extends java.lang.Object implements ReplicationManager, org.jgroups.blocks.RequestHandler
Constructor and Description |
---|
JGReplicator(javax.naming.Context ctx) |
Modifier and Type | Method and Description |
---|---|
void |
addModifiedBean(RequestId reqId,
ObjectId bid,
byte[] state)
Adds a modified EJB to the changes made inside a request.
|
void |
clear()
Closes and stops all the elements used (channel, dispatcher...)
|
java.lang.Object |
handle(org.jgroups.Message msg) |
void |
replicate(RequestId reqId,
java.lang.Object response)
Replicates the response and the EJB changes kept on the requestChanges
structure for a concrete reqId
|
void |
replicateRemove(RequestId requestId)
Replicates a remove method invocation over an EJB for a concrete
custerOID
|
ResponseInfo |
restoreBeanChanges(RequestId requestId,
java.lang.Object beanSwitch)
Applies the changes kept in BeanChanges.
|
public void addModifiedBean(RequestId reqId, ObjectId bid, byte[] state)
addModifiedBean
in interface ReplicationManager
bid
- the ObjectId of the changed beanstate
- the serialized state of the changed beanreqId
- the request id from the clientpublic void replicate(RequestId reqId, java.lang.Object response) throws ReplicationException
replicate
in interface ReplicationManager
reqId
- identifies the request changes to replicate hold in
requestChanges structureresponse
- the response to return to the clientReplicationException
public void replicateRemove(RequestId requestId) throws ReplicationException
replicateRemove
in interface ReplicationManager
requestId
- identifies the custerOID to remove in the backupsReplicationException
public ResponseInfo restoreBeanChanges(RequestId requestId, java.lang.Object beanSwitch)
restoreBeanChanges
in interface ReplicationManager
requestId
- the request id to access the state of the beanbeanSwitch
- the sfsw that contains the instance where restore the statepublic void clear()
clear
in interface ReplicationManager
public java.lang.Object handle(org.jgroups.Message msg)
handle
in interface org.jgroups.blocks.RequestHandler