All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ajanta.agent.ReportableAgent

java.lang.Object
   |
   +----ajanta.agent.Agent
           |
           +----ajanta.agent.ReportableAgent

public class ReportableAgent
extends Agent
implements Resource, AccessProtocol, Reportable
Often it is necessary for Agents to return and report their results back to another principal -- a server, an agent or just another object. Agents may also encounter exceptions in trying to perform their task. They may need to contact another principal (usually the guardian) to help them handle these exceptions. Hence they need to be able to report to these principals which can examine the agent's current state and take the necessary actions. Any agent wishing to either report results or get its exception handled appropriatly can be derived from this class.

See Also:
Resource, AccessProtocol, Reportable

Constructor Index

 o ReportableAgent(Credentials)

Method Index

 o arrive()
It register the agent as a resource with agent's URN as the name of resource
 o depart()
Empty method and should be overridden in derived classes
 o getProxy(Credentials)
 o report(Agent)
It just print agent' name and should be appropriately overridden in derived classes.

Constructors

 o ReportableAgent
 public ReportableAgent(Credentials cred)
Parameters:
cred - Credentials object for the agent

Methods

 o report
 public void report(Agent ag)
It just print agent' name and should be appropriately overridden in derived classes.

Parameters:
reference - to the agent invoking this call
 o arrive
 public void arrive()
It register the agent as a resource with agent's URN as the name of resource

Overrides:
arrive in class Agent
 o depart
 public void depart()
Empty method and should be overridden in derived classes

Overrides:
depart in class Agent
 o getProxy
 public Resource getProxy(Credentials cred)
Parameters:
cred - Credentials object of the caller
Returns:
reference to this agent

All Packages  Class Hierarchy  This Package  Previous  Next  Index