|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--metaglue.AgentAgent | +--metaglue.MetaglueAgent
A Metaglue Agent starts agents on the VM that it is running on. A Metaglue Agent belongs to a single society, but it can manipulate agents from any society on the VM. A Metaglue Agent uses a particular Catalog Agent to get its information about agents. Multiple Metaglue Agents can exist on a single VM. A Metaglue Agent is made unique in a particular society by its designation which includes: the host of its VM. and the Catalog Agent ID of the Catalog Agent that this Metaglue Agent gets information about agents from.
Inner classes inherited from class metaglue.AgentAgent |
AgentAgent.Attribute |
Field Summary | |
static String |
defaultSociety
all the Metaglue Agents on the VM this list must be kept on the VM and not in a Catalog because the Metaglue Agents on the VM may all have different Catalog Agents that do not know about each other also this list provides an efficiency for having direct access to a Metaglue Agent from other agents this makes sense for Metaglue Agents because an agent's starting Metaglue Agent is always local. |
static MetaglueAgent |
meto
This is, when main() is called, the agent that main() produces. |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Fields inherited from interface metaglue.Agent |
ALIVE,
DIED,
NO_METAGLUE,
NOT_RUNNING,
STARTING |
Constructor Summary | |
MetaglueAgent(AgentID agentID,
AgentLoader agentLoader)
This is main constructor, since we normally grab catalog. |
|
MetaglueAgent(AgentID agentID,
AgentLoader agentLoader,
Catalog cat)
Creates a Metaglue Agent. |
Method Summary | |
static void |
clearStartLock()
Clears the lock for this Metaglue Agent starting an agent Called by the process reading the start info |
Agent |
findAgent(AgentID agentID)
Finds an agent with agent ID |
Agent |
findAgentBlocking(AgentID agentID)
|
boolean |
getAcceptAgents()
Get the value of acceptAgents. |
AgentLoader |
getAgentLoader()
Gets the Agent Loader that loaded this Metaglue Agent and that this Metaglue Agent uses |
Catalog |
getCatalog()
Gets the Catalog that this Metaglue Agent uses |
ManagedConnection |
getDatabaseConnection()
Gets the current db connection. |
static MetaglueAgent |
getMetaglueAgent(AgentID agentID)
Gets a non-remote copy of a Metaglue Agent on the VM for fast access |
static StartInfo |
getStartInfo()
Gets the start info for a starting agent |
protected void |
getStartLock()
Sets the lock for this Metaglue Agent starting an agent It should be cleared by the process reading the start info |
static Agent |
loadAgent(String argString)
|
static void |
loadAgents(String[] args)
Load the agents listed in the argument list. |
static void |
main(String[] args)
Establishes a Metalgue VM with Metaglue Agent to maintain it which in turn starts any listed agents. |
boolean |
pingMVM(String society,
String host)
|
void |
setAcceptAgents(boolean v)
Set the value of acceptAgents. |
void |
setDatabase(boolean local_db,
String dbname)
Sets the database connection parameters. |
static String[] |
setup(String[] args)
|
static String[] |
setup(String[] args,
boolean acceptAgents)
|
void |
shutdownAgent(AgentID agentID)
Shuts down the agent by removing it from the Catalog |
void |
startAgent(AgentID agentID,
Object[] parameters)
Starts an agent on the VM maintained by this Metaglue Agent |
static void |
startLocalLogManager(String society,
InetAddress localHost)
|
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,
toString,
toStub |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static MetaglueAgent meto
public static String defaultSociety
Constructor Detail |
public MetaglueAgent(AgentID agentID, AgentLoader agentLoader, Catalog cat) throws RemoteException, AgentAlreadyStartedException, FindAgentException, MissingCatalogException
agentID
- agent ID of this Metaglue AgentagentLoader
- agent loader that started this Metaglue
Agent and will be used in turn by this Metaglue Agent to start
other agentspublic MetaglueAgent(AgentID agentID, AgentLoader agentLoader) throws RemoteException, AgentAlreadyStartedException, FindAgentException, MissingCatalogException
Method Detail |
public static MetaglueAgent getMetaglueAgent(AgentID agentID)
agentID
- agentID of Metaglue Agent to get from local VMpublic AgentLoader getAgentLoader()
public Catalog getCatalog()
public Agent findAgent(AgentID agentID) throws AgentNotFoundException, FindAgentException, RemoteException
agentID
- agent ID of agent to findpublic Agent findAgentBlocking(AgentID agentID) throws FindAgentException, RemoteException
public boolean pingMVM(String society, String host)
public void startAgent(AgentID agentID, Object[] parameters) throws AgentNotDefinedException, NativityException, AgentAlreadyStartedException, SpreadException, StartAgentException, RemoteException
agentID
- agent ID of agent to startparameters
- list of arguments to constructor of agentpublic static void clearStartLock()
protected void getStartLock()
public static StartInfo getStartInfo()
public void shutdownAgent(AgentID agentID) throws RemoteException
agentID
- Agent ID of the agent to shut downpublic void setDatabase(boolean local_db, String dbname)
local_db
- Specifies whether to use a local databasedbname
- Specifies a different local database name, if given. Uses the default name `metaglue' if null.public ManagedConnection getDatabaseConnection()
public static void main(String[] args)
args
- {society catalog-host [agents...]}public static String[] setup(String[] args)
public static String[] setup(String[] args, boolean acceptAgents)
acceptAgents
- does this metaglue agent start other agents?public static void startLocalLogManager(String society, InetAddress localHost)
public static void loadAgents(String[] args)
public static Agent loadAgent(String argString)
public boolean getAcceptAgents()
public void setAcceptAgents(boolean v)
v
- Value to assign to acceptAgents.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |