Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.replication
Class Replicator
All Implemented Interfaces:
       ReplicationMessageListener

public class Replicator      
Replicator handles communication between nodes particpating in a "replication cluster". It provides brokering of
replication services and establishes and maintanis the replication structure. There is only one replicator per
replication node and each replicant residing on the node must register with the replicator in order to participate in
the "replication cluster".
Author:
dpetroni
Implements:
ReplicationMessageListener
 
Links:
Kernel Association Association Link
to Class ReplicationService
Associates type:
aggregation
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
aggregation
 
Kernel Association Association Link
to Class ReplicationPeer
 
Associates type:
aggregation
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
0..
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
associates:
com.newstep.solid.replication.ReplicationPeer
link:
aggregation
 
Kernel Association Association Link
to Class AccessPoint
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
 
Kernel Association Association Link
to Class ChannelEndpoint
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
 
Implementation Implementation Link
to Interface ReplicationMessageListener
Replicator handles communication between nodes particpating in a "replication cluster". It provides brokering of
replication services and establishes and maintanis the replication structure. There is only one replicator per
replication node and each replicant residing on the node must register with the replicator in order to participate in
the "replication cluster".
Author:
dpetroni
 
 

Field Summary
String
private AccessPoint
private String
private final static String
private boolean
private String
protected static Logger
protected LinkedBlockingQueue
private HashMap
replicant
request
List
responses
protected boolean
private int
private HashMap
private Thread
private int
private String
private HashMap
private Timer
Constructor Summary
void
PendingRequest(Replicant rep, ReplicationRequest req)
protected void
Method Summary
protected synchronized void
private void
protected void
checkResponses(Replicator.PendingRequest pr)
protected synchronized long
public int
public String
private void
handleFailedPeer(Integer peerId)
protected void
public void
public void
void
addResponse(ReplicationResponse resp)
getResponses()
protected synchronized void
protected synchronized long
selectResponse(Replicator.PendingRequest pr)
public void
setReplicatorName(String replicatorName)
public void
private synchronized boolean
private void
public void
private void
Field Detail
cap
private AccessPoint cap
Multiplicity:
1
 

channelAccessPointFactoryName
private String channelAccessPointFactoryName
Multiplicity:
1
 

className
private final static String className
Final.
Multiplicity:
1
Static.
 

initialized
private boolean initialized
Multiplicity:
1
 

localAddressString
private String localAddressString
Multiplicity:
1
 

localEndpoint
private ChannelEndpoint localEndpoint
Multiplicity:
1
 

logger
protected static Logger logger
Multiplicity:
1
Static.
 

messageQueue
protected LinkedBlockingQueue messageQueue
Multiplicity:
1
 

peers
private HashMap peers
 
Multiplicity:
1
Custom properties
associates:
com.newstep.solid.replication.ReplicationPeer
 

processMessages
protected boolean processMessages
Multiplicity:
1
 

replicantIds
private int replicantIds
Multiplicity:
1
 

replicants
private HashMap replicants
Multiplicity:
1
Custom properties
associates:
com.newstep.replication.Replicant
 

replicationMessageProcessor
private Thread replicationMessageProcessor
Multiplicity:
1
 

replicationService
private ReplicationService replicationService
Multiplicity:
1
 

replicatorId
private int replicatorId
Multiplicity:
1
 

replicatorName
String replicatorName
 

replicatorName
private String replicatorName
Multiplicity:
1
 

requests
private HashMap requests
Multiplicity:
1
 

timer
private Timer timer
Multiplicity:
1
 
Constructor Detail
Replicator
protected void Replicator (ReplicationService repService)
 
Stereotype:
create
 
Method Detail
addPendingRequest
private void addPendingRequest (Replicant replicant)
 
 

addPendingRequest
protected synchronized void addPendingRequest (Replicant replicant, ReplicationRequest request)
 
Synchronized.
 

checkResponses
protected void checkResponses (Replicator.PendingRequest pr)
 
 

deregisterReplicant
protected synchronized long deregisterReplicant (Replicant replicant)
 
Stops client replicants and ends replication service provided by server replicants. As a side effect, removes the
replication peer associated with the repliacnt if there are neither server nor client replicants remaining
associated with the peer.
Parameters:
replicant
to be deregistered
Return:
the id of the deregistered replicant
Synchronized.
 

getReplicationClientId
public int getReplicationClientId ()
 
 

getReplicatorName
public String getReplicatorName ()
 
 

handleFailedPeer
private void handleFailedPeer (Integer peerId)
 
 

initialize
protected void initialize (ReplicatorConfig config)
 
It is intended that initialize is invoked during the ReplicationService startup. Actual users of this class
should never bother with the initalization. Multiple invocations of initialize have no effect
Parameters:
config
Configuration holding all the necessary parameters
Throws:
ConfigurationException
 

onMessage
public void onMessage (ReplicationMessage message)
 
 

peerUnreachable
public void peerUnreachable (ReplicationPeer peer)
 
 

processMessage
protected synchronized void processMessage (ReplicationMessage message)
 
Synchronized.
 

registerReplicant
protected synchronized long registerReplicant (Replicant replicant)
 
Replicants have to be registered with the Replicator in order to offer or take advantage of replication services.
Each replicant is instantiated and given its copy of the replication strategy by the management/config subsystem.
Parameters:
replicant
to be registered with the Replicator
Return:
the unique id of the newly registered replicant
Synchronized.
 

selectResponse
private ReplicationResponse selectResponse (Replicator.PendingRequest pr)
 
 

setReplicatorName
public void setReplicatorName (String replicatorName)
 
 

start
public void start ()
 
Throws:
ExecutableException
 

startReplication
private synchronized boolean startReplication (Replicant replicant, ReplicationResponse response)
 
Synchronized.
 

startReplicationMessageProcessor
private void startReplicationMessageProcessor ()
 
 

stop
public void stop ()
 
 

stopReplicationMessageProcessor
private void stopReplicationMessageProcessor ()
 
 

Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD