agentland.naming
Class ResolverAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--agentland.naming.ResolverAgent
- All Implemented Interfaces:
- Agent, Good, Managed, MetagluePrimitives, Remote, Resolver, Serializable, Spy
- public class ResolverAgent
- extends ManagedAgent
- implements Resolver
- See Also:
- Serialized Form
Method Summary |
boolean |
addReference(Object o,
Object reference)
|
protected void |
createPM()
|
protected boolean |
doAddReference(Object o,
Object reference)
|
boolean |
doContainsReference(Object key,
Object val)
Returns true if the list of values for a key contains the
value; false otherwise |
protected boolean |
doRemoveReference(Object key,
Object val)
Remove the value from the list of values associated with a
given key (there can be many values under the same key) |
protected boolean |
doReplaceReference(Object o,
Object oldRef,
Object newRef)
|
Vector |
getObjects(Object reference)
Given a reference, this method should return a list of all
objects associated with this reference |
Vector |
getObjects(String reference)
|
Object |
getReference(Object o)
|
Vector |
getReferences(Object o)
|
boolean |
removeReference(Object o,
Object reference)
Removes a single reference from the list of all references
under the object |
boolean |
removeReferences(Object o)
Removes all references to an object. |
boolean |
replaceReference(Object o,
Object oldRef,
Object newRef)
Returns true if the old reference existed AND the new one was
added succewssfuly; false otherwise |
protected void |
setUpReverseMap()
|
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 interface agentland.util.Spy |
tell |
ResolverAgent
public ResolverAgent()
throws RemoteException
createPM
protected void createPM()
throws RemoteException
setUpReverseMap
protected void setUpReverseMap()
throws RemoteException
getReferences
public Vector getReferences(Object o)
throws RemoteException
- Specified by:
getReferences
in interface Resolver
getReference
public Object getReference(Object o)
throws RemoteException
- Specified by:
getReference
in interface Resolver
addReference
public boolean addReference(Object o,
Object reference)
throws RemoteException
- Specified by:
addReference
in interface Resolver
replaceReference
public boolean replaceReference(Object o,
Object oldRef,
Object newRef)
throws RemoteException
- Returns true if the old reference existed AND the new one was
added succewssfuly; false otherwise
- Specified by:
replaceReference
in interface Resolver
removeReference
public boolean removeReference(Object o,
Object reference)
throws RemoteException
- Removes a single reference from the list of all references
under the object
- Specified by:
removeReference
in interface Resolver
- Returns:
- true if the reference existed; false otherwise
removeReferences
public boolean removeReferences(Object o)
throws RemoteException
- Removes all references to an object.
- Specified by:
removeReferences
in interface Resolver
- Returns:
- true if there was something there, false otherwise
getObjects
public Vector getObjects(Object reference)
throws RemoteException
- Given a reference, this method should return a list of all
objects associated with this reference
- Specified by:
getObjects
in interface Resolver
getObjects
public Vector getObjects(String reference)
throws RemoteException
- Specified by:
getObjects
in interface Resolver
doAddReference
protected boolean doAddReference(Object o,
Object reference)
doReplaceReference
protected boolean doReplaceReference(Object o,
Object oldRef,
Object newRef)
doRemoveReference
protected boolean doRemoveReference(Object key,
Object val)
- Remove the value from the list of values associated with a
given key (there can be many values under the same key)
- Returns:
- true if there was something there, false otherwise
doContainsReference
public boolean doContainsReference(Object key,
Object val)
- Returns true if the list of values for a key contains the
value; false otherwise