agentland.web
Class WebInterfaceAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.web.WebInterfaceAgent
- All Implemented Interfaces:
- Agent, Good, MetagluePrimitives, Remote, Serializable, Spy, WebInterface
- public class WebInterfaceAgent
- extends GoodAgent
- implements WebInterface
This class serves as an interface between the servlet and the rest
of the metaglue agent community. This class contains a tool for
starting an instance of this agent up and another one for
communicating web requests to other agents;
- See Also:
AgentAgent
,
WebInterface
, Serialized Form
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, whereAreYou |
WebInterfaceAgent
public WebInterfaceAgent()
throws RemoteException
test
public String test(String fileName,
String society)
throws RemoteException
- Specified by:
test
in interface WebInterface
setHeader
public void setHeader(String fileName,
String society)
throws RemoteException
- Specified by:
setHeader
in interface WebInterface
setFooter
public void setFooter(String fileName,
String society)
throws RemoteException
- Specified by:
setFooter
in interface WebInterface
init
public void init()
throws RemoteException
- Specified by:
init
in interface WebInterface
getWebInterfaceAgent
public static WebInterfaceAgent getWebInterfaceAgent(String catalog)
throws RemoteException
- This static method is called from a servlet to produce an
instance of this agent. This method will create a metaglue
agent in this vm and ask it to create an instance of
WebInterfaceAgent here as well.
- Parameters:
catalog
- name of the host running the catalog that the
new agent should register with- Returns:
- the WebInterfaceAgent object -- it has to be local!
getWebInterface
public WebInterface getWebInterface(String catalog)
throws RemoteException
- Specified by:
getWebInterface
in interface WebInterface
toString
public String toString()
- Overrides:
toString
in class AgentAgent
makeWebCall
public String makeWebCall(String agentname,
Hashtable h)
- This is the method a servlet will call in order to communicate
with other agents.
- Parameters:
agentname
- a string representation of the agent to be
contactedh
- a hashtable with all the variables and their values
from the form submitted from the web- Returns:
- HTML string from the agent we just called