|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.iids.aos.systemservices.module.AbstractModule
org.iids.aos.agentserver.AgentRunner
org.iids.aos.agentserver.binary.BinaryAgentRunner
public class BinaryAgentRunner
Implementation of an AgentRunner
for binary agents.
Binary agents are supported through this agent runner. Each binary agent runs as a separate processes outside the JVM, with the regular user priviliges.
To allow the agent to interact with AgentScape, the agent must have some
client-side stub which it can use for communication. For each binary agent
a separate SunRPC dispatcher instance is created, exclusively for the
respective agent. The dispatcher implementation for this binary agent
runner is in AgentScapeApiSunrpcDispatcher.
Running as a separate process means an agent has full access to the
parts of the system that the user has. The system cannot be protected from
Non-Java agents with Java security managers. Therefore, it is possible to
run an agent inside a Jail to
prevent it from unprivileged access.
Monitoring the state and interaction with a running agent (such as sending
messages) is done by means of an
AgentWrapper, more specifically by
BinaryAgentWrapper.
| Field Summary |
|---|
| Fields inherited from class org.iids.aos.agentserver.AgentRunner |
|---|
agents, communicator, config, handles, hostManagerWrapper, lookupService, neglib, running, servletModule, wsGatewayModule |
| Constructor Summary | |
|---|---|
BinaryAgentRunner(AsCommunicator communicator,
AgentScapeConfig config,
AsLookupService lookupService,
AgentServer2WSGatewayModule wsGatewayModule)
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getBinaryLanguage()
|
java.lang.String |
getLanguage()
Return a string with the language type of agents that can be run by this agent server. |
void |
removeAgent(AgentID agentId)
Remove agent from the agent runner. |
void |
shutdown()
|
void |
startAgent(AgentID agentId,
java.lang.String[] args)
Start agent from agent container. |
void |
suspendAgent(AgentID agentId)
Suspend and, if supported, serialize state of a running agent. |
| Methods inherited from class org.iids.aos.agentserver.AgentRunner |
|---|
createDefaultAgentLease, createDefaultAgentLease, doHttpRequest, finalize, getAgentCPUtime, getAgentCPUtime, getAgentId, getAgents, getAgentServerAddress, getAgentServerId, getCommunicator, getEntry, getNegotiationLib, isStarted, killAgent, killAgent, removeAgent, setHostManagerWrapper, start, stop |
| Methods inherited from class org.iids.aos.systemservices.module.AbstractModule |
|---|
getModuleName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinaryAgentRunner(AsCommunicator communicator,
AgentScapeConfig config,
AsLookupService lookupService,
AgentServer2WSGatewayModule wsGatewayModule)
| Method Detail |
|---|
public void startAgent(AgentID agentId,
java.lang.String[] args)
throws AgentIDUnknownException,
AgentStartupException
AgentRunnerThe agent is supposed to be already registered with the registration service. The runner takes care of reading the code segment(s) from the container and doing agent startup.
startAgent in class AgentRunneragentId - ID of the agent the will be associated with the running agent.args - Optional (may be null or empty) initialization arguments for the agent.
AgentIDUnknownException
AgentStartupException
public void suspendAgent(AgentID agentId)
throws AgentIDUnknownException,
AgentSuspendException
AgentRunnerAfter an agent is suspended, it can be (re) moved. The most recent state of the agent is now supposed to be stored in the agent container, so the agent can be safely migrated.
suspendAgent in class AgentRunnerAgentIDUnknownException
AgentSuspendException
public void removeAgent(AgentID agentId)
throws AgentIDUnknownException
AgentRunnerIf the agent (process) is still running, it is to be terminated, if this is supported by the language.
Note that this function does not (need to) remove the agent from
the location (deregistration), which is done via the host manager.
When you want to completely remove an agent, you can use the
AgentRunner.killAgent(org.iids.aos.systemservices.communicator.structs.AgentID) function, which implicitly calls
this removeAgent function.
TODO: think about exceptions.
removeAgent in class AgentRunneragentId - ID of the agent to be removed.
AgentIDUnknownExceptionpublic static java.lang.String getBinaryLanguage()
public java.lang.String getLanguage()
AgentRunner
getLanguage in class AgentRunnerpublic void shutdown()
shutdown in class AgentRunner
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||