Class agent.Launcher.AgentLauncher
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class agent.Launcher.AgentLauncher

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----agent.Launcher.AgentLauncher

public final class AgentLauncher
extends Applet
implements Runnable
An applet that allows users to launch Agents out into the Agent system network. Gives the user a list of Agents to choose from, then allows him to launch it, view the results, and/or kill the dispatched Agent.

Variable Index

 o AGENT_DISPATCHED
 o AGENT_PICKED
 o AGENT_STOPPED
 o ALVector
 o ANIMATED
 o ANIMATED_STRING
 o DISABLE_ALL
 o DISPATCH_STRING
 o HIGHPRIORITY
 o KILL_STRING
 o LOWPRIORITY
 o MAX_ANIMATOR_THREADS
 o MEDIUMPRIORITY
 o NO_AGENT
 o PICK_STRING
 o RESULT_STRING
 o STOP_STRING
 o TEXT_ONLY
 o TEXT_ONLY_STRING
 o bImageLoadingError
 o dispatchedImages
 o inpipeStream
 o noResultImages
 o notStartedImages
 o outpipeStream
 o resultFile
 o resultImages
 o runningImages
 o sBadImage

Method Index

 o AddToState(String)
 o Dispatch()
Dispatch the current Agent.
 o LoadAgentClass(Frame, String)
 o LoadAnimationImages()
Load all the images this applet needs for its animation sequences.
 o LoadTest()
 o MessageBox(String)
 o StopAgent(String)
 o addAgentDisplay(String)
The original addAgentDisplay method.
 o addAgentDisplay1(String)
The new addAgentDisplay method.
 o addAgentFace(String)
 o addAnimation()
 o clicked(int, int)
 o endDispatch()
endDispatch - Called when the user has decided to call off this search.
 o getFrame()
Get the Frame window that is the parent of all the windows currently on the screen.
 o handleEvent(Event)
 o imageUpdate(Image, int, int, int, int, int)
Override of Component.imageUpdate, an implementation of ImageObserver.imageUpdate.
 o init()
Initialize the applet.
 o mouseUp(Event, int, int)
 o paintBorder(Graphics)
Paint the border surrounding the entire game.
 o reportResult(String, String)
A method called by the message processing code (AgentDispatcher) to change an agents state from running to finished with or without results.
 o reportResults(Result)
reportResults - When an Agent sends the result of a search to the AgentConnectionHandler, the handler calls this to place the results pointer into the results HTML doc and to visually notify the user that this server has finished with whatever results.
 o run()
The main loop for the main thread.
 o setAgentURL(String)
 o setRunning(int)
 o showNoResults(String)
showNoResults -
 o showProperties()
 o showResults(String, String)
showResults -
 o start()
start - Whenever a user visits our page, Applet calls this.
 o startDispatch()
startDispatch - Called when the user has chosen to dispatch an Agent.
 o stop()
Stop this thread.
 o update(Graphics)
Update the window, erasing things from their old positions and painting them anew at their current positions.

Variables

 o bImageLoadingError
  public boolean bImageLoadingError
 o ALVector
  public Vector ALVector
 o sBadImage
  public String sBadImage
 o inpipeStream
  public PipedInputStream inpipeStream
 o outpipeStream
  public PipedOutputStream outpipeStream
 o TEXT_ONLY
  public final int TEXT_ONLY
 o ANIMATED
  public final int ANIMATED
 o resultFile
  public ResultFile resultFile
 o LOWPRIORITY
  public final int LOWPRIORITY
 o MEDIUMPRIORITY
  public final int MEDIUMPRIORITY
 o HIGHPRIORITY
  public final int HIGHPRIORITY
 o notStartedImages
  public AgentImage notStartedImages[]
 o runningImages
  public AgentImage runningImages[]
 o resultImages
  public AgentImage resultImages[]
 o noResultImages
  public AgentImage noResultImages[]
 o dispatchedImages
  public AgentImage dispatchedImages[]
 o MAX_ANIMATOR_THREADS
  public final int MAX_ANIMATOR_THREADS
 o DISABLE_ALL
  public final static int DISABLE_ALL
 o NO_AGENT
  public final static int NO_AGENT
 o AGENT_PICKED
  public final static int AGENT_PICKED
 o AGENT_DISPATCHED
  public final static int AGENT_DISPATCHED
 o AGENT_STOPPED
  public final static int AGENT_STOPPED
 o TEXT_ONLY_STRING
  public final static String TEXT_ONLY_STRING
 o ANIMATED_STRING
  public final static String ANIMATED_STRING
 o DISPATCH_STRING
  public final static String DISPATCH_STRING
 o STOP_STRING
  public final static String STOP_STRING
 o PICK_STRING
  public final static String PICK_STRING
 o RESULT_STRING
  public final static String RESULT_STRING
 o KILL_STRING
  public final static String KILL_STRING

Methods

 o imageUpdate
  public synchronized boolean imageUpdate(Image img,
                                          int infoflags,
                                          int x,
                                          int y,
                                          int width,
                                          int height)
Override of Component.imageUpdate, an implementation of ImageObserver.imageUpdate. Called by an image producer every time an interesting point in image loading occurs.
Parameters:
img - The image that we're talking about.
infoflags - The state of the image-load - a constant from ImageObservers public variable set.
Overrides:
imageUpdate in class Component
 o start
  public void start()
start - Whenever a user visits our page, Applet calls this. This is an override of an Applet method. Creates a thread and passes this AgentLauncher into it. Works because we implement the Runnable method.
Overrides:
start in class Applet
 o showProperties
  public void showProperties()
 o Dispatch
  public void Dispatch()
Dispatch the current Agent. currentAgent is an instance of the Agent we wish to dispatch, and he has already configured himself via Agent.configure. We need to get his arguments as a Vector of Strings, create a dispatcher, then tell the dispatcher to dispatch using the currentAgent with those arguments.
See Also:
Agent, AgentDispatcher
 o LoadAgentClass
  public static void LoadAgentClass(Frame f,
                                    String selected)
 o StopAgent
  public void StopAgent(String cid)
 o LoadTest
  public void LoadTest()
 o getFrame
  public Frame getFrame()
Get the Frame window that is the parent of all the windows currently on the screen. Every application has ONE Frame that can be found by trolling through the tree of Containers that makes up the hierarchy of windows in a Java application.
Returns:
The Frame that is the ultimate parent of the current Component.
 o addAnimation
  public void addAnimation()
 o addAgentFace
  public void addAgentFace(String server)
 o reportResult
  public void reportResult(String server,
                           String url)
A method called by the message processing code (AgentDispatcher) to change an agents state from running to finished with or without results.
Parameters:
url - The URL of the results file. If null, there were no results.
server - The name of the server. We find the AgentFace we need to change by searching on this name.
 o setRunning
  public void setRunning(int index)
 o stop
  public void stop()
Stop this thread.
Overrides:
stop in class Applet
 o run
  public void run()
The main loop for the main thread.
 o clicked
  public boolean clicked(int x,
                         int y)
 o handleEvent
  public boolean handleEvent(Event e)
Overrides:
handleEvent in class Component
 o init
  public void init()
Initialize the applet. Resize and load images.
Overrides:
init in class Applet
 o startDispatch
  public void startDispatch()
startDispatch - Called when the user has chosen to dispatch an Agent. Sends the Agent to our ServerList and opens the ResultFile.
 o endDispatch
  public void endDispatch()
endDispatch - Called when the user has decided to call off this search. Closes the results file and notifies the connectionHandler to kill off any Agents that report in after this point.
 o addAgentDisplay
  public void addAgentDisplay(String server)
The original addAgentDisplay method. Runs through array looking for a spot to place the new AgentFace.
Parameters:
server - The name of the server that's running this Agent.
 o addAgentDisplay1
  public void addAgentDisplay1(String server)
The new addAgentDisplay method. Runs through array looking for a spot to place the new AgentFace, letting us throw exception if we overrun array.
Parameters:
server - The name of the server that's running this Agent.
 o MessageBox
  public void MessageBox(String s)
 o showResults
  public void showResults(String s,
                          String urls)
showResults -
 o showNoResults
  public void showNoResults(String s)
showNoResults -
 o reportResults
  public void reportResults(Result r)
reportResults - When an Agent sends the result of a search to the AgentConnectionHandler, the handler calls this to place the results pointer into the results HTML doc and to visually notify the user that this server has finished with whatever results.
 o LoadAnimationImages
  public synchronized void LoadAnimationImages()
Load all the images this applet needs for its animation sequences. Blocks until all the images have been loaded over the net OR one of the images reports a load error.
 o paintBorder
  public void paintBorder(Graphics g)
Paint the border surrounding the entire game. There is no border around the board itself.
 o update
  public void update(Graphics g)
Update the window, erasing things from their old positions and painting them anew at their current positions.
Overrides:
update in class Component
 o AddToState
  public void AddToState(String inputLine)
 o setAgentURL
  public void setAgentURL(String s)
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
Overrides:
mouseUp in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index