agentland.rufus
Class ConfuciusClockAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
                                |
                                +--agentland.resource.ManagedAgent
                                      |
                                      +--agentland.rufus.DaemonAgent
                                            |
                                            +--agentland.rufus.ConfuciusClockAgent
All Implemented Interfaces:
Agent, Confucius, ConfuciusClock, Daemon, Good, Managed, MetagluePrimitives, Remote, Serializable, Spy
Direct Known Subclasses:
ConfuciusSignAgent, MumbleAgent

public class ConfuciusClockAgent
extends DaemonAgent
implements ConfuciusClock

This agent announces random sayings every so often. It also sends out an event via notifier so other agents can get it. ("confucius" is message type.)

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
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
 
Constructor Summary
ConfuciusClockAgent()
           
 
Method Summary
 void act()
           
 void addSaying(String saying)
           
 void fix()
           
 AgentID getConfucius()
          Get the Confucius used by this clock.
protected  Confucius getConfucius(Object which)
           
 String getSaying()
           
 String getSayingNumber(int i)
           
 void listSayings()
          Print to console.
 int numSayings()
           
protected  void pontificate(String what)
           
 void scheduleSaying(String s)
          schedule a saying to be mumbled (i.e.
 void setSaying(int ind, String saying)
           
 void setSilent(boolean silent)
          true means do not talk, only send out events.
 void startClock()
           
 void stopClock()
           
 void useSayingBase(String mapname)
          Use the saying database that the Conf.
 
Methods inherited from class agentland.rufus.DaemonAgent
getMeanTime, isStopped, setMeanTime, startDaemon, stopDaemon
 
Methods inherited from class agentland.resource.ManagedAgent
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, 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, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, 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, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface agentland.rufus.Daemon
getMeanTime, isStopped, setMeanTime, startDaemon, stopDaemon
 
Methods inherited from interface agentland.resource.Managed
getNeed, replace, replace, resources, yank, yank
 
Methods inherited from interface agentland.util.Good
getHistory, getHistoryElement, resetHistory
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, getOldLogs, shutdown, startup, whereAreYou
 
Methods inherited from interface agentland.util.Spy
tell
 

Constructor Detail

ConfuciusClockAgent

public ConfuciusClockAgent()
                    throws RemoteException
Method Detail

stopClock

public void stopClock()
               throws RemoteException
Specified by:
stopClock in interface ConfuciusClock

startClock

public void startClock()
                throws RemoteException
Specified by:
startClock in interface ConfuciusClock

getConfucius

protected Confucius getConfucius(Object which)
                          throws RemoteException

setSilent

public void setSilent(boolean silent)
               throws RemoteException
Description copied from interface: ConfuciusClock
true means do not talk, only send out events.
Specified by:
setSilent in interface ConfuciusClock

act

public void act()
Overrides:
act in class DaemonAgent

pontificate

protected void pontificate(String what)

getSayingNumber

public String getSayingNumber(int i)
                       throws RemoteException
Specified by:
getSayingNumber in interface Confucius

getSaying

public String getSaying()
                 throws RemoteException
Specified by:
getSaying in interface Confucius

scheduleSaying

public void scheduleSaying(String s)
Description copied from interface: ConfuciusClock
schedule a saying to be mumbled (i.e. temporarily augment the database.
Specified by:
scheduleSaying in interface ConfuciusClock

addSaying

public void addSaying(String saying)
               throws RemoteException
Specified by:
addSaying in interface Confucius

numSayings

public int numSayings()
               throws RemoteException
Specified by:
numSayings in interface Confucius

setSaying

public void setSaying(int ind,
                      String saying)
               throws RemoteException
Specified by:
setSaying in interface Confucius

fix

public void fix()
         throws RemoteException

useSayingBase

public void useSayingBase(String mapname)
                   throws RemoteException
Description copied from interface: Confucius
Use the saying database that the Conf. Agent of the given designation mapname would use.
Specified by:
useSayingBase in interface Confucius

getConfucius

public AgentID getConfucius()
                     throws RemoteException
Description copied from interface: ConfuciusClock
Get the Confucius used by this clock.
Specified by:
getConfucius in interface ConfuciusClock

listSayings

public void listSayings()
                 throws RemoteException
Print to console.
Specified by:
listSayings in interface Confucius