agentland.resource
Class TransparentResourceManagerAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
                                |
                                +--agentland.resource.TransparentResourceManagerAgent
All Implemented Interfaces:
Agent, Good, MetagluePrimitives, Remote, ResourceManager, Serializable, Spy, TransparentResourceManager

public class TransparentResourceManagerAgent
extends GoodAgent
implements TransparentResourceManager

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
protected  AgentAgent.Attribute realRM
           
protected  ResourceManager rm
           
 
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
TransparentResourceManagerAgent()
           
 
Method Summary
 void addRequestHook(AgentID watcher)
          This is so agents can watch all resource requests on the java side and add/modify them if necessary/desired.
 boolean connect(AgentID start, AgentID end)
          Connect two agents together (in whatever sense makes sense.)
 Collection getAgentNames(AgentID id)
          Return any known String names for an agentID.
 ResourceBunch lookup(Request req, Context con, AgentID requestor)
          Get a list of things which match the name of request.
 void registerInstance(AgentID resID)
          Register a Managed Agent as alive and kicking.
 void removeRequestHook(AgentID watcher)
           
 void replaceFor(AgentID requestor, Resource res, Request req, Context con)
          On behalf of some agent, replace the resource named with some other requested resource and context as defined by the passed request
 ResourceBunch request(Request request, Context context, AgentID requestor)
           
 void updateNeed(AgentID requestor, String requestBunchName, Need need)
           
 
Methods inherited from class agentland.util.GoodAgent
addSpy, addSpy, alert, alertString, beep, error, getAlert, 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, reliesOn, 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 metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, getOldLogs, shutdown, startup, whereAreYou
 

Field Detail

realRM

protected AgentAgent.Attribute realRM

rm

protected ResourceManager rm
Constructor Detail

TransparentResourceManagerAgent

public TransparentResourceManagerAgent()
                                throws RemoteException
Method Detail

registerInstance

public void registerInstance(AgentID resID)
                      throws RemoteException
Register a Managed Agent as alive and kicking. Should be called in the agent's constructor.
Specified by:
registerInstance in interface ResourceManager

request

public ResourceBunch request(Request request,
                             Context context,
                             AgentID requestor)
                      throws RemoteException
Specified by:
request in interface ResourceManager

updateNeed

public void updateNeed(AgentID requestor,
                       String requestBunchName,
                       Need need)
                throws RemoteException
Specified by:
updateNeed in interface ResourceManager

lookup

public ResourceBunch lookup(Request req,
                            Context con,
                            AgentID requestor)
                     throws RemoteException
Get a list of things which match the name of request. Do not actually request anything, just get the things that could fill the request.
Specified by:
lookup in interface ResourceManager

replaceFor

public void replaceFor(AgentID requestor,
                       Resource res,
                       Request req,
                       Context con)
                throws RemoteException
On behalf of some agent, replace the resource named with some other requested resource and context as defined by the passed request
Specified by:
replaceFor in interface ResourceManager

connect

public boolean connect(AgentID start,
                       AgentID end)
                throws RemoteException
Connect two agents together (in whatever sense makes sense.)
Specified by:
connect in interface ResourceManager

addRequestHook

public void addRequestHook(AgentID watcher)
                    throws RemoteException
This is so agents can watch all resource requests on the java side and add/modify them if necessary/desired. (So a person locator can add person's location to request info.)
Specified by:
addRequestHook in interface ResourceManager

removeRequestHook

public void removeRequestHook(AgentID watcher)
                       throws RemoteException
Specified by:
removeRequestHook in interface ResourceManager

getAgentNames

public Collection getAgentNames(AgentID id)
                         throws RemoteException
Return any known String names for an agentID. This can be used for speech recog, management of resource or whatall.
Specified by:
getAgentNames in interface ResourceManager