|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ajanta.pattern.Pattern | +--ajanta.pattern.PatternCollection | +--ajanta.pattern.Split
This pattern results in the creation of child agents for parallel traversal of contained patterns. This is conceptually similar to parallelizing a Set, where instead of one agent travelling along some path defined by the Set , each child agent is assigned one element of the Set for traversal. This pattern only controls creation and dispatch of agents. It is used when the child agents are not expected to report back to the parent.
Field Summary | |
protected java.lang.String |
childClassName
All the child agents created are of this class |
protected int |
noOfChild
keep track of the number of child agents created |
Fields inherited from class ajanta.pattern.PatternCollection |
current, list |
Fields inherited from class ajanta.pattern.Pattern |
action, DONE, FAILED, NOTDONE, status |
Constructor Summary | |
Split()
|
|
Split(java.lang.String childClass)
|
Method Summary | |
protected ajanta.agent.ItinAgent |
createAgent(ajanta.server.AgentEnv host,
java.lang.String agentType,
ajanta.naming.URN childURN,
ajanta.pattern.Itinerary itin)
It creates a child agent of the class agentType. |
protected int |
next(ajanta.server.AgentEnv host)
It creates child agents equal to the number of the Pattern in the list. |
protected void |
reset()
It sets the status of Split Pattern to NOTDONE and resets the status of all the Patterns in the list by calling reset method of individual Patterns. |
protected void |
scan()
An empty method ....can overridden in derived classes |
void |
setAgentResource(ajanta.agent.ItinAgent agent,
ajanta.agent.ItinAgent parent)
It is an empty method which will be overridden in derived class. |
Methods inherited from class ajanta.pattern.PatternCollection |
currentEntry, firstEntry, insert, join, print |
Methods inherited from class ajanta.pattern.Pattern |
getName, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String childClassName
protected int noOfChild
Constructor Detail |
public Split()
public Split(java.lang.String childClass)
childClass
- name of the class whose instances will be
all the child agents createdMethod Detail |
public void setAgentResource(ajanta.agent.ItinAgent agent, ajanta.agent.ItinAgent parent)
agent
- reference to the child agentparent
- reference to the parent agentprotected ajanta.agent.ItinAgent createAgent(ajanta.server.AgentEnv host, java.lang.String agentType, ajanta.naming.URN childURN, ajanta.pattern.Itinerary itin)
host
- AgentEnv of the current serveragentType
- class name for the child agentschildURN
- URN for the child agentsitin
- Itinerary for the child agents
protected int next(ajanta.server.AgentEnv host)
next
in class Pattern
host
- AgentEnv of the current agent serverprotected void reset()
reset
in class PatternCollection
protected void scan()
scan
in class Pattern
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |