|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.harness.tools.GenericTool
@Deprecated public class GenericTool
GenericTool is an abstract class that all tools should extend. It provides the basic functionality for most tools. The tools modelled in GenericTool are the common system tools like vmstat, mpstat etc where the user arguments are directly passed to the tool and the tool is stopped by simply killing the corresponding process. When tools differ in functionality (for example statit), they should override the abstract class methods, configure, start, stop kill. Note that they can still use the abstract class methods to transfer the stdout, stderr from the tool to the master machine (not to mention cut and paste a large chunk of the remaining code).
Tool
Field Summary | |
---|---|
protected Timer |
timer
Deprecated. The timer used for scheduling the start of the tool. |
Constructor Summary | |
---|---|
GenericTool()
Deprecated. Constructs the GenericTool. |
Method Summary | |
---|---|
protected void |
buildCmd(List<String> argList)
Deprecated. Builds the command from the path, tool name, and argument list. |
void |
configure(String tool,
List<String> argList,
String path,
String outDir,
String host,
String masterhost,
CmdAgentImpl cmdAgent,
CountDownLatch latch)
Deprecated. This is the method that should get the arguments to call the tool with. |
protected void |
finish()
Deprecated. Finish up the tool. |
void |
kill()
Deprecated. This method is required by the Tool API. |
protected void |
start()
Deprecated. Starts the tool. |
boolean |
start(int delay)
Deprecated. This method is responsible for starting up the tool utility. |
boolean |
start(int delay,
int duration)
Deprecated. This method is responsible for starting up the tool and stopping it after the duration specified. |
void |
stop()
Deprecated. This method is responsible for stopping the tool utility. |
protected void |
stop(boolean warn)
Deprecated. This method is responsible for stopping the tool utility. |
protected void |
xferLog()
Deprecated. Transfers the tool output back to the master. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Timer timer
Constructor Detail |
---|
public GenericTool()
Method Detail |
---|
public void configure(String tool, List<String> argList, String path, String outDir, String host, String masterhost, CmdAgentImpl cmdAgent, CountDownLatch latch)
configure
in interface Tool
tool
- The tool to startargList
- The tool argumentspath
- The path, if any, to find the tooloutDir
- The output directoryhost
- The host to run the toolmasterhost
- The Faban mastercmdAgent
- The command agent for running commandslatch
- Latch set when tool is doneprotected void buildCmd(List<String> argList)
argList
- The argument listpublic void kill()
kill
in interface Tool
public boolean start(int delay, int duration)
start
in interface Tool
delay
- int delay (sec) after which start should be calledduration
- int duration for which the tool needs to be run
public boolean start(int delay)
start
in interface Tool
delay
- int delay (sec) after which start should be called
protected void start()
public void stop()
stop
in interface Tool
protected void stop(boolean warn)
warn
- Whether to warn if the tool already ended.protected void xferLog()
protected void finish()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |