metaglue
Interface Catalog

All Known Implementing Classes:
CatalogAgent

public interface Catalog
extends Notifier

The Catalog -- center of metaglue


 Hearing stuff from the Catalog:
   register, via addSpy on the Catalog, for "load.INTERFACE"
   events.  Then implement tell( Secret s ) and you will get
   secrets with a details() of the AgentID in question.

  eg in constructor:  getCatalog().addSpy( getAgentID(),
                                           "load.agentland.test.Test" );
  and then
  public void tell( Secret s )
  {
      say( "Got " + s.details() + " as agentID" );
  }
 remember to make your agent interface extend agentland.util.Spy
 

See Also:
CatalogAgent, Notifier

Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Method Summary
 void add(AgentID agentID, Remote agentAgent)
           
 void addCatalogMonitor(CatalogMessageListener cml)
           
 int checkStatus(AgentID agentID)
           
 Vector enumerateAgents()
           
 Vector enumerateAgents(Filter filter)
          Return an enumeration of all of the AgentID's in this catalog that pass the passed filter.
 Agent lookup(AgentID agentID)
           
 Agent lookupBlocking(AgentID agentID)
           
 void remove(AgentID agentID)
           
 void removeCatalogMonitor(CatalogMessageListener cml)
           
 void replaceStartingMG(AgentID aID, AgentID mID)
           
 
Methods inherited from interface agentland.util.Notifier
addSpy, addSpy, gossip, notify, passNotify, removeAllSpies, removeSpy, removeSpy
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, shutdown, startup, whereAreYou
 

Method Detail

checkStatus

public int checkStatus(AgentID agentID)
                throws RemoteException

lookup

public Agent lookup(AgentID agentID)
             throws RemoteException,
                    NotBoundException,
                    AccessException

lookupBlocking

public Agent lookupBlocking(AgentID agentID)
                     throws RemoteException,
                            AccessException

add

public void add(AgentID agentID,
                Remote agentAgent)
         throws RemoteException,
                AlreadyBoundException

remove

public void remove(AgentID agentID)
            throws RemoteException,
                   AccessException

replaceStartingMG

public void replaceStartingMG(AgentID aID,
                              AgentID mID)
                       throws RemoteException

addCatalogMonitor

public void addCatalogMonitor(CatalogMessageListener cml)
                       throws RemoteException

removeCatalogMonitor

public void removeCatalogMonitor(CatalogMessageListener cml)
                          throws RemoteException

enumerateAgents

public Vector enumerateAgents(Filter filter)
                       throws RemoteException
Return an enumeration of all of the AgentID's in this catalog that pass the passed filter.

If you use agentland.util.AgentRegexp's catalogFilter it will make sure each of the 3 elements passed matches (as a substring) NULL for any of the matching parts is the wildcard. $ indicates a beginning or end of a string. eg: enumerateAgents( AgentRegexp.makegFilter( "$luke", "metaglue.MetaglueAgent", nul ) ) gives all metaglue agents for society luke, lukeshal, and anything starting with luke.

Returns:
Vector of AgentIDs

enumerateAgents

public Vector enumerateAgents()
                       throws RemoteException