|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MobileAgent
MobileAgentItf
, Serialized FormField Summary | |
protected java.lang.String |
currentHostName
The host name of the current agent server. |
protected int |
currentPortNumber
The port number of the current agent server. |
protected java.lang.String |
homeHostName
The host name of the home agent server. |
protected int |
homePortNumber
The port number of the home agent server. |
protected java.lang.String |
name
The name that identifies the agent. |
Constructor Summary | |
MobileAgent()
|
Method Summary | |
void |
comeBackHome()
The mobile agent comes back to its home agent server. |
java.lang.String |
getCurrentHostName()
Returns the host name of the agent's current agent server. |
int |
getCurrentPortNumber()
Returns the port number of the agent's current agent server. |
java.lang.String |
getHomeHostName()
Returns the host name of the agent's home agent server. |
int |
getHomePortNumber()
Returns the port number of the agent's home agent server. |
java.lang.String |
getName()
Returns the agent's name. |
void |
init(java.lang.String name,
java.lang.String homeHostName,
int homePortNumber)
Initializes the agent with a name , and the
host name and the port number of the
agent server on which it is created.
|
boolean |
isMobile()
Tests if the agent is mobile. |
void |
meet(java.lang.String otherAgentName)
The mobile agent joins another agent identified by a name .
|
void |
moveTo(java.lang.String hostName,
int hostPort)
The mobile agent moves to an agent server identified by a name and a port number . |
void |
run()
This is the starting point of the agent; this method does nothing and returns. |
void |
setCurrentHostName(java.lang.String hostName)
Sets the value of the Returns the host name of the agent's current agent server name. |
void |
setCurrentPortNumber(int portNumber)
Sets the value of the Returns the host name of the agent's current agent server port. |
void |
waitFor(java.lang.String otherAgentName)
The mobile agent waits for the arrival of another agent identified by a name .
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String name
protected java.lang.String homeHostName
protected int homePortNumber
protected transient java.lang.String currentHostName
protected transient int currentPortNumber
Constructor Detail |
public MobileAgent()
Method Detail |
public void init(java.lang.String name, java.lang.String homeHostName, int homePortNumber)
name
, and the
host name
and the port number
of the
agent server on which it is created.
name
- the name of the agent.homeHostName
- the host name of the agent server.homePortNumber
- the port number of the agent server.public java.lang.String getName()
public java.lang.String getHomeHostName()
public int getHomePortNumber()
public java.lang.String getCurrentHostName()
public int getCurrentPortNumber()
public void setCurrentHostName(java.lang.String hostName)
hostName
- name of the current agent server.public void setCurrentPortNumber(int portNumber)
portNumber
- port number of the current agent server.public boolean isMobile()
public void run()
Subclasses of StationaryAgent
should override this method.
public void moveTo(java.lang.String hostName, int hostPort)
name
and a port number
.hostName
- the target agent server's host name.hostPort
- the target agent server's port number.public void comeBackHome()
public void waitFor(java.lang.String otherAgentName)
name
.
The mobile agent blocks until the other agent arrives.otherAgentName
- the name of the agent the mobile agent is
waiting for.public void meet(java.lang.String otherAgentName)
name
.
The mobile agent moves to the agent server hosting the target agent.otherAgentName
- the name of the agent the mobile agent is
joining.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |