agentland.software
Class ExecAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
                                |
                                +--agentland.resource.ManagedAgent
                                      |
                                      +--agentland.software.ExecAgent
Direct Known Subclasses:
LaureteAgent

public abstract class ExecAgent
extends ManagedAgent
implements Exec

Exec Agent The Intelligent Room/HAL Project MIT Artificial Intelligence Laboratory Cambridge, MA

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
protected  Runtime command
           
protected  Process process
           
protected  int startCount
          Number of times program has been started.
 
Fields inherited from class agentland.resource.ManagedAgent
rm, society
 
Fields inherited from class agentland.util.GoodAgent
alert, notifier
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
ExecAgent()
          Tie to the proper machine, homie!
 
Method Summary
protected  String getCommand()
          Return the command to exec.
 void killProgram()
          Kill the program.
 boolean programAlive()
          Is program alive or dead?
protected  void programDied(boolean killed)
          This is called if the program has passed away.
 void startProgram()
          Start the program, unless it is already running.
 
Methods inherited from class agentland.resource.ManagedAgent
connect, getAlert, getNeed, reliesOn, reliesOn, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, yank, yank, yank
 
Methods inherited from class agentland.util.GoodAgent
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell
 
Methods inherited from class metaglue.AgentAgent
addMonitor, alive, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getProperties, getSociety, log, log, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

command

protected Runtime command

process

protected Process process

startCount

protected int startCount
Number of times program has been started.
Constructor Detail

ExecAgent

public ExecAgent()
          throws RemoteException
Tie to the proper machine, homie!
Method Detail

programAlive

public boolean programAlive()
                     throws RemoteException
Is program alive or dead?
Specified by:
programAlive in interface Exec

killProgram

public void killProgram()
Description copied from interface: Exec
Kill the program.
Specified by:
killProgram in interface Exec

programDied

protected void programDied(boolean killed)
This is called if the program has passed away.
Parameters:
killed - true if someone explicitly killed it via this agent.

startProgram

public void startProgram()
                  throws RemoteException
Start the program, unless it is already running.
Specified by:
startProgram in interface Exec

getCommand

protected String getCommand()
Return the command to exec. Can be overridden, currently checks for an attribute "command"