Class agent.Server.AgentServer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class agent.Server.AgentServer

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----agent.Server.AgentServer

public class AgentServer
extends Thread
A standalone application for loading and running Agents that are sent to it over the net.

Variable Index

 o bRun
 o currentAgentServer
 o f
 o serverList

Constructor Index

 o AgentServer()
Constructor, builds the list of AgentServers, builds all the screen elements, including menu and menu items.

Method Index

 o LoadTest()
Test the loading of classes at this site by allowing the user to choose a class file to load, then creating/parsing a LoadMessage from that class file.
 o addDispatchedAgent(String, SocketHandler)
Add an Agent to the list, using the specified ID and SocketHandler.
 o addRunningAgent(String)
Add an agent to the list of agents running on this machine.
 o deleteDispatchedAgent(String)
Delete an agent from the list of dispatched agents because he's ended.
 o deleteDispatchedAgent(SocketHandler)
Delete an agent from the list of dispatched agents because of a socket exception.
 o deleteRunningAgent(String)
Delete an agent from the list of running agents.
 o main(String[])
The main loop for this standalone application.
 o notifyResults(ResultMessage)
Notify the AgentLauncher, via the dispatching agent server that the agent has finished running and has the specified results to report.
 o notifyStart(StartMessage)
Notify the AgentLauncher, via the dispatching agent server that the agent has started running.
 o reportResults(ResultMessage)
Add this Agents results to the cumulative results page that we've been amassing for the whole run of this Agent.
 o run()
The main loop for the AgentServer.

Variables

 o f
  public static ServerFrame f
 o bRun
  public static boolean bRun
 o currentAgentServer
  public static AgentServer currentAgentServer
 o serverList
  public static Vector serverList

Constructors

 o AgentServer
  public AgentServer()
Constructor, builds the list of AgentServers, builds all the screen elements, including menu and menu items. For now, this app only handles exit from the menu. Instantiates an acceptor thread that listens to the AgentServer port where agents to be loaded will come in.
See Also:
Frame, Panel, MenuBar, MenuItem, Acceptor

Methods

 o main
  public static void main(String argv[])
The main loop for this standalone application. Creates one AgentServer, then sets it running via Thread.start.
See Also:
Thread
 o reportResults
  public void reportResults(ResultMessage r)
Add this Agents results to the cumulative results page that we've been amassing for the whole run of this Agent.
Parameters:
r - The ResultMessage that the Agent is sending back to the AgentLauncher.
 o LoadTest
  public void LoadTest()
Test the loading of classes at this site by allowing the user to choose a class file to load, then creating/parsing a LoadMessage from that class file. DEBUGGING method.
See Also:
LoadMessage, FileDialog
 o notifyResults
  public void notifyResults(ResultMessage rm)
Notify the AgentLauncher, via the dispatching agent server that the agent has finished running and has the specified results to report.
Parameters:
rm - A results message containing the results page URL
See Also:
ResultsMessage
 o notifyStart
  public void notifyStart(StartMessage sm)
Notify the AgentLauncher, via the dispatching agent server that the agent has started running.
Parameters:
sm - A StartMessage
See Also:
StartMessage
 o addDispatchedAgent
  public void addDispatchedAgent(String id,
                                 SocketHandler sh)
Add an Agent to the list, using the specified ID and SocketHandler.
See Also:
SocketHandler
 o deleteDispatchedAgent
  public void deleteDispatchedAgent(String id)
Delete an agent from the list of dispatched agents because he's ended.
Parameters:
id - The String id of the terminating Agent.
 o deleteDispatchedAgent
  public void deleteDispatchedAgent(SocketHandler sh)
Delete an agent from the list of dispatched agents because of a socket exception.
Parameters:
sh - The SocketHandler that generated the exception.
 o addRunningAgent
  public void addRunningAgent(String id)
Add an agent to the list of agents running on this machine.
Parameters:
id - The String ID of this running agent.
 o deleteRunningAgent
  public void deleteRunningAgent(String id)
Delete an agent from the list of running agents. The Agent thread MUST BE STOPPED already when you get here.
Parameters:
id - The String id of the running agent.
 o run
  public void run()
The main loop for the AgentServer. Sits in a loop, sleeping for 1 second, then waking up to check whether the user interface has been terminated.
Overrides:
run in class Thread

All Packages  Class Hierarchy  This Package  Previous  Next  Index