All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ajanta.agent.JoinableAgent

java.lang.Object
   |
   +----ajanta.agent.Agent
           |
           +----ajanta.agent.ItinAgent
                   |
                   +----ajanta.agent.JoinableAgent

public class JoinableAgent
extends ItinAgent
implements Joinable, Resource, AccessProtocol, Reportable
It is a sub class of the ItinAgent class. Typically a splitJoin pattern is executed by an agent of JoinableAgent class. It implements the join method for its child agent to call for joining the parent agent. Moreover agent of this class always registers itself in its server's resource registry on arrival. Its child agent can thus get a reference to it when needed to report back any results. It implements Resource and AccessProtocol so that it can register itself as resource.


Constructor Index

 o JoinableAgent(Credentials)
 o JoinableAgent(Credentials, Itinerary)

Method Index

 o actionBeforeJoin(Agent)
This method is executed when a child agent returns and "joins" the parent.
 o actionOnArrive()
Application specific actions on agent' arrival should be defined in overriden method in the derived class.
 o actionOnJoin()
This method gets executed by the parent agent when all of the specified child agents have joined and the desired synchronization has occured.
 o arrive()
The arrive() method represents an entry protocol.
 o getProxy(Credentials)
Return a proxy of this agent
 o join(Agent)
A child agent reports its result to its parent agent by colocating with the parent agent and calling its join method on it.
 o registerOnArrive()
This method is called by arrive method.
 o report(Agent)

Constructors

 o JoinableAgent
 public JoinableAgent(Credentials cred)
Parameters:
cred - Credentials object of the agent
 o JoinableAgent
 public JoinableAgent(Credentials cred,
                      Itinerary itin)
Parameters:
cred - Credentials object of the agent
itin - Itinerary object for the agent

Methods

 o registerOnArrive
 public void registerOnArrive()
This method is called by arrive method. It registers the agent to the server resource registry.

 o actionOnArrive
 public void actionOnArrive()
Application specific actions on agent' arrival should be defined in overriden method in the derived class. For example it can be used to get reference to certain resources of the agent server.

 o arrive
 public final void arrive()
The arrive() method represents an entry protocol. It is automatically executed every time an agent arrives at a server. It is a final method. It calls registerOnArrive and actionOnArrive. Method actionOnArrive can be overriden to take application specific action on agent' arrival.

Overrides:
arrive in class ItinAgent
 o report
 public void report(Agent ag)
 o join
 public void join(Agent ag)
A child agent reports its result to its parent agent by colocating with the parent agent and calling its join method on it. It is used to synchronize child agents. It calls actionBeforeJoin where a child agent can pass results to the parent and then it call join() method of the Itinerary.

 o getProxy
 public Resource getProxy(Credentials cred)
Return a proxy of this agent

 o actionOnJoin
 public void actionOnJoin()
This method gets executed by the parent agent when all of the specified child agents have joined and the desired synchronization has occured. Should be overridden in application specific agents.

 o actionBeforeJoin
 public synchronized void actionBeforeJoin(Agent ag)
This method is executed when a child agent returns and "joins" the parent. The synchronization protocol executed by the agent results in the execution of this method. This method is used to collect information from a returning agent and it should be suitable overridden by the application specific agents.


All Packages  Class Hierarchy  This Package  Previous  Next  Index