org.iids.aos.agents
Class WsaAgent

java.lang.Object
  extended by org.iids.aos.agent.Agent
      extended by org.iids.aos.agents.WsaAgent
All Implemented Interfaces:
java.io.Serializable

public class WsaAgent
extends Agent

An agent which exposes the negotiation documents to the user via a user interface. Purpose is to demonstrate the negotiation interactions that agents perform when requesting resource access on agentscape locations.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.iids.aos.agent.Agent
log
 
Constructor Summary
WsaAgent()
           
 
Method Summary
protected  void cleanUp()
          User definable cleanup of the agent before stopping.
 void end()
           
 Template getTemplate()
           
 void init()
           
 void run()
          To be implemented by the agent.
 void setLeaseRequest(AgreementOffer leaseRequest)
           
 void status(java.lang.String message)
           
 
Methods inherited from class org.iids.aos.agent.Agent
agentRunning, createAgentHandle, deregister, getAgentCPUtime, getAgentHandles, getApi, getArgs, getContext, getCurrentLocation, getLocations, getLocations, getLog, getOwnerHandle, getPrimaryHandle, getServlet, getServletNames, getToken, initAgent, kill, lookup, lookup, lookupPublished, lookupPublished, move, move, publish, publishServlet, receiveMessage, receiveMessage, receiveMessages, receiveMessages, register, removeAgentHandle, sendMessage, sendMessages, start, stopRunning, waitForCompletion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsaAgent

public WsaAgent()
Method Detail

init

public void init()

run

public void run()
Description copied from class: Agent
To be implemented by the agent. This is the main method of the Agent. This method is called by AgentScape as soon as the agent starts.

Once this function finishes, the agent is done. This can be preceded by a successful call to move(AgentScapeID) if the agent should continue to run on another location. If no successful move was done beforehand, then the agent is removed from the location.

Note that it is assumed that, once an agent moved to another location, this method will finish soon afterwards. There is no protection against this (yet) however.

Any cleanup operations can be done by implementing Agent.cleanUp().

Specified by:
run in class Agent
See Also:
cleanup, move

end

public void end()

getTemplate

public Template getTemplate()

setLeaseRequest

public void setLeaseRequest(AgreementOffer leaseRequest)

status

public void status(java.lang.String message)

cleanUp

protected void cleanUp()
Description copied from class: Agent
User definable cleanup of the agent before stopping. This method is called by the method Agent.stopRunning(), which is called by AgentScape whenever the agent moves or is (being) killed. An Agent-developer can override this method to perform any cleanup necessary before the agent is stopped permanently, such as stopping any threads this agent has created or removing any windows that have been put on the screen.

This method may not throw any Exceptions.

Overrides:
cleanUp in class Agent


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.