|
|||||||||
| 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.java.JavaAgentRunner
public class JavaAgentRunner
| Nested Class Summary | |
|---|---|
static class |
JavaAgentRunner.MyURLClassLoader
Deprecated. |
| Field Summary | |
|---|---|
static java.lang.String |
AGENT_LANGUAGE_JAVA
|
| Fields inherited from class org.iids.aos.agentserver.AgentRunner |
|---|
agents, communicator, config, handles, hostManagerWrapper, lookupService, neglib, running, servletModule, wsGatewayModule |
| Constructor Summary | |
|---|---|
JavaAgentRunner(AsCommunicator communicator,
AgentScapeConfig config,
AsLookupService lookupService,
AgentServer2WSGatewayModule wsGatewayModule,
AgentRunnerServletModule servletModule)
|
|
| Method Summary | |
|---|---|
void |
backupLog(AgentID id)
|
int |
getAgentCPUtime(AgentID agentID)
Obtains the agentwrapper for the agent, and returns the value of the thread time_on_cpu for this agent. |
JavaAgentWrapper |
getEntry(AgentID id)
Obtain agent wrapper for a given agent. |
AgentLog |
getFinishedAgentLog(AgentID id)
|
java.util.Set<AgentID> |
getFinishedAgents()
|
static java.lang.String |
getJavaLanguage()
|
java.lang.String |
getLanguage()
Return a string with the language type of agents that can be run by this agent server. |
JavaAgentSecurityManager |
getSecurityManager()
|
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, getAgentId, getAgents, getAgentServerAddress, getAgentServerId, getCommunicator, 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 |
| Field Detail |
|---|
public static final java.lang.String AGENT_LANGUAGE_JAVA
| Constructor Detail |
|---|
public JavaAgentRunner(AsCommunicator communicator,
AgentScapeConfig config,
AsLookupService lookupService,
AgentServer2WSGatewayModule wsGatewayModule,
AgentRunnerServletModule servletModule)
| Method Detail |
|---|
public AgentLog getFinishedAgentLog(AgentID id)
public java.util.Set<AgentID> getFinishedAgents()
public JavaAgentSecurityManager getSecurityManager()
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 backupLog(AgentID id)
throws AgentIDUnknownException
AgentIDUnknownException
public JavaAgentWrapper getEntry(AgentID id)
throws AgentIDUnknownException
AgentRunner
getEntry in class AgentRunnerAgentIDUnknownException
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 getJavaLanguage()
public java.lang.String getLanguage()
AgentRunner
getLanguage in class AgentRunnerpublic int getAgentCPUtime(AgentID agentID)
getAgentCPUtime in class AgentRunneragentID -
public void shutdown()
shutdown in class AgentRunner
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||