|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdarx.ReplicationPolicy
public class ReplicationPolicy
This is the component, used alongside each TaskShell
,
which defines a task's replication group.
This class provides methods to manage the information a specific task
possesses about its replication group in terms of replicant
(un)registration, that is it maintains up to date the number of replicants
for this particular task, the location of each replicant, the strategies
applied within the group, and to which replicants they are applied.
NB: EVERY replicant, independently of its being leader of the replication
group or not, carries and maintains this information up to date so as to be
available to take the leadership in case of the current leader's failure.
A replication policy must contain a list of strategies, a list
of replicas, and a mapping between both lists.
ReplicationStrategy
,
ReplicationManager
,
Serialized FormConstructor Summary | |
---|---|
ReplicationPolicy(ReplicantInfo leader_info)
Constructs a new, empty replication policy |
Method Summary | |
---|---|
protected void |
addReplicant(ReplicationStrategy rep_strat,
ReplicantInfo rep_info,
TaskShellHandle rep_handle)
Adds a replica to the policy. |
protected ReplicationStrategy |
addStrategy(ReplicationStrategy rep_strat)
Adds a strategy to the policy. |
protected ReplicantInfo |
containsReplicant(java.lang.String url,
int port_nb)
Checks whether there exists a replica at a given location. |
void |
deliverAsyncMessage(TaskShell shell,
DarxMessage msg)
|
java.io.Serializable |
deliverSyncMessage(TaskShell shell,
DarxMessage msg)
|
(package private) void |
display()
|
protected ReplicationStrategy |
findAppliedStrategy(ReplicantInfo rep_info)
Finds the strategy which is applied to a given replica. |
protected ReplicantInfo |
generateNewInfo(java.lang.String url,
int port_nb)
Generates an information object for a new group member. |
void |
publishReplicationPolicy()
Spreads the information concerning the addition of a new member throughout the replication group. |
protected TaskShellHandle |
removeReplicant(ReplicantInfo rep_info)
Removes a replica from the policy. |
protected void |
removeStrategy(ReplicationStrategy rep_strat)
Removes a strategy from the policy. |
protected void |
resume()
Spreads the resumption of the encapsulated task execution throughout the replication group. |
protected void |
suspend()
Spreads the suspension of the encapsulated task execution throughout the replication group. |
protected void |
switchAppliedStrategy(ReplicationStrategy rep_strat,
ReplicantInfo rep_info)
Sets the strategy to be applied to a replica at a given location. |
protected void |
terminate()
Terminates the activity of the entire replication group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
ReplicationPolicy(ReplicantInfo leader_info)
leader_info
- the info for the leader of the replication groupMethod Detail |
---|
protected ReplicationStrategy addStrategy(ReplicationStrategy rep_strat)
rep_strat
- the strategy to add
protected void removeStrategy(ReplicationStrategy rep_strat)
rep_strat
- the strategy to removeprotected ReplicationStrategy findAppliedStrategy(ReplicantInfo rep_info) throws UnknownReplicantException
rep_info
- the replica to which the strategy is applied
UnknownReplicantException
protected void switchAppliedStrategy(ReplicationStrategy rep_strat, ReplicantInfo rep_info) throws UnknownReplicantException
rep_strat
- the strategy to applyrep_info
- the replica to which the strategy is applied
UnknownReplicantException
protected void addReplicant(ReplicationStrategy rep_strat, ReplicantInfo rep_info, TaskShellHandle rep_handle)
rep_strat
- the strategy to applyrep_info
- the info concerning the replica to be addedrep_handle
- the remote reference to the added replicaprotected ReplicantInfo generateNewInfo(java.lang.String url, int port_nb)
url
- the url of the location for the new memberport_nb
- the port nb of the location for the new member
protected ReplicantInfo containsReplicant(java.lang.String url, int port_nb) throws UnknownReplicantException
url
- the URL of the checked locationport_nb
- the port number of the checked location
UnknownReplicantException
- if there is no replica at the given
locationprotected TaskShellHandle removeReplicant(ReplicantInfo rep_info) throws UnknownReplicantException
rep_info
- the replica to remove
setStrategy
)
UnknownReplicantException
protected void suspend()
protected void resume()
protected void terminate()
public void publishReplicationPolicy()
rep_info
- the info concerning the new memberpublic void deliverAsyncMessage(TaskShell shell, DarxMessage msg) throws java.rmi.RemoteException
java.rmi.RemoteException
public java.io.Serializable deliverSyncMessage(TaskShell shell, DarxMessage msg) throws java.rmi.RemoteException
java.rmi.RemoteException
void display()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |