agentland.util
Class GoodAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
Direct Known Subclasses:
ConnectionMakerAgent, DrapesManagerSpeechAgent, LightManagerSpeechAgent, LoggerAgent, ManagedAgent, MSWindowAgent, NamerAgent, SocietyAgent, SpeechAgent, TestAgent, UserInfoAgent

public class GoodAgent
extends AgentAgent
implements Good, Spy

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
protected  Beeper alert
           
protected  Notifier 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
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
GoodAgent()
           
 
Method Summary
protected  void addSpy(String noteType)
           
protected  void addSpy(String methodName, String noteType)
           
 void alert(String s)
           
protected  void alertString(String s)
          Print to console a string with *s to inform user in a nice and visible way.
 void beep()
           
 void error(String info)
           
protected  void getAlert()
           
 Vector getHistory()
           
 String getHistoryElement(int i)
           
protected  Map getPersistentMap(String start_name)
          Get persistent map from where-ever they are stored.
 void log(int level, String info)
          Send a log message to the logging stream.
 void notify(String name, Serializable details)
           
protected  void removeSpy(String noteType)
          Removes a spy.
protected  void removeSpy(String methodName, String noteType)
          Removes a spy.
 void resetHistory()
           
protected  Agent safeRely(AgentID s)
          Deprecated. Use reliesOn( AgentID ).
protected  Agent safeRely(String s)
          Deprecated. Use reliesOn( String ).
protected  Agent safeRely(String s, String t)
          Deprecated. Use reliesOn( AgentID ).
protected  void setNiceLogName(String name)
          Set log name to given name, but add designation if designation is not "".
 void tell(Secret s)
          Default callback for addSpy()
 
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, reliesOn, 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

alert

protected Beeper alert

notifier

protected Notifier notifier
Constructor Detail

GoodAgent

public GoodAgent()
          throws RemoteException
Method Detail

resetHistory

public void resetHistory()
                  throws RemoteException
Specified by:
resetHistory in interface Good

getHistory

public Vector getHistory()
                  throws RemoteException
Specified by:
getHistory in interface Good

getHistoryElement

public String getHistoryElement(int i)
                         throws RemoteException
Specified by:
getHistoryElement in interface Good

log

public void log(int level,
                String info)
Description copied from class: AgentAgent
Send a log message to the logging stream. The log level will be one of the level constants listed in LogStream.
Overrides:
log in class AgentAgent
Tags copied from class: AgentAgent
Parameters:
level - The log level.
info - The string to send to the log.
See Also:
LogStream

error

public void error(String info)

getAlert

protected void getAlert()

beep

public void beep()

alert

public void alert(String s)

alertString

protected void alertString(String s)
Print to console a string with *s to inform user in a nice and visible way.

notify

public void notify(String name,
                   Serializable details)

addSpy

protected void addSpy(String methodName,
                      String noteType)

addSpy

protected void addSpy(String noteType)

removeSpy

protected void removeSpy(String methodName,
                         String noteType)
Removes a spy.
Parameters:
methodName - a String value
noteType - a String value

removeSpy

protected void removeSpy(String noteType)
Removes a spy.
Parameters:
noteType - a String value

tell

public void tell(Secret s)
          throws RemoteException
Default callback for addSpy()
Specified by:
tell in interface Spy

safeRely

protected Agent safeRely(String s)
Deprecated. Use reliesOn( String ).


safeRely

protected Agent safeRely(AgentID s)
Deprecated. Use reliesOn( AgentID ).


safeRely

protected Agent safeRely(String s,
                         String t)
Deprecated. Use reliesOn( AgentID ).


setNiceLogName

protected void setNiceLogName(String name)
Set log name to given name, but add designation if designation is not "".

getPersistentMap

protected Map getPersistentMap(String start_name)
Get persistent map from where-ever they are stored. NOTE: These maps have agentID's OCCUPATION scope. If name is null or "", then just use occupation, else use occupation and then "-" and then the name.