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

com.newstep.solid.replication
Class ReplicationService
com.newstep.solid.management.runtime.AsyncManagedExecutable
  |
  +--com.newstep.solid.replication.ReplicationService
All Implemented Interfaces:
       ManagedExecutable, MulticastChannelListener

public class ReplicationService      
Implements:
MulticastChannelListener
 
Links:
Kernel Association Association Link
to Class ReplicationService
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 MulticastChannelConfig
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 ReplicatorConfig
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 MulticastChannel
Associates type:
aggregationByValue
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
0..1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
aggregationByValue
 
Kernel Association Association Link
to Class Replicator
Associates type:
aggregationByValue
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
0..1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
aggregationByValue
 
Kernel Association Association Link
to Interface ReplicationMessageListener
registered clients of this service
Associates type:
aggregation
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1..2
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
associates:
com.newstep.solid.replication.ReplicationMessageListener
link:
aggregation
 
Implementation Implementation Link
to Interface MulticastChannelListener
 
Generalization Generalization Link
to Class AsyncManagedExecutable
 
 

Field Summary
private final static String
private int
private HashMap
private boolean
private static ReplicationService
private ReentrantLock
private final static Logger
private int
private Replicator
Method Summary
public void
deregister(Integer clId)
public long
protected void
protected void
protected void
protected void
protected void
protected void
private int
public static ReplicationService
private void
public void
public void
onMessage(Byte message)
public int
public long
protected void
Field Detail
className
private final static String className
Final.
Multiplicity:
1
Static.
 

clientId
private int clientId
ever incrementing id for registered clients
Multiplicity:
1
 

clients
private HashMap clients
registered clients of this service
Multiplicity:
1
Custom properties
associates:
com.newstep.solid.replication.ReplicationMessageListener
 

initialized
private boolean initialized
Multiplicity:
1
 

instance
private static ReplicationService instance
Multiplicity:
1
Static.
 

lock
private ReentrantLock lock
Internal lock for locking the access to the clients hashmap
Multiplicity:
1
 

logger
private final static Logger logger
Final.
Multiplicity:
1
Static.
 

multicastChannel
private MulticastChannel multicastChannel
Multiplicity:
1
 

multicastChannelConfig
private MulticastChannelConfig multicastChannelConfig
Multiplicity:
1
 

nodeId
private int nodeId
Unique id for this node
Multiplicity:
1
 

replicator
private Replicator replicator
Multiplicity:
1
 

replicatorConfig
private ReplicatorConfig replicatorConfig
Multiplicity:
1
 
Method Detail
deregister
public void deregister (Integer clId)
 
Clients deregister when they no longer want to receive new messages
Parameters:
clId id of the deregistering client
 

deregisterReplicant
public long deregisterReplicant (Replicant replicant)
 
 

doRestart
protected void doRestart ()
 
Throws:
ExecutableException
 

doResume
protected void doResume ()
 
Throws:
ExecutableException
 

doShutdown
protected void doShutdown ()
 
Throws:
ExecutableException
 

doStart
protected void doStart ()
 
Throws:
ExecutableException
 

doStop
protected void doStop ()
 
Throws:
ExecutableException
 

doSuspend
protected void doSuspend ()
 
Throws:
ExecutableException
 

generateClientId
private int generateClientId ()
 
 

getInstance
public static ReplicationService getInstance ()
 
Static.
 

getUniqueId
private void getUniqueId ()
 
negotiates a unique id within a replication group on startaup
 

initialize
public void initialize (MulticastChannelConfig multicastCfg, ReplicatorConfig replicatorCfg)
 
Throws:
ConfigurationException
 

onMessage
public void onMessage (Byte message)
 
 

receive
private ReplicationMessage receive ()
 
Receives a message blocking on the multicast channel's receive
Custom properties
return replication:
message
 

register
public int register (ReplicationMessageListener client)
 
Clients must register with the service before incomming messeges are forwarded to them.
Client's node id is set to this service's id
Parameters:
client to be notified about new messages
Return:
unique client id for this service.
 

registerReplicant
public 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
 

send
protected void send (ReplicationMessage message)
 
Sends a message
Parameters:
message ReplciationMessage to be sent
 

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