com.newstep.solid.replication
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
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
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
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
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
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 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 |
|
protected void |
|
| Method Summary |
protected synchronized void |
|
private void |
|
protected void |
|
protected synchronized long |
|
public int |
|
public String |
|
private void |
|
protected void |
|
public void |
|
public void |
|
void |
|
|
getResponses() |
protected synchronized void |
|
protected synchronized long |
|
|
|
public void |
|
public void |
|
private synchronized boolean |
|
private void |
|
public void |
|
private void |
|
Multiplicity:
1
channelAccessPointFactoryName
private String channelAccessPointFactoryName
Multiplicity:
1
private final static String className
Final.
Multiplicity:
1
Static.
private boolean initialized
Multiplicity:
1
private String localAddressString
Multiplicity:
1
Multiplicity:
1
protected static Logger logger
Multiplicity:
1
Static.
protected LinkedBlockingQueue messageQueue
Multiplicity:
1
private HashMap peers
Multiplicity:
1
Custom properties
associates:
com.newstep.solid.replication.ReplicationPeer
protected boolean processMessages
Multiplicity:
1
private int replicantIds
Multiplicity:
1
private HashMap replicants
Multiplicity:
1
Custom properties
associates:
com.newstep.replication.Replicant
replicationMessageProcessor
private Thread replicationMessageProcessor
Multiplicity:
1
Multiplicity:
1
private int replicatorId
Multiplicity:
1
String replicatorName
private String replicatorName
Multiplicity:
1
private HashMap requests
Multiplicity:
1
private Timer timer
Multiplicity:
1
Stereotype:
create
private void addPendingRequest (Replicant replicant)
Synchronized.
protected void checkResponses (Replicator.PendingRequest pr)
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.
public int getReplicationClientId ()
public String getReplicatorName ()
private void handleFailedPeer (Integer peerId)
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
Synchronized.
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.
public void setReplicatorName (String replicatorName)
public void start ()
Throws:
ExecutableException
Synchronized.
startReplicationMessageProcessor
private void startReplicationMessageProcessor ()
public void stop ()
stopReplicationMessageProcessor
private void stopReplicationMessageProcessor ()