darx
Interface DarxHandle

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
TaskShellHandle
All Known Implementing Classes:
TaskShell

public interface DarxHandle
extends java.rmi.Remote

This is the remote interface used by application-level entities to access a distant TaskShell.

The application-level entities include unreplicated agents, leaders of replication groups which do not include the accessed TaskShell, as well as application programmers.
The DarxHandle is designed to be encapsulated in a RemoteTask instance; therefore it ought to be the stub of a replication group leader.

See Also:
RemoteTask, TaskShell

Method Summary
 void deliverAsyncMessage(DarxMessage msg)
          Sends an asynchronous message to the remote task.
 java.io.Serializable deliverSyncMessage(DarxMessage msg)
          Sends a synchronous message to the remote task.
 ReplicationPolicy getReplicationPolicy()
           
 void killReplicantAt(java.lang.String url, int port_nb)
          Deletes the replicant residing at the given location, provided it belongs to the replication group.
 void killTask()
          Ends the generic task execution.
 void replicateTo(java.lang.String url, int port_nb, ReplicationStrategy rs)
          Creates a new replicant inside the replication group at a given location.
 void switchReplicationStrategy(java.lang.String url, int port_nb, ReplicationStrategy strategy)
          Modifies the current replication policy of the group, by applying a new strategy to a given replica.
 

Method Detail

deliverAsyncMessage

void deliverAsyncMessage(DarxMessage msg)
                         throws java.rmi.RemoteException
Sends an asynchronous message to the remote task.

Parameters:
msg - the message destined to the remote task.
Throws:
java.rmi.RemoteException
See Also:
TaskShell.deliverAsyncMessage(DarxMessage msg)

deliverSyncMessage

java.io.Serializable deliverSyncMessage(DarxMessage msg)
                                        throws java.rmi.RemoteException
Sends a synchronous message to the remote task.

Parameters:
msg - the message destined to the remote task.
Returns:
the message sent in reply.
Throws:
java.rmi.RemoteException
See Also:
TaskShell.deliverSyncMessage(DarxMessage msg)

replicateTo

void replicateTo(java.lang.String url,
                 int port_nb,
                 ReplicationStrategy rs)
                 throws java.rmi.RemoteException,
                        IllegalReplicationException
Creates a new replicant inside the replication group at a given location.

Parameters:
url - the location where the new replicant is to be created
port_nb - the port corresponding to the server
rs - the replication strategy applied to the new replica
Throws:
java.rmi.RemoteException
IllegalReplicationException - if a replica of the same group already exists at the location

killReplicantAt

void killReplicantAt(java.lang.String url,
                     int port_nb)
                     throws java.rmi.RemoteException,
                            UnknownReplicantException
Deletes the replicant residing at the given location, provided it belongs to the replication group.

Parameters:
url - the location where the new replicant is to be created
port_nb - the port corresponding to the server
Throws:
java.rmi.RemoteException
UnknownReplicantException - if there is no replicant from the group at the given location

killTask

void killTask()
              throws java.rmi.RemoteException
Ends the generic task execution. This method spreads the termination process throughout the replication group.

Throws:
java.rmi.RemoteException

switchReplicationStrategy

void switchReplicationStrategy(java.lang.String url,
                               int port_nb,
                               ReplicationStrategy strategy)
                               throws java.rmi.RemoteException
Modifies the current replication policy of the group, by applying a new strategy to a given replica.

Parameters:
url - the URL of the replica to which the new strategy applies
port_nb - the port number of the replica to which the new strategy applies
strategy - the new strategy to be applied
Throws:
java.rmi.RemoteException
See Also:
DarxHandle, ReplicationStrategy, TaskShell.switchReplicationStrategy(java.lang.String, int, darx.ReplicationStrategy)

getReplicationPolicy

ReplicationPolicy getReplicationPolicy()
                                       throws java.rmi.RemoteException
Returns:
the current replication policy of the related replication group.
Throws:
java.rmi.RemoteException
See Also:
ReplicationPolicy