|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ajanta.agent.Agent
The Agent class is the generic mobile agent. It serves as the base class for all agents. Application-specific agents should be programmed as sub-classes of Agent.
Credentials
,
AgentStatus
,
Serialized FormField Summary | |
byte[] |
creatorSignature
signature of the credential signed by creator of the agent |
ajanta.agent.Credentials |
cred
Credentials of the agent |
ajanta.server.AgentEnv |
host
host is the object reference to the current server's environment object. |
java.lang.Object |
myRef
|
ajanta.naming.URN |
name
URN ( name ) of the agent |
byte[] |
ownerSignature
signature of the credential signed by owner of the agent |
ajanta.agent.AgentStatus |
status
status object is modified whenever a recall request is pending. |
Constructor Summary | |
Agent()
Default constructor of the agent which assigns cred, host, ownerSignature and creatorSignature as null |
|
Agent(ajanta.agent.Credentials cred)
It assigns host, ownerSignature and creatorSignature as null. |
|
Agent(ajanta.agent.Credentials cred,
ajanta.server.AgentEnv host)
It assigns ownerSignature and creatorSignature as null. |
Method Summary | |
void |
agentEntry()
It system defined entry protocol and is the first method to be automatically executed every time an agent arrives at a server. |
void |
agentExit()
Agent's server executes this method just before it is sent off to another server. |
abstract void |
arrive()
The arrive() method represents an entry protocol. |
void |
colocate(ajanta.naming.URN target)
This method is called to relocate the agent at the server where a specified "target" object is currently resident. |
void |
colocate(ajanta.naming.URN target,
ajanta.util.MethodSpec as)
This method is called to relocate the agent at the server where a specified "target" object is currently resident. |
abstract void |
depart()
The depart() method represents an exit protocol. |
void |
meet(ajanta.naming.URN reportTo,
ajanta.util.MethodSpec as)
This method acts as the starting point of execution for an agent when it is relocated at a server. |
void |
recallCommand(ajanta.naming.URN whoInvoked,
ajanta.naming.URN reportTo)
This method is executed by the agent server currenlty hosting this agent when it receives a recall request for this agent. |
void |
run()
It is a empty method which can be overridden in subclasses. |
void |
signCreator(ajanta.naming.URN serverURN,
ajanta.server.AgentEnv host)
It signs the credentials byte of the agent with specified server's ( creator) private keys and store it in creatorSignature |
void |
signOwner()
It signs the credentials byte of the agent with owner's private keys and store it in ownerSignature |
void |
start(ajanta.server.AgentEnv host,
ajanta.naming.URN dest,
ajanta.util.MethodSpec action)
After agent has been created this method is called to launch the agent to appropriate server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public ajanta.naming.URN name
public ajanta.agent.Credentials cred
public byte[] ownerSignature
public byte[] creatorSignature
public transient ajanta.server.AgentEnv host
public ajanta.agent.AgentStatus status
public java.lang.Object myRef
Constructor Detail |
public Agent()
public Agent(ajanta.agent.Credentials cred)
public Agent(ajanta.agent.Credentials cred, ajanta.server.AgentEnv host)
Method Detail |
public final void agentEntry()
public abstract void arrive()
public abstract void depart()
public final void agentExit()
public void run()
public void start(ajanta.server.AgentEnv host, ajanta.naming.URN dest, ajanta.util.MethodSpec action) throws LaunchFailedException, java.net.UnknownHostException
host
- AgentEnv instance representing server's environmentdest
- URN of the destination serveraction
- MethodSpec representing the method to be executed on the server
if null then run method is executed
LaunchFailedException
java.net.UnknownHostException
public void colocate(ajanta.naming.URN target)
target
- URN of the target objectpublic void colocate(ajanta.naming.URN target, ajanta.util.MethodSpec as)
target
- URN of the target objectas
- MethodSpec representing the method to be executed by meet methodpublic void meet(ajanta.naming.URN reportTo, ajanta.util.MethodSpec as) throws java.lang.Exception
java.lang.Exception
public void recallCommand(ajanta.naming.URN whoInvoked, ajanta.naming.URN reportTo)
whoInvoked
- URN of the recallerreportTo
- URN of object with whom agent has to colocate on recallpublic void signCreator(ajanta.naming.URN serverURN, ajanta.server.AgentEnv host)
serverURN
- URN of the creator of the agentpublic void signOwner()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |