public class ToolWrapper extends Object
Modifier and Type | Field and Description |
---|---|
protected Timer |
timer
The timer used for scheduling the tools.
|
Constructor and Description |
---|
ToolWrapper(Class toolClass,
MasterToolContext ctx)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(String toolName,
String path,
String outDir,
String host,
CmdAgentImpl cmdAgent,
CountDownLatch latch)
This method is responsible for configuring a tool.
|
protected void |
finish()
Finishes up the tool and notifies the infrastructure of the tool
finishing up.
|
void |
kill()
This method is responsible for killing the tool utility.
|
void |
postprocess()
This method is responsible for post-processing.
|
boolean |
start(int delay)
This method is responsible for starting a tool with given delay.
|
boolean |
start(int delay,
int duration)
This method is responsible for starting a tool with given delay and
duration.
|
void |
stop()
This method is responsible for stopping the tool utility.
|
protected void |
stop(boolean warn)
This method is responsible for stopping the tool utility.
|
protected void |
xferLog()
Transfers the tool output file back to the master.
|
protected Timer timer
public ToolWrapper(Class toolClass, MasterToolContext ctx) throws Exception
toolClass
- The tool classctx
- The master tool contextException
- Error creating the toolpublic void postprocess() throws Exception
Exception
- Any exception thrown by the wrapped methodpublic void configure(String toolName, String path, String outDir, String host, CmdAgentImpl cmdAgent, CountDownLatch latch) throws Exception
toolName
- The name of the tool.path
- The path to start the commandoutDir
- The tool output directoryhost
- The host the tool should runcmdAgent
- The local command agentlatch
- The latch used for identifying tool completionException
- If there is any errorpublic boolean start(int delay)
delay
- The lapse time after which the tool will startpublic boolean start(int delay, int duration)
delay
- The lapse time after which the tool will startduration
- The duration the tool is to runpublic void stop() throws Exception
Exception
- Any exception thrown by the wrapped methodprotected void stop(boolean warn) throws Exception
warn
- Whether to warn if the tool already ended.Exception
- Any exception thrown by the wrapped methodprotected void xferLog()
protected void finish()