com.sun.faban.harness.engine
Class ToolService

java.lang.Object
  extended by com.sun.faban.harness.engine.ToolService

public final class ToolService
extends Object

This file contains the class that implements the Tool service API. The Tool Service object is created by the Engine at the start of a run. The Tool Service will interpret the Tools specific parameters in the ParamRepository and start up the ToolAgents on all the machines on which the user requested that tools be run. It then connects to the ToolAgents via RMI. In the API implementation, it identifies the particular ToolAgent and passes the call along. IMPORTANT: There should be a single ToolService object in the entire framework or else multiple copies of the ToolAgent application will be spawned on the target machines. For this reason, this class is a Singleton.

Author:
Ramesh Ramachandran

Method Summary
static ToolService getHandle()
          This method is the only way that an external object can get a reference to the singleton ToolService.
 void init()
          Intializes logger.
 void kill()
          Kill all tools and ToolAgents.
 boolean setup(ParamRepository par, String outDir, ServiceManager serviceMgr)
          This method initializes the ToolAgent RMI server processes on the specified set of machines.
 void start(int delay)
          Start all tools on all machines.
 void start(int delay, int duration)
          Start all tools on all machines.
 void stop()
          Stop all tools on all machines.
 void waitFor()
          Wait for all tools.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandle

public static ToolService getHandle()
This method is the only way that an external object can get a reference to the singleton ToolService.

Returns:
reference to the single ToolService

init

public void init()
Intializes logger.


setup

public boolean setup(ParamRepository par,
                     String outDir,
                     ServiceManager serviceMgr)
This method initializes the ToolAgent RMI server processes on the specified set of machines.

Parameters:
par - The parameter repository
outDir - The run output directory, relative to Config.OUT_DIR
serviceMgr - The service manager instance
Returns:
true if setup successful, else false

start

public void start(int delay)
Start all tools on all machines.

Parameters:
delay - after which tools should start

start

public void start(int delay,
                  int duration)
Start all tools on all machines.

Parameters:
delay - after which tools should start
duration - after which tools must be stopped

stop

public void stop()
Stop all tools on all machines.


kill

public void kill()
Kill all tools and ToolAgents. This method is called when a run must be aborted or at the end of a benchmark run.


waitFor

public void waitFor()
Wait for all tools. =