metaglue
Class LocalLogManagerAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.NotifierAgent
                                |
                                +--metaglue.LocalLogManagerAgent

public class LocalLogManagerAgent
extends NotifierAgent
implements LocalLogManager

Notification So this class makes extensive use of the NotifierAgent, which we hack slightly to make it work properly with log levels. Whenever an agent is monitored, the spy gets all messages with the signature "LOGLEVEL:AgentID", where LOGLEVEL is a string representation of the logging level at which the string was sent.

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
static int CRITICAL
           
static int DEBUG
           
static int ERROR
           
static int INFO
           
static String[] LOGLEVEL
           
static int WARNING
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
LocalLogManagerAgent(AgentID id)
           
 
Method Summary
 void addAgent(AgentID id)
          Actually...these may be made obselete by the notifications already present in the catalog, as there isn't much use for them other than as ways to communicate status out to the log recepient
 void addLevelListener(int lvl, Spy lst)
          Adds a listener to a specific level - this will mostly be used for critical notifications
 void addLogListener(AgentID id, int lvl, Spy lst)
          Adds a listener to a specific agent and log level
 void addLogListener(AgentID id, Spy lst)
          Makes spy listen to all leveld for it
 void killAgent(AgentID id)
           
 void propagateMessage(int level, AgentID id, String s)
           
 void removeLogListener(AgentID id, int lvl, Spy lst)
          Removes a specific notification
 void removeLogListener(Spy lst)
          Removes all of the notifications to lst
 
Methods inherited from class agentland.util.NotifierAgent
addSpy, addSpy, getNoteTypes, getNotifyTable, gossip, hack_notify, lookupSpy, notify, notify, passNotify, putNotifyTable, removeAllSpies, removeNotifyTable, removeSpy, removeSpy, removeSpy, removeSpy, removeSpy
 
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, 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

DEBUG

public static final int DEBUG

INFO

public static final int INFO

WARNING

public static final int WARNING

ERROR

public static final int ERROR

CRITICAL

public static final int CRITICAL

LOGLEVEL

public static final String[] LOGLEVEL
Constructor Detail

LocalLogManagerAgent

public LocalLogManagerAgent(AgentID id)
                     throws RemoteException
Method Detail

propagateMessage

public void propagateMessage(int level,
                             AgentID id,
                             String s)
                      throws RemoteException
Specified by:
propagateMessage in interface LocalLogManager

addAgent

public void addAgent(AgentID id)
              throws RemoteException
Actually...these may be made obselete by the notifications already present in the catalog, as there isn't much use for them other than as ways to communicate status out to the log recepient
Specified by:
addAgent in interface LocalLogManager

killAgent

public void killAgent(AgentID id)
               throws RemoteException
Specified by:
killAgent in interface LocalLogManager

addLogListener

public void addLogListener(AgentID id,
                           int lvl,
                           Spy lst)
                    throws RemoteException
Adds a listener to a specific agent and log level
Specified by:
addLogListener in interface LocalLogManager

addLogListener

public void addLogListener(AgentID id,
                           Spy lst)
                    throws RemoteException
Makes spy listen to all leveld for it
Specified by:
addLogListener in interface LocalLogManager

addLevelListener

public void addLevelListener(int lvl,
                             Spy lst)
                      throws RemoteException
Adds a listener to a specific level - this will mostly be used for critical notifications
Specified by:
addLevelListener in interface LocalLogManager

removeLogListener

public void removeLogListener(AgentID id,
                              int lvl,
                              Spy lst)
                       throws RemoteException
Removes a specific notification
Specified by:
removeLogListener in interface LocalLogManager

removeLogListener

public void removeLogListener(Spy lst)
                       throws RemoteException
Removes all of the notifications to lst
Specified by:
removeLogListener in interface LocalLogManager