|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--ajanta.server.AgentEnv
class AgentEnv represents the server's context. A reference to an AgentEnv object is passed to each agent when it is executed. Methods in the AgentEnv class provide the agent with primitive operations like migration, resource binding, etc.
| Method Summary | |
void |
createRMIProxy(java.lang.String interf)
Create and install an RMI server which has the same interface as the caller agent. |
void |
createRMIProxy(java.lang.String interf,
java.lang.String extension)
Create and install an RMI server which has the same interface as the caller agent. |
ajanta.naming.URN |
createURN(java.lang.String name)
Create a URN by appending the given string onto the server's URN |
void |
deleteResource(ajanta.naming.URN name)
Delete registered resource entry whose URN is passed as argument. |
ajanta.naming.URN |
getAgentServerURN()
|
ajanta.naming.URN |
getAgentURN()
Find the name currently executing agent in the same thread group. |
ajanta.naming.CascadedCertificate |
getCascadedCertificate(int key_length,
long duration)
|
ajanta.agent.Agent |
getCurrentAgent()
Find the currently executing agent in the same thread group. |
ajanta.naming.URN |
getHostURN()
Return the current host's name |
ajanta.server.NRAccess |
getNameReg()
Return a reference to the name registry access class ( NRAccess ) of the current agent server. |
ajanta.util.Resource |
getResource(ajanta.naming.URN resName)
Return an a proxy for the named resource and if it has not yet been registered then return null. |
java.security.PrivateKey |
getTemporaryPrivateKey()
|
java.security.PublicKey |
getTemporaryPublicKey()
|
void |
go(ajanta.naming.URN dest)
Migrate caller to the specified destination and execute the (parameterless) "run" method |
void |
go(ajanta.naming.URN dest,
ajanta.util.MethodSpec act)
Migrate caller to the specified destination and execute the method specified in the MethodSpec |
void |
go(ajanta.naming.URN dest,
java.lang.String method,
java.lang.Class[] formals,
java.lang.Object[] actuals)
Migrate caller agent to a specified destination and execute the named method with the specified formal and actual parameters |
void |
go(ajanta.naming.URN dest,
java.lang.String method,
java.lang.Object[] actuals)
Migrate caller to the specified destination and execute the named method with the given actual parameters, assuming they exactly match the formal parameter types. |
void |
launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest)
Send specified agent to the named destination and execute the (parameterless) "run" method |
void |
launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest,
ajanta.util.MethodSpec act)
Send specified agent to the named destination and execute the method specified in the MethodSpec |
void |
launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest,
java.lang.String method,
java.lang.Class[] formals,
java.lang.Object[] actuals,
boolean first)
Launch the given agent to the desired destination, specifying the method to be executed there. |
void |
launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest,
java.lang.String method,
java.lang.Object[] actuals)
Launch agent to the specified destination and execute the named method with the given actual parameters, assuming they exactly match the formal parameter types. |
boolean |
logEvent(ajanta.logger.Event e)
|
void |
registerAgent(ajanta.agent.Agent ag)
Registers an agent with the name registry, If an older entry exists try to rebind. |
void |
registerResource(ajanta.naming.URN name,
ajanta.util.Resource obj)
It creates a resource ( RREntry ) in the agent server's resource registry with the given resource name and resource object |
void |
registerResourceName(ajanta.naming.URN name)
It creates a resource ( RREntry) in the agent server's resource registry. |
byte[] |
sign(byte[] text)
Sign an agent with the agent server's private key. |
ajanta.util.Resource |
waitForResource(ajanta.naming.URN resName)
Return an a proxy for the named resource and if it has not yet been registered then wait for it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public ajanta.agent.Agent getCurrentAgent()
Agentpublic ajanta.naming.URN getAgentURN()
URNpublic ajanta.server.NRAccess getNameReg()
NRAccess
public void go(ajanta.naming.URN dest,
java.lang.String method,
java.lang.Class[] formals,
java.lang.Object[] actuals)
throws java.net.UnknownHostException,
LaunchFailedException
dest - URN of the destinationmethod - name of the method to executeformals - array of class names of method parametrsactuals - array of objects i.e. values of the parametrs to the method
java.net.UnknownHostException
LaunchFailedException
public void go(ajanta.naming.URN dest,
java.lang.String method,
java.lang.Object[] actuals)
throws java.net.UnknownHostException,
LaunchFailedException
dest - URN of the destinationmethod - name of the method to executeactuals - array of objects i.e. values of the parametrs to the method
java.net.UnknownHostException
LaunchFailedException
public void go(ajanta.naming.URN dest)
throws java.net.UnknownHostException,
LaunchFailedException
dest - URN of the destination
java.net.UnknownHostException
LaunchFailedException
public void go(ajanta.naming.URN dest,
ajanta.util.MethodSpec act)
throws java.net.UnknownHostException,
LaunchFailedException
dest - URN of the destinationact - MethodSpec of the method tb executed at destination
java.net.UnknownHostException
LaunchFailedExceptionMethodSpec
public void launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest,
java.lang.String method,
java.lang.Class[] formals,
java.lang.Object[] actuals,
boolean first)
throws LaunchFailedException
ag - Reference to the agent being launcheddest - URN of the destinationmethod - name of the method to executeformals - array of class names of method parametrsactuals - array of objects i.e. values of the parametrs to the methodfirst - true indicate very first launch of the agent ( just after creation ) wheras false
indicates a luanch at a later stage in the itinerary
LaunchFailedExceptionAgent
public void launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest,
java.lang.String method,
java.lang.Object[] actuals)
throws java.net.UnknownHostException,
LaunchFailedException
ag - Reference to the agent being launcheddest - URN of the destinationmethod - name of the method to executeactuals - array of objects i.e. values of the parametrs to the method
java.net.UnknownHostException
LaunchFailedExceptionAgent
public void launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest)
throws java.net.UnknownHostException,
LaunchFailedException
ag - Reference to the agent being launcheddest - URN of the destination
java.net.UnknownHostException
LaunchFailedExceptionAgent
public void launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest,
ajanta.util.MethodSpec act)
throws java.net.UnknownHostException,
LaunchFailedException
ag - Reference to the agent being launcheddest - URN of the destinationact - MethodSpec to be executed
java.net.UnknownHostException
LaunchFailedExceptionajnata.util.MethodSpecpublic ajanta.naming.URN getHostURN()
public void registerResourceName(ajanta.naming.URN name)
name - URN of the resource to be created
public void registerResource(ajanta.naming.URN name,
ajanta.util.Resource obj)
name - URN of the resource to be createdobj - Resource object to be registeredResourcepublic void deleteResource(ajanta.naming.URN name)
name - URN of the resourcepublic ajanta.util.Resource waitForResource(ajanta.naming.URN resName)
resName - URN of the resource
public ajanta.util.Resource getResource(ajanta.naming.URN resName)
resName - URN of the resource
public ajanta.naming.URN createURN(java.lang.String name)
name - - string used for urn
public void createRMIProxy(java.lang.String interf)
interf - name of the "Remote" interface which the agent supports.
Extension of the proxy class is "Proxy".
public void createRMIProxy(java.lang.String interf,
java.lang.String extension)
interf - name of the "Remote" interface which the agent supports.extension - file name extension of the proxy class name, if it is "" then
by default "Proxy" is used as extension.public void registerAgent(ajanta.agent.Agent ag)
ag - Agent to be registered
public byte[] sign(byte[] text)
throws java.security.SignatureException
text - Content to be signed
java.security.SignatureException
public ajanta.naming.CascadedCertificate getCascadedCertificate(int key_length,
long duration)
public java.security.PrivateKey getTemporaryPrivateKey()
public java.security.PublicKey getTemporaryPublicKey()
public boolean logEvent(ajanta.logger.Event e)
public ajanta.naming.URN getAgentServerURN()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||