|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Agent
Field Summary | |
static java.util.Hashtable |
AgentCharacteristics
A hashtable for Agent characteristics, ie AgentName, NickName, AgentHost, ANSHost, ANSName, MatchMaker, Broker, Keywords, Capabilities, DatabaseType, ProxyAgent |
CommunicateWithANS |
ansComm
|
protected AgentWindow |
gui
A link to the current Agent Window. |
static java.util.Hashtable |
userHash
A hashtable for the user to save persistent information |
MonitoredThreadGroup |
userThreadGroup
A monitored Thread Group for the user to use |
Constructor Summary | |
Agent()
Properly starts up the agent, making decisions and filling in data based on command line values and defaults. |
Method Summary | |
void |
addDebugSwitch(java.lang.String type,
boolean on)
Adds a debug switch to the current list |
void |
addTaskTemplate(java.lang.String file)
|
void |
Debug(DebugMsgCell Message)
Adds a debug message to the queue to be printed. |
void |
DebugAgent(java.lang.String Message)
Prints out a debug string from "AGENT" |
void |
exit()
Unregisters from the ANS and actually exits. |
int |
getActionResSize()
|
LinkedListQ |
getAgenda()
|
int |
getAgendaSize()
|
java.lang.String |
getAgentHost()
|
java.lang.String |
getAgentName()
|
Plan |
getagentPlan()
|
int |
getAgentPlanSize()
|
int |
getAgentPort()
|
java.lang.String |
getANSHost()
|
int |
getANSPort()
|
java.lang.String |
getARAName()
Gets the name of the current ARA. |
int |
getDebugMsgsQueueSize()
|
int |
getDebugSwitchSize()
|
int |
getIncomingQueueSize()
|
MsgOutput |
getMsgOutput()
|
java.lang.String |
getName()
|
LinkedListQ |
getObjectives()
|
int |
getObjectivesSize()
|
java.util.Hashtable |
getPending()
|
int |
getPendingSize()
|
LinkedListQ |
getSchdQ()
|
int |
getSchdQSize()
|
int |
getSendQSize()
|
LinkedListQ |
getTaskQueue()
|
int |
getTaskQueueSize()
|
java.util.Hashtable |
getTasks()
|
int |
getTaskTemplatesSize()
|
TraceTable |
getTraceTable()
Returns the trace table currently stored. |
int |
getWITQSize()
|
void |
initialize()
Starts up all the internal DECAF threads |
boolean |
isLogging()
|
boolean |
isTracing()
Returns a boolean to tell wether tracing is on or off. |
static void |
main(java.lang.String[] args)
Stores the command line arguments in a static variable and creates a new agent. |
java.lang.String |
parseCommandLine(java.lang.String x)
Returns the argument on the command line after x. |
java.lang.String |
parseCommandLine(java.lang.String x,
boolean isSwitch)
Parses the command line for x. |
int |
Qsize()
|
boolean |
registerWithANS(java.lang.String x,
int y)
Registers with an Agent Name Server. |
java.lang.Object |
removeFromPending(java.lang.Object key)
Removes an object from the pending hashtable and returns it. |
void |
runStartupTask()
Sends ou the startup task for the agent. |
void |
send(KQMLmsg kqml)
Sends the given KQML object. |
void |
send(java.lang.String message)
Sends the given String message |
void |
sendError(KQMLmsg k,
java.lang.String error)
Sends an error message. |
void |
sendLocal(KQMLmsg k)
Sends the given message to itself. |
void |
sendMessages()
Sends all the messages in the SendQ |
void |
sendNow(java.lang.String message)
Actually performs the task of sending a message. |
void |
setAgent(java.lang.String Name,
java.lang.String Host,
int Port,
java.lang.String file)
Synchronizes the internal agent variables to those set elsewhere. |
void |
setAns(java.lang.String Name,
int Port)
Syncs the internal ANS variables with ones set elsewhere |
void |
setARAName(java.lang.String name)
Sets the name of the ARA |
void |
setTaskTemplate(java.lang.String file)
|
void |
shutdownAgent()
Sends the shutdown task to the agent and then exits when done. |
void |
size()
|
int |
startListening(int port)
Creates a socket for the agent to listen to. |
void |
startLogging(java.lang.String logFile)
Turns logging on replacing the given file. |
void |
startTrace(java.lang.String taskName,
int instances,
boolean stop)
Starts the appropriate trace variables and intializes the data structures. |
void |
stopListening()
Stops listeneing to the current port and cleans up |
void |
stopLogging()
Stops logging |
void |
stopTrace()
Stops the trace and returns the data. |
void |
unregister()
Unregisters with the ANS |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.util.Hashtable userHash
public static java.util.Hashtable AgentCharacteristics
protected AgentWindow gui
public CommunicateWithANS ansComm
public MonitoredThreadGroup userThreadGroup
Constructor Detail |
public Agent()
Method Detail |
public java.lang.String parseCommandLine(java.lang.String x)
x
- The string to look for. Ex: "-agn"
public java.lang.String parseCommandLine(java.lang.String x, boolean isSwitch)
x
- The string to look for. Ex: "-anh"isSwitch
- If true then the return will be "true" and if
not found "false"
public java.lang.Object removeFromPending(java.lang.Object key)
public int startListening(int port)
public boolean registerWithANS(java.lang.String x, int y)
x
- The host address of the new name server.y
- The port for the name server.public void startLogging(java.lang.String logFile)
public void stopLogging()
public boolean isLogging()
public void setTaskTemplate(java.lang.String file)
public void addTaskTemplate(java.lang.String file)
public void setAgent(java.lang.String Name, java.lang.String Host, int Port, java.lang.String file)
public void setAns(java.lang.String Name, int Port)
public java.lang.String getARAName()
public void setARAName(java.lang.String name)
public void addDebugSwitch(java.lang.String type, boolean on)
public void initialize()
public void runStartupTask()
public void stopListening()
public void unregister()
public void sendLocal(KQMLmsg k)
public void sendError(KQMLmsg k, java.lang.String error)
public void sendMessages()
public void send(java.lang.String message)
public void send(KQMLmsg kqml)
public void sendNow(java.lang.String message)
public void startTrace(java.lang.String taskName, int instances, boolean stop)
taskName
- The name of task to trace.public void stopTrace()
public boolean isTracing()
public TraceTable getTraceTable()
public void Debug(DebugMsgCell Message)
public void DebugAgent(java.lang.String Message)
public void shutdownAgent()
public void exit()
public static void main(java.lang.String[] args)
public void size()
public int Qsize()
public int getDebugMsgsQueueSize()
public int getTaskQueueSize()
public int getSchdQSize()
public int getWITQSize()
public int getObjectivesSize()
public int getActionResSize()
public int getAgendaSize()
public int getPendingSize()
public int getIncomingQueueSize()
public int getTaskTemplatesSize()
public int getAgentPlanSize()
public int getDebugSwitchSize()
public int getSendQSize()
public java.util.Hashtable getTasks()
public MsgOutput getMsgOutput()
public LinkedListQ getTaskQueue()
public LinkedListQ getAgenda()
public LinkedListQ getSchdQ()
public LinkedListQ getObjectives()
public Plan getagentPlan()
public java.util.Hashtable getPending()
public java.lang.String getAgentHost()
public java.lang.String getAgentName()
public java.lang.String getName()
public int getAgentPort()
public java.lang.String getANSHost()
public int getANSPort()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |