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.
-
JoinableAgent(Credentials)
-
-
JoinableAgent(Credentials, Itinerary)
-
-
actionBeforeJoin(Agent)
- This method is executed when a child agent returns and "joins" the parent.
-
actionOnArrive()
- Application specific actions on agent' arrival should be defined
in overriden method in the derived class.
-
actionOnJoin()
- This method gets executed by the parent agent when all of the specified child
agents have joined and the desired synchronization has occured.
-
arrive()
- The arrive() method represents an entry protocol.
-
getProxy(Credentials)
- Return a proxy of this agent
-
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.
-
registerOnArrive()
-
This method is called by arrive method.
-
report(Agent)
-
JoinableAgent
public JoinableAgent(Credentials cred)
- Parameters:
- cred - Credentials object of the agent
JoinableAgent
public JoinableAgent(Credentials cred,
Itinerary itin)
- Parameters:
- cred - Credentials object of the agent
- itin - Itinerary object for the agent
registerOnArrive
public void registerOnArrive()
- This method is called by arrive method. It registers the agent to the
server resource registry.
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.
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
report
public void report(Agent ag)
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.
getProxy
public Resource getProxy(Credentials cred)
- Return a proxy of this agent
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.
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