|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--springs.agent.SpringsAgent_RMIImpl
A Springs agent. Base class that any Springs agent must extend.
Field Summary | |
private boolean |
_agentMoving
A boolean indicating whether the agent is moving or not. |
private java.lang.Object[] |
_argsCallbackMethod
The arguments callback method to execute when arriving at a destination (null if any). |
private boolean |
_cacheRefs
A boolean indicating whether references to agents should be cached (and automatically updated) by the context. |
private java.lang.String |
_callbackMethod
The callback method to execute when arriving at a destination (null if any). |
private java.lang.String |
_codebase
A codebase for the agent. |
private springs.context.ContextAddress |
_homeAddress
The home address of the agent. |
private long |
_initializationTime
Millis elapsed initialization the agent (for debugging and statistics). |
private springs.context.ContextInterfaceForAgents |
_interfaceToLocalContext
An interface to the local context. |
private boolean |
_justCreatedForTheFirstTime
A boolean indicating whether the agent has just been created for the first time. |
private long[] |
_lastMillisStays
|
private java.util.Vector |
_locationServers
|
private java.lang.Boolean |
_lockAgentMoving
|
private long |
_millisAtCreation
A timestamp to identify the time instant when the agent was created. |
private long |
_millisStartStay
The milliseconds when the agent starts its stay in a certain context. |
private java.lang.String |
_name
The name of the agent. |
protected int |
_numberOfJumps
The number of jumps performed by the agent. |
private int |
_numStays
|
private java.util.Set |
_observers
The observers and locationServers of the agent. |
private java.util.Vector |
_observersAddresses
The addresses of the contexts that "observe" this agent. |
private boolean |
_registered
A boolean indicating whether the agent has already register or not. |
private springs.agent.Schedule |
_schedule
The agent's schedule. |
Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
Fields inherited from class java.rmi.server.RemoteServer |
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Fields inherited from interface springs.agent.SpringsAgent |
METHOD_MESSAGE_RECEPTION |
Fields inherited from interface springs.agent.ISpringsAgent_RMIImpl |
ADD_OBSERVER_METHOD, REMOVE_OBSERVER_METHOD |
Constructor Summary | |
SpringsAgent_RMIImpl()
Constructor. |
Method Summary | |
void |
addObserver(java.lang.String observer)
Adds a observer for the agent. |
void |
addTaskToSchedule(java.lang.String method)
Add a task consisting of calling a certain method. |
void |
addTaskToSchedule(java.lang.String targetURL,
int targetPort)
Adds a task to travel to another context. |
void |
addTaskToSchedule(java.lang.String targetURL,
int targetPort,
java.lang.String callbackMethod)
Adds a task to travel to another context. |
void |
addTaskToSchedule(java.lang.String targetURL,
int targetPort,
java.lang.String callbackMethod,
java.lang.Object[] args)
Adds a task to travel to another context. |
void |
addTaskToSchedule(java.lang.String method,
java.lang.Object[] args)
Add a task consisting of calling a certain method. |
void |
afterCreation()
Method called just after creating the agent on a certain context. |
void |
afterRemoval()
Method called just after removing the agent from a certain context. |
boolean |
atHome()
Gets if the agent is at home. |
void |
beforeCreation()
Method called just before creating the agent on a certain context. |
void |
beforeRemoval()
Method called just before removing the agent from a certain context. |
java.lang.Object |
callAgentMethod(java.lang.String agentName,
java.lang.String methodName)
This method invokes a method of the agent. |
java.lang.Object |
callAgentMethod(java.lang.String agentName,
java.lang.String methodName,
java.lang.Object[] args)
This method invokes a method of the agent. |
springs.communication.FutureResult |
callAgentMethodAsynchronously(java.lang.String agentName,
java.lang.String methodName)
This method invokes a method of the agent asynchronously. |
springs.communication.FutureResult |
callAgentMethodAsynchronously(java.lang.String agentName,
java.lang.String methodName,
java.lang.Object[] args)
This method invokes a method of the agent asynchronously. |
void |
callback()
It executes the callback method after a travel to a new computer. |
void |
checkpoint()
Checkpoints the agent. |
springs.context.ContextAddress |
getAddress()
Gets the address of the agent. |
long |
getAgentInitializationTime()
Gets the millis elapsed in the initialization of the agent. |
boolean |
getAgentMoving()
Gets whether the agent is moving. |
protected java.lang.Object[] |
getArgsCallbackMethod()
Gets the arguments of the callback method. |
protected java.lang.String |
getCallbackMethod()
Gets the name of the callback method. |
java.lang.String |
getCodebase()
Gets the codebase for the agent, used if the agent travels to another context and some of the classes it uses there are not available. |
springs.context.ContextInterfaceForAgents |
getContextInterfaceForAgents()
Gets an interface to the local context. |
java.lang.String |
getContextName()
Gets the name of the agent's context. |
springs.context.ContextAddress |
getHomeAddress()
Gets the home address of the agent. |
java.lang.String |
getHostname()
Gets the hostname of the agent. |
java.util.Vector |
getLocationServers()
Gets the locationServers for the agent. |
long |
getMillisStay()
|
long |
getMillisWhenCreated()
|
java.lang.String |
getName()
Gets the name of the agent. |
java.lang.String |
getNameWithContext()
Gets the name of the agent, with information about the context. |
int |
getNumObservers()
Gets the number of observers of the agent. |
java.util.Vector |
getObservers()
Gets the observers of the agent. |
java.util.Vector |
getObserversAddresses()
Obtains the addresses of the observers of this agent. |
int |
getPort()
Gets the port of the agent. |
springs.agent.Schedule |
getSchedule()
Return the agent's schedule. |
int |
getSequenceNumberForAddressUpdateMessages()
Obtains a relative indicator used to timestamp messages that update the address of the agent. |
java.lang.String |
getURL()
Gets the URL of the agent. |
void |
goHome()
Moves the agent to its home context (the context where it was created the first time). |
void |
goHome(java.lang.String callbackMethod)
Moves the agent to its home context (the context where it was created the first time). |
void |
goHome(java.lang.String callbackMethod,
java.lang.Object[] args)
Moves the agent to its home context (the context where it was created the first time). |
java.lang.Object |
handleMessage(springs.communication.Message msg)
By default, a message is ignored. |
protected boolean |
hasCallbackMethod()
Checks if the agent has set a callback method to execute when arriving at a destination. |
void |
increaseSequenceNumberForAddressUpdateMessages(int increase)
Increases the relative indicator used to timestamp messages that update the address of the agent. |
void |
initialization()
This method is executed only the first time the agent is created. |
void |
initializationAfterMovement()
This method is executed every time after a movement of the agent. |
boolean |
isSuspended()
Obtains if the agent is suspended. |
boolean |
justCreatedForTheFirstTime()
Checks if the agent has just been created for the first time. |
void |
main()
Default callback method. |
boolean |
moreTasksInSchedule()
Checks if the agent has more tasks in its schedule. |
void |
moveTo(springs.context.ContextAddress contextAddress)
Moves the agent to another context. |
void |
moveTo(springs.context.ContextAddress contextAddress,
java.lang.String callbackMethod)
Moves the agent to another context. |
void |
moveTo(springs.context.ContextAddress contextAddress,
java.lang.String callbackMethod,
java.lang.Object[] args)
Moves the agent to another context. |
void |
moveTo(java.lang.String contextName)
Moves the agent to another context. |
void |
moveTo(java.lang.String contextName,
java.lang.String callbackMethod)
Moves the agent to another context. |
void |
moveTo(java.lang.String contextName,
java.lang.String callbackMethod,
java.lang.Object[] args)
Moves the agent to another context. |
void |
moveToURL(java.lang.String url)
Moves the agent to another context. |
void |
moveToURL(java.lang.String url,
int port)
Moves the agent to another context. |
void |
moveToURL(java.lang.String url,
int port,
java.lang.String callbackMethod)
Moves the agent to another context. |
void |
moveToURL(java.lang.String url,
int port,
java.lang.String callbackMethod,
java.lang.Object[] args)
Moves the agent to another context. |
void |
postArrival()
It executes after the agent has arrived at the destination. |
void |
postDeparture()
It executes on the original stale object at the source, and is typically defined to perform activities such as removing the stale object from persistence. |
void |
preArrival()
This method is executed on the copy of the object at the destination. |
void |
preDeparture(java.lang.String originContext,
java.lang.String targetContext)
This method is executed on the original object at the source. |
java.lang.Object |
receiveMethodCall(java.lang.String methodName,
java.lang.Object[] args)
Creates an agent. |
void |
recordEndStay()
|
void |
recordStartStay()
|
void |
remove()
Removes the agent. |
void |
removeObserver(java.lang.String observer)
Removes an observer for the agent. |
springs.communication.FutureResult |
sendAsynchronousMessage(java.lang.String agentName,
springs.communication.Message message)
This method sends a message to the agent, asynchronously. |
java.lang.Object |
sendMessage(java.lang.String agentName,
springs.communication.Message message)
This method sends a message to the agent, synchronously. |
java.lang.Object |
sendMessage(java.lang.String agentName,
springs.communication.Message message,
boolean asynchronous)
This method sends a message to the agent. |
void |
setAgentInitializationTime(long millis)
Sets the millis elapsed in the initialization of the agent. |
void |
setAgentMoving(boolean moving)
Sets whether the agent is moving. |
void |
setCacheReferences(boolean cacheRefs)
Sets whether references to agents should be cached. |
protected void |
setCallbackMethod(java.lang.String callbackMethod)
Sets the name of the callback method. |
void |
setCodebase(java.lang.String codebase)
Sets the codebase for the agent, that it will be used if the agent travels to another context and some of the classes it uses there are not available. |
void |
setContextInterfaceForAgents(springs.context.ContextInterfaceForAgents contextInterface)
Sets the interface to the agent's context. |
void |
setHomeAddress(springs.context.ContextAddress homeAddress)
Sets the home address of the agent. |
void |
setLocationServers(java.util.Vector locationServers)
Sets the location servers for the agent. |
void |
setName(java.lang.String name)
Sets the name of the agent. |
void |
start()
Starts the agent execution. |
void |
suspend()
Suspends the agent execution. |
springs.agent.Task |
takeNextTask()
Obtains the next task to be executed by the agent, from the schedule. |
private void |
unknownContextException(java.lang.String contextName)
Throws an exception saying that the given context is unknown. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.Set _observers
Set
,
Vector
private java.util.Vector _locationServers
private springs.agent.Schedule _schedule
Schedule
private java.lang.String _codebase
String
private transient springs.context.ContextInterfaceForAgents _interfaceToLocalContext
ContextInterfaceForAgents
private java.lang.String _name
String
private springs.context.ContextAddress _homeAddress
ContextAddress
private java.lang.String _callbackMethod
String
private java.lang.Object[] _argsCallbackMethod
Object
private java.util.Vector _observersAddresses
Vector
,
ContextAddress
private boolean _agentMoving
private java.lang.Boolean _lockAgentMoving
private boolean _justCreatedForTheFirstTime
private boolean _registered
protected int _numberOfJumps
private boolean _cacheRefs
private long _initializationTime
private long _millisAtCreation
private long _millisStartStay
private long[] _lastMillisStays
private int _numStays
Constructor Detail |
public SpringsAgent_RMIImpl() throws java.rmi.RemoteException
java.rmi.RemoteException
- if error.RemoteException
Method Detail |
public long getMillisWhenCreated()
getMillisWhenCreated
in interface SpringsAgent
public void recordStartStay()
recordStartStay
in interface SpringsAgent
public void recordEndStay()
recordEndStay
in interface SpringsAgent
public long getMillisStay()
getMillisStay
in interface SpringsAgent
public void setAgentInitializationTime(long millis)
SpringsAgent
setAgentInitializationTime
in interface SpringsAgent
millis
- the millis.public long getAgentInitializationTime()
SpringsAgent
getAgentInitializationTime
in interface SpringsAgent
public void setLocationServers(java.util.Vector locationServers)
SpringsAgent
setLocationServers
in interface SpringsAgent
public java.util.Vector getLocationServers()
SpringsAgent
getLocationServers
in interface SpringsAgent
Vector
public java.util.Vector getObservers()
SpringsAgent
getObservers
in interface SpringsAgent
Vector
public int getNumObservers()
SpringsAgent
getNumObservers
in interface SpringsAgent
public void setCacheReferences(boolean cacheRefs)
SpringsAgent
setCacheReferences
in interface SpringsAgent
cacheRefs
- a boolean indicating that.public int getSequenceNumberForAddressUpdateMessages()
SpringsAgent
getSequenceNumberForAddressUpdateMessages
in interface SpringsAgent
public void increaseSequenceNumberForAddressUpdateMessages(int increase)
SpringsAgent
increaseSequenceNumberForAddressUpdateMessages
in interface SpringsAgent
increase
- the increase.public void initialization() throws java.lang.Exception
SpringsAgent
initialization
in interface SpringsAgent
java.lang.Exception
- if error.Exception
public void initializationAfterMovement() throws java.lang.Exception
SpringsAgent
initializationAfterMovement
in interface SpringsAgent
java.lang.Exception
- if error.Exception
public boolean justCreatedForTheFirstTime()
SpringsAgent
justCreatedForTheFirstTime
in interface SpringsAgent
public void setCodebase(java.lang.String codebase)
SpringsAgent
setCodebase
in interface SpringsAgent
codebase
- the codebase.MalformedURLException
public java.lang.String getCodebase()
SpringsAgent
getCodebase
in interface SpringsAgent
String
public springs.context.ContextInterfaceForAgents getContextInterfaceForAgents()
SpringsAgent
getContextInterfaceForAgents
in interface SpringsAgent
ContextInterfaceForAgents
public void setContextInterfaceForAgents(springs.context.ContextInterfaceForAgents contextInterface)
SpringsAgent
setContextInterfaceForAgents
in interface SpringsAgent
contextInterface
- an interface to the agent's context.ContextInterfaceForAgents
public springs.context.ContextAddress getHomeAddress()
SpringsAgent
getHomeAddress
in interface SpringsAgent
ContextAddress
public void setHomeAddress(springs.context.ContextAddress homeAddress)
SpringsAgent
setHomeAddress
in interface SpringsAgent
homeAddress
- the home address of the agent.ContextAddress
public springs.context.ContextAddress getAddress()
SpringsAgent
getAddress
in interface SpringsAgent
ContextAddress
public java.lang.String getHostname()
SpringsAgent
getHostname
in interface SpringsAgent
String
public java.lang.String getContextName()
SpringsAgent
getContextName
in interface SpringsAgent
String
public java.lang.String getURL()
SpringsAgent
getURL
in interface SpringsAgent
String
public int getPort()
SpringsAgent
getPort
in interface SpringsAgent
ContextAddress
public boolean atHome()
SpringsAgent
atHome
in interface SpringsAgent
public java.lang.String getName()
SpringsAgent
getName
in interface SpringsAgent
String
public java.lang.String getNameWithContext()
SpringsAgent
getNameWithContext
in interface SpringsAgent
String
public void setName(java.lang.String name)
SpringsAgent
setName
in interface SpringsAgent
name
- the name.String
public void setAgentMoving(boolean moving)
SpringsAgent
setAgentMoving
in interface SpringsAgent
moving
- a boolean indicating whether the agent is moving or not.public boolean getAgentMoving()
SpringsAgent
getAgentMoving
in interface SpringsAgent
public void moveTo(springs.context.ContextAddress contextAddress) throws AgentMovementException
SpringsAgent
moveTo
in interface SpringsAgent
contextAddress
- the address of the target context.
AgentMovementException
- if the agent cannot be moved to the target address.ContextAddress
,
AgentMovementException
public void moveTo(springs.context.ContextAddress contextAddress, java.lang.String callbackMethod) throws AgentMovementException
SpringsAgent
moveTo
in interface SpringsAgent
contextAddress
- the address of the target context.callbackMethod
- the method to execute on arrival.
AgentMovementException
- if the agent cannot be moved to the target address.ContextAddress
,
AgentMovementException
,
String
public void moveTo(springs.context.ContextAddress contextAddress, java.lang.String callbackMethod, java.lang.Object[] args) throws AgentMovementException
SpringsAgent
moveTo
in interface SpringsAgent
contextAddress
- the address of the target context.callbackMethod
- the method to execute on arrival.args
- the arguments of the callback method.
AgentMovementException
- if the agent cannot be moved to the target address.ContextAddress
,
AgentMovementException
,
String
,
Object
public void moveToURL(java.lang.String url) throws AgentMovementException
SpringsAgent
moveToURL
in interface SpringsAgent
url
- the URL of the target context, including the port number.
AgentMovementException
- if the agent cannot move to the target address.ContextAddress
,
AgentMovementException
public void moveToURL(java.lang.String url, int port) throws AgentMovementException
SpringsAgent
moveToURL
in interface SpringsAgent
url
- the URL of the target context.port
- the port of the target context.
AgentMovementException
- if the agent cannot move to the target address.ContextAddress
,
AgentMovementException
public void moveToURL(java.lang.String url, int port, java.lang.String callbackMethod) throws AgentMovementException
SpringsAgent
moveToURL
in interface SpringsAgent
url
- the URL of the target context.port
- the port of the target context.callbackMethod
- the method to execute on arrival.
AgentMovementException
- if the agent cannot move to the target address.ContextAddress
,
AgentMovementException
,
String
public void moveToURL(java.lang.String url, int port, java.lang.String callbackMethod, java.lang.Object[] args) throws AgentMovementException
SpringsAgent
moveToURL
in interface SpringsAgent
url
- the URL of the target context.port
- the port of the target context.callbackMethod
- the method to execute on arrival.args
- the arguments of the callback method.
AgentMovementException
- if the agent cannot move to the target address.ContextAddress
,
AgentMovementException
,
String
,
Object
public void moveTo(java.lang.String contextName) throws AgentMovementException
SpringsAgent
moveTo
in interface SpringsAgent
contextName
- the name of the context.
AgentMovementException
- if the agent cannot move to the target context.String
,
AgentMovementException
public void moveTo(java.lang.String contextName, java.lang.String callbackMethod) throws AgentMovementException
SpringsAgent
moveTo
in interface SpringsAgent
contextName
- the name of the context.callbackMethod
- the method to execute on arrival.
AgentMovementException
- if the agent cannot move to the target context.String
,
AgentMovementException
public void moveTo(java.lang.String contextName, java.lang.String callbackMethod, java.lang.Object[] args) throws AgentMovementException
SpringsAgent
moveTo
in interface SpringsAgent
contextName
- the name of the context.callbackMethod
- the method to execute on arrival.args
- the arguments of the callback method.
AgentMovementException
- if the agent cannot move to the target context.String
,
AgentMovementException
public void goHome() throws AgentMovementException
SpringsAgent
goHome
in interface SpringsAgent
AgentMovementException
- if the agent cannot move to the target address.AgentMovementException
public void goHome(java.lang.String callbackMethod) throws AgentMovementException
SpringsAgent
goHome
in interface SpringsAgent
callbackMethod
- the method to execute on arrival.
AgentMovementException
- if the agent cannot move to the target address.String
,
AgentMovementException
public void goHome(java.lang.String callbackMethod, java.lang.Object[] args) throws AgentMovementException
SpringsAgent
goHome
in interface SpringsAgent
callbackMethod
- the method to execute on arrival.args
- the arguments of the callback method.
AgentMovementException
- if the agent cannot move to the target address.String
,
Object
,
AgentMovementException
public void callback() throws MethodCallException
SpringsAgent
callback
in interface SpringsAgent
MethodCallException
- if the callback method cannot be invoked.MethodCallException
public void suspend()
SpringsAgent
suspend
in interface SpringsAgent
public boolean isSuspended()
SpringsAgent
isSuspended
in interface SpringsAgent
public void checkpoint()
SpringsAgent
checkpoint
in interface SpringsAgent
public void addTaskToSchedule(java.lang.String targetURL, int targetPort)
SpringsAgent
addTaskToSchedule
in interface SpringsAgent
targetURL
- the target URL.targetPort
- the target port.String
public void addTaskToSchedule(java.lang.String targetURL, int targetPort, java.lang.String callbackMethod)
SpringsAgent
addTaskToSchedule
in interface SpringsAgent
targetURL
- the target URL.targetPort
- the target port.callbackMethod
- the callback method.String
public void addTaskToSchedule(java.lang.String targetURL, int targetPort, java.lang.String callbackMethod, java.lang.Object[] args)
SpringsAgent
addTaskToSchedule
in interface SpringsAgent
targetURL
- the target URL.targetPort
- the target port.callbackMethod
- the callback method.args
- the arguments for the callback method.String
,
Object
public void addTaskToSchedule(java.lang.String method)
SpringsAgent
addTaskToSchedule
in interface SpringsAgent
method
- the method.String
public void addTaskToSchedule(java.lang.String method, java.lang.Object[] args)
SpringsAgent
addTaskToSchedule
in interface SpringsAgent
method
- the method.args
- the arguments for the method.String
,
Object
public springs.agent.Task takeNextTask()
SpringsAgent
takeNextTask
in interface SpringsAgent
Task
public boolean moreTasksInSchedule()
SpringsAgent
moreTasksInSchedule
in interface SpringsAgent
public springs.agent.Schedule getSchedule()
SpringsAgent
getSchedule
in interface SpringsAgent
Schedule
public java.lang.Object handleMessage(springs.communication.Message msg)
handleMessage
in interface SpringsAgent
msg
- the message.
Object
,
Message
public void removeObserver(java.lang.String observer)
ISpringsAgent_RMIImpl
removeObserver
in interface SpringsAgent
observer
- the observer.String
public void addObserver(java.lang.String observer)
ISpringsAgent_RMIImpl
addObserver
in interface ISpringsAgent_RMIImpl
observer
- the observer.String
public java.lang.Object receiveMethodCall(java.lang.String methodName, java.lang.Object[] args) throws MethodCallException
ISpringsAgent_RMIImpl
receiveMethodCall
in interface SpringsAgent
methodName
- the name of the method.args
- the arguments.
MethodCallException
Object
,
String
,
MethodCallException
,
RemoteException
public void main()
SpringsAgent
main
in interface SpringsAgent
public void start()
SpringsAgent
start
in interface SpringsAgent
public void remove() throws RemovalException
SpringsAgent
remove
in interface SpringsAgent
RemovalException
- if error.RemovalException
public java.util.Vector getObserversAddresses()
SpringsAgent
getObserversAddresses
in interface SpringsAgent
Vector
public void beforeCreation()
SpringsAgent
beforeCreation
in interface SpringsAgent
public void afterCreation()
SpringsAgent
afterCreation
in interface SpringsAgent
public void beforeRemoval()
SpringsAgent
beforeRemoval
in interface SpringsAgent
public void afterRemoval()
SpringsAgent
afterRemoval
in interface SpringsAgent
public void postArrival()
SpringsAgent
postArrival
in interface SpringsAgent
public void postDeparture()
SpringsAgent
postDeparture
in interface SpringsAgent
public void preArrival()
SpringsAgent
preArrival
in interface SpringsAgent
public void preDeparture(java.lang.String originContext, java.lang.String targetContext)
SpringsAgent
preDeparture
in interface SpringsAgent
originContext
- the origin context.targetContext
- the target context.String
protected boolean hasCallbackMethod()
protected java.lang.String getCallbackMethod()
String
protected void setCallbackMethod(java.lang.String callbackMethod)
String
protected java.lang.Object[] getArgsCallbackMethod()
Object
public java.lang.Object callAgentMethod(java.lang.String agentName, java.lang.String methodName, java.lang.Object[] args) throws MethodCallException, CommunicationException
SpringsAgent
callAgentMethod
in interface SpringsAgent
agentName
- the name of the target agent.methodName
- the name of the method.args
- the arguments to the method.
MethodCallException
- if the invocation fails.
CommunicationException
- if there is a communication error.MethodCallException
,
CommunicationException
,
String
,
Object
public java.lang.Object callAgentMethod(java.lang.String agentName, java.lang.String methodName) throws MethodCallException, CommunicationException
SpringsAgent
callAgentMethod
in interface SpringsAgent
agentName
- the name of the target agent.methodName
- the name of the method.
MethodCallException
- if the invocation fails.
CommunicationException
- if there is a communication error.CommunicationException
,
MethodCallException
,
String
,
Object
public springs.communication.FutureResult callAgentMethodAsynchronously(java.lang.String agentName, java.lang.String methodName, java.lang.Object[] args) throws AgentReferenceException
SpringsAgent
callAgentMethodAsynchronously
in interface SpringsAgent
agentName
- the name of the target agent.methodName
- the name of the method.args
- the arguments to the method.
AgentReferenceException
- if error.FutureResult
,
AgentReferenceException
,
String
,
Object
public springs.communication.FutureResult callAgentMethodAsynchronously(java.lang.String agentName, java.lang.String methodName) throws AgentReferenceException
SpringsAgent
callAgentMethodAsynchronously
in interface SpringsAgent
agentName
- the name of the target agent.methodName
- the name of the method.
AgentReferenceException
- if error.FutureResult
,
AgentReferenceException
,
String
,
Object
public java.lang.Object sendMessage(java.lang.String agentName, springs.communication.Message message) throws CommunicationException
SpringsAgent
sendMessage
in interface SpringsAgent
agentName
- the name of the target agent.message
- the message.
CommunicationException
- if there is a communication error.Message
,
if there is a communication error.
public springs.communication.FutureResult sendAsynchronousMessage(java.lang.String agentName, springs.communication.Message message) throws CommunicationException
SpringsAgent
sendAsynchronousMessage
in interface SpringsAgent
agentName
- the name of the target agent.message
- the message.
CommunicationException
- if there is a communication error.FutureResult
,
Message
public java.lang.Object sendMessage(java.lang.String agentName, springs.communication.Message message, boolean asynchronous) throws CommunicationException
SpringsAgent
sendMessage
in interface SpringsAgent
agentName
- the name of the target agent.message
- the message.asynchronous
- a boolean indicating whether the message should be sent asynchronously
or not.
CommunicationException
- if there is a communication error.Message
private void unknownContextException(java.lang.String contextName) throws AgentMovementException
contextName
- the name of the context.
AgentMovementException.
AgentMovementException
String
,
AgentMovementException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |