|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.iids.aos.agentserver.AgentWrapper
org.iids.aos.agentserver.binary.BinaryAgentWrapper
public class BinaryAgentWrapper
Agent wrapper for binary agents. Exists until the agent is done. If the agent process exits itself the resources (SunRPC dispatcher etc) are cleaned up automatically.
If a binary agent should be killed, it is also possible to manually
terminate the agent using stop().
| Field Summary |
|---|
| Fields inherited from class org.iids.aos.agentserver.AgentWrapper |
|---|
agentHandle, locationId |
| Constructor Summary | |
|---|---|
BinaryAgentWrapper(AgentRunner parent,
AgentHandle agentHandle)
|
|
| Method Summary | |
|---|---|
protected void |
finalize()
|
boolean |
running()
|
void |
setArgs(java.lang.String[] args)
|
void |
setCode(byte[] code)
Set the code to be executed by the agent process. |
void |
setPort(int port)
|
void |
start()
Start running the agent. |
void |
stop()
Suspend running binary agent. |
void |
waitFor()
Wait (blocking) for agent process to terminate. |
| Methods inherited from class org.iids.aos.agentserver.AgentWrapper |
|---|
addMessage, getAgentHandle, getAgentStartTime, getContainerId, getLocationId, getMessage, isSuspended, setContainerId, setLocationId, setSuspended |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinaryAgentWrapper(AgentRunner parent,
AgentHandle agentHandle)
| Method Detail |
|---|
protected void finalize()
finalize in class java.lang.Objectpublic void setCode(byte[] code)
code - The code to run. Assumed to be directly executable by a
single call to Runtime.exec(java.lang.String).public void setPort(int port)
public void setArgs(java.lang.String[] args)
public void start()
Jail class.
start in class AgentWrapperpublic boolean running()
public void waitFor()
stop() from another thread.
public void stop()
Note that this function should only be called by the agent server that started this agent, because the agent deregistration also needs to be done.
Only destroys the running process. State is still saved in the agent container (so recovery is possible)
When an agent needs to be completely removed and killed, refer to
AgentRunner.removeAgent(org.iids.aos.systemservices.communicator.structs.AgentID).
stop in class AgentWrapper
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||