|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Notifier allows other agents to register interest in other agent's behavior. This effectively means that many different agents can listen to what other agents are doing, and perform actions based on their behavior.
Fields inherited from interface metaglue.Agent |
ALIVE,
DIED,
NO_METAGLUE,
NOT_RUNNING,
STARTING |
Method Summary | |
void |
addSpy(AgentID spy,
String noteType)
This assumes the Spy implements the Spy interface. |
void |
addSpy(AgentID spy,
String callMethod,
String noteType)
Registers an agent as having an interest in certain messages. |
void |
gossip(Secret secret)
Does the same work as notify . |
void |
notify(Secret secret)
Sends a notification to any agents who have registered an interest in the given notification type. |
void |
passNotify(Secret secret)
So we can chain notifiers together in big nets o fun. |
void |
removeAllSpies()
|
void |
removeSpy(AgentID spy,
String noteType)
This assumes the spy implements the Spy interface. |
void |
removeSpy(AgentID spy,
String callMethod,
String noteType)
Unregisters an agent from having an interest in certain messages. |
Methods inherited from interface metaglue.Agent |
addMonitor,
alive,
getAgentID,
getMetaglueAgentID,
shutdown,
startup,
whereAreYou |
Method Detail |
public void addSpy(AgentID spy, String callMethod, String noteType) throws RemoteException
spyName
- The spy to be found.callMethod
- A string specifying the method name to call
when the requested notification occurs. The method should return
void, and take two arguments; first, a String specifying the
notification type, and second, another String with extra
information. This is the same signature as the notify method in
this class.noteType
- A simple string specifying the type of the
notification. Any Secret with a name string which _begins_ with the
passed notetype will be sent to the spy. So if a spy registers for
Boogie events, then a Boogie.Down event will get shipped to the spy
as well as strict Boogie events.AgentAgent.reliesOn(java.lang.String)
,
removeSpy(metaglue.AgentID, java.lang.String, java.lang.String)
,
notify(agentland.util.Secret)
public void addSpy(AgentID spy, String noteType) throws RemoteException
public void removeSpy(AgentID spy, String callMethod, String noteType) throws RemoteException
spyName
- A string specifiying the agent's class name.callMethod
- A string specifying the method name.noteType
- A string specifying the type of the
notification.AgentAgent.reliesOn(java.lang.String)
,
addSpy(metaglue.AgentID, java.lang.String, java.lang.String)
,
notify(agentland.util.Secret)
public void removeSpy(AgentID spy, String noteType) throws RemoteException
public void notify(Secret secret) throws RemoteException
secret
- This is the Secret to pass to any registered Spy agents.public void gossip(Secret secret) throws RemoteException
notify
.notify(Secret)
public void passNotify(Secret secret) throws RemoteException
public void removeAllSpies() throws RemoteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |