|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--metaglue.AgentAgent
Superclass of all Metaglue agents. Provides the Metaglue primitives: reliesOn, tiedTo, as well as a host of other useful items.
Inner Class Summary | |
class |
AgentAgent.Attribute
Attribute class description |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Fields inherited from interface metaglue.Agent |
ALIVE,
DIED,
NO_METAGLUE,
NOT_RUNNING,
STARTING |
Constructor Summary | |
AgentAgent()
|
|
AgentAgent(AgentID agentID)
|
Method Summary | |
void |
addMonitor(Spy monitor)
Add a log monitor that gets all the screen output. |
boolean |
alive()
|
Object |
defrost(String var)
Defrosts an object to get its value from the icebox. |
Hashtable |
defrostAll()
Gets the variables and values stored in the icebox. |
boolean |
defrostBoolean(String var)
Defrosts a boolean value from the icebox. |
int |
defrostInt(String var)
Defrosts a boolean value from the icebox. |
String |
defrostString(String var)
Defrosts a string from the icebox. |
protected String |
fixAttribute(AgentID aid,
String attributeName)
|
protected String |
fixAttribute(AgentID aid,
String attributeName,
String specialMessage)
Allows you to fix an existing attribute (useful if you try to cast attribute to something and it fails) |
void |
freeze(String var,
boolean b)
`Freeze' a boolean value into the icebox. |
void |
freeze(String var,
int i)
`Freeze' an integer value into the icebox. |
void |
freeze(String var,
Serializable o)
`Freeze' an object into the icebox. |
void |
freezeAll()
A simple routine to freeze all the state of an object. |
void |
freezeVar(String var,
Object obj)
`Freeze' an object into the icebox. |
AgentID |
getAgentID()
|
String |
getAttribute(String attributeName)
Get attribute value for name. |
Catalog |
getCatalog()
|
CatalogID |
getCatalogID()
|
Object |
getDesignation()
|
Set |
getFrozenVariables()
Gets the set of variables stored in the icebox. |
int |
getLogLevel(int level)
|
MetaglueAgent |
getMetaglueAgent()
Gets the Metaglue Agent that loaded this agent |
AgentID |
getMetaglueAgentID()
Gets the Metaglue Agent ID that loaded this agent |
String |
getOccupation()
|
Properties |
getProperties()
|
String |
getSociety()
|
void |
log(int level,
String info)
Send a log message to the logging stream. |
void |
log(Object obj)
Send a log message to the logging stream. |
void |
log(String level,
String info)
Send a log message to the logging stream. |
Metaglue |
obtainMetaglueAgent(AgentID mid)
|
Metaglue |
obtainMetaglueAgent(InetAddress host)
|
Metaglue |
obtainMetaglueAgentByName(String ma,
boolean retry_if_fail)
|
Agent |
reliesOn(AgentID agentID)
Major reliesOn call. |
Agent |
reliesOn(String occupation)
Ensures that the specified agent is running (starts if necessary). |
Agent |
reliesOn(String occupation,
Object designation)
Ensures that the specified agent is running (starts if necessary). |
Agent |
reliesOnSynch(AgentID agentID)
Synchronously rely on agentID. |
boolean |
removeFrozen(String var)
Remove a frozen object from the icebox. |
void |
replaceExceptionHandler(AgentExceptionHandler r)
Stub routine for AEH exception handling. |
protected void |
setFreezeName(String name)
|
void |
setLogLevel(int level)
|
void |
setLogName(String n)
Sets a name for this agent that can be used while logging. |
void |
shutdown()
Changes the agent so that it cannot be found through the catalog or accept RMI calls. |
void |
startAgent(AgentID agentID)
|
void |
startAgentOn(AgentID theAgentID,
Metaglue metaglue,
boolean agent_previously_started,
Object[] parameters)
Start given agent on given metaglue agent. |
void |
startAgentOn(AgentID theAgentID,
String host)
Try to start agent on metaglue agent with given host for christian name, or, failing that, that host for a computer. |
void |
startup()
|
int |
status(AgentID agentID)
Determines the status of the described agent. |
void |
tiedTo(AgentID agentID)
Ensures that agent is running on the same MVM as a given agent Must be asserted in agent contructor. |
void |
tiedTo(AgentID theAgentID,
Object[] parameters)
Ensures that agent is running on the same MVM as a given agent. |
void |
tiedTo(InetAddress host,
Object[] parameters)
Ensures that agent is running on host (moving it there if necessary with given parameters). |
void |
tiedTo(String host)
|
protected String |
tieToDesignation()
If the designation string is a name of a known host, this method will tie this agent to the host named in designation. |
InetAddress |
whereAreYou()
Returns the InetAddress of the machine where the agent is running |
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 |
Constructor Detail |
public AgentAgent() throws RemoteException
public AgentAgent(AgentID agentID) throws RemoteException
Method Detail |
public void replaceExceptionHandler(AgentExceptionHandler r)
public MetaglueAgent getMetaglueAgent()
public AgentID getMetaglueAgentID() throws RemoteException
public Agent reliesOnSynch(AgentID agentID)
reliesOn(String)
public void startAgent(AgentID agentID)
public int status(AgentID agentID)
agentID
- AgentID of the target agent.reliesOn(AgentID)
public Agent reliesOn(String occupation)
agentID
- agentID of agent to startpublic Agent reliesOn(String occupation, Object designation)
reliesOn(String)
public Agent reliesOn(AgentID agentID)
reliesOn(String)
public void tiedTo(AgentID agentID) throws RemoteException
AgentID
- agentID to tie agent to ("speech.AppGrammar");public void tiedTo(AgentID theAgentID, Object[] parameters) throws RemoteException
AgentID
- agentID to tie agent to ("speech.AppGrammar");parameters
- list of paramaters given when starting up agent.tiedTo(AgentID)
public void tiedTo(String host) throws RemoteException
public void tiedTo(InetAddress host, Object[] parameters) throws RemoteException
host
- host to tie agent to ("machine.ai.mit.edu",
"128.128.128.128")protected String tieToDesignation() throws RemoteException
public Metaglue obtainMetaglueAgent(AgentID mid) throws MetaglueSystemError
public Metaglue obtainMetaglueAgentByName(String ma, boolean retry_if_fail) throws MetaglueSystemError
public Metaglue obtainMetaglueAgent(InetAddress host) throws MetaglueSystemError
public void startAgentOn(AgentID theAgentID, Metaglue metaglue, boolean agent_previously_started, Object[] parameters) throws RemoteException
public void startAgentOn(AgentID theAgentID, String host) throws RemoteException
public Properties getProperties()
public String getAttribute(String attributeName)
protected String fixAttribute(AgentID aid, String attributeName)
protected String fixAttribute(AgentID aid, String attributeName, String specialMessage) throws MissingAttributeError
public String getSociety()
public String getOccupation()
public Object getDesignation()
public AgentID getAgentID() throws RemoteException
public CatalogID getCatalogID() throws RemoteException
public Catalog getCatalog() throws RemoteException
public boolean alive() throws RemoteException
public void shutdown() throws RemoteException
public void startup() throws RemoteException
public void freezeAll() throws RemoteException
public void freezeVar(String var, Object obj)
var
- The variable name to save under.obj
- The object being saved. This must satisfy Serializable.defrost(String)
,
CrystalOutputStream
public boolean removeFrozen(String var)
var
- The variable name to remove.defrost(String)
,
freezeVar(String, Object)
public void freeze(String var, Serializable o)
var
- The variable name to save under.obj
- The object being saved.defrost(String)
,
CrystalOutputStream
public void freeze(String var, int i)
var
- The variable name to save under.i
- The object being saved.freeze(String, Serializable)
,
defrost(String)
,
CrystalOutputStream
public void freeze(String var, boolean b)
var
- The variable name to save under.b
- The object being saved.freeze(String, Serializable)
,
defrost(String)
,
CrystalOutputStream
protected void setFreezeName(String name)
public Object defrost(String var)
var
- The variable name to defrost.freezeVar(String, Object)
public boolean defrostBoolean(String var)
var
- The variable name to defrost.defrost(String)
public int defrostInt(String var)
var
- The variable name to defrost.defrost(String)
public String defrostString(String var)
var
- The variable name to defrost.defrost(String)
public Set getFrozenVariables() throws RemoteException
freezeVar(String, Object)
,
defrost(String)
public Hashtable defrostAll() throws RemoteException
freezeVar(String, Object)
,
defrost(String)
public InetAddress whereAreYou() throws RemoteException
public void setLogName(String n)
n
- A string with the new log name in it.public void log(Object obj)
obj
- The object to log.log(int, String)
public void log(int level, String info)
level
- The log level.info
- The string to send to the log.LogStream
public void log(String level, String info)
level
- The log level, usually one of "INFO", "DEBUG",
"WARNING", "ERROR", or "CRITICAL". If it's unrecognized, the log
level will be "INFO".info
- The string to send to the log.log(int, String)
public void setLogLevel(int level)
public int getLogLevel(int level)
public void addMonitor(Spy monitor) throws RemoteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |