darx
Class ReplicantInfo

java.lang.Object
  extended by darx.ReplicantInfo
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class ReplicantInfo
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

This object contains the information regarding a specific replicant handled by DARX. It is used as a global name for each DarxTask.

See Also:
Serialized Form

Constructor Summary
ReplicantInfo()
          constructs the information container of a task's leader, leaving the fields empty.
ReplicantInfo(java.lang.String url, int port_nb, java.lang.String task_name, int id)
          constructs the global identifier of a replica
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this replicant info to an object.
 boolean equals(java.lang.Object o)
          Compares the specified Object with this info for equality.
 int getPortNb()
           
 int getReplicantID()
           
 java.lang.String getTaskName()
           
(package private)  TaskShellHandle getTaskShellHandle()
          Retrieves the remote reference to the given replica, ie. the TaskShellHandle corresponding to the replicant information.
 java.lang.String getURL()
           
 int hashCode()
          Who knows when THIS might come in handy...
 boolean isAt(java.lang.String l_url, int l_port_nb)
          Returns whether the given location is that of the current ReplicantInfo.
(package private)  void parse(java.lang.String info)
          parses the given DARX path name String (format: :/$) in order to fill the fields of the current ReplicantInfo.
 void setPortNb(int new_port_nb)
           
 void setReplicantID(int new_id)
           
 void setTaskName(java.lang.String new_task_name)
           
 void setURL(java.lang.String new_url)
           
(package private)  java.lang.String textifyDarxName()
          creates the unique DARX replicant name corresponding to the current ReplicantInfo.
(package private)  java.lang.String textifyDarxPath()
          creates the unique DARX path corresponding to the current ReplicantInfo.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicantInfo

ReplicantInfo()
constructs the information container of a task's leader, leaving the fields empty.


ReplicantInfo

ReplicantInfo(java.lang.String url,
              int port_nb,
              java.lang.String task_name,
              int id)
constructs the global identifier of a replica

Method Detail

getURL

public java.lang.String getURL()
Returns:
the URL of the current host for this replica

getPortNb

public int getPortNb()
Returns:
the port number of the current host for this replica

getTaskName

public java.lang.String getTaskName()
Returns:
the generic task name to which this replica is related

getReplicantID

public int getReplicantID()
Returns:
the identifier for this replica

setURL

public void setURL(java.lang.String new_url)

setPortNb

public void setPortNb(int new_port_nb)

setTaskName

public void setTaskName(java.lang.String new_task_name)

setReplicantID

public void setReplicantID(int new_id)

parse

void parse(java.lang.String info)
parses the given DARX path name String (format: :/$) in order to fill the fields of the current ReplicantInfo.


textifyDarxName

java.lang.String textifyDarxName()
creates the unique DARX replicant name corresponding to the current ReplicantInfo.


textifyDarxPath

java.lang.String textifyDarxPath()
creates the unique DARX path corresponding to the current ReplicantInfo.


compareTo

public int compareTo(java.lang.Object o)
Compares this replicant info to an object. This method must be defined in order to implement interface Comparable.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the object (info) to be compared
Returns:
0 if both infos correspond to the same replicant.

equals

public boolean equals(java.lang.Object o)
Compares the specified Object with this info for equality.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to be compared (hopefully a ReplicationInfo)
Returns:
true if the specified Object is equal to this info.

hashCode

public int hashCode()
Who knows when THIS might come in handy...

Overrides:
hashCode in class java.lang.Object

isAt

public boolean isAt(java.lang.String l_url,
                    int l_port_nb)
Returns whether the given location is that of the current ReplicantInfo.


getTaskShellHandle

TaskShellHandle getTaskShellHandle()
                             throws java.rmi.RemoteException
Retrieves the remote reference to the given replica, ie. the TaskShellHandle corresponding to the replicant information.

Throws:
java.rmi.RemoteException