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
- All Implemented Interfaces:
- Agent, LocalLogManager, MetagluePrimitives, Notifier, Remote, Serializable
- 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
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, 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, log, lookupClass, reliesOn, reliesOn, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou |
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
LocalLogManagerAgent
public LocalLogManagerAgent(AgentID id)
throws RemoteException
propagateMessage
public void propagateMessage(int level,
AgentID id,
String s)
throws RemoteException
- Specified by:
propagateMessage
in interface LocalLogManager
addLogListener
public void addLogListener(AgentID sender,
int lvl,
AgentID monitor)
throws RemoteException
- Adds a listener to a specific agent and log level
- Specified by:
addLogListener
in interface LocalLogManager
- Parameters:
sender
- The ID of the agent to watchlvl
- The level to listen tomonitor
- The AgentID of the LogMonitor
addLogListener
public void addLogListener(AgentID sender,
AgentID monitor)
throws RemoteException
- Makes monitor listen to all levels for it
- Specified by:
addLogListener
in interface LocalLogManager
- Parameters:
sender
- The AgentID of the agent generating log messagesmonitor
- The AgentID of the agent receiving log messages
addLevelListener
public void addLevelListener(int lvl,
AgentID monitor)
throws RemoteException
- Adds a listener to a specific level regardless of agent.
It should be noted that this only propagates a message to this
particular JavaVM/machine. This will mostly be used for critical
notifications
- Specified by:
addLevelListener
in interface LocalLogManager
- Parameters:
lvl
- The level to monitormonitor
- The AgentID of the monitor
removeLogListener
public void removeLogListener(AgentID sender,
int lvl,
AgentID monitor)
throws RemoteException
- Removes a specific notification
- Specified by:
removeLogListener
in interface LocalLogManager
removeLogListener
public void removeLogListener(AgentID monitor)
throws RemoteException
- Removes all of the notifications to lst
- Specified by:
removeLogListener
in interface LocalLogManager