|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.harness.tools.MasterToolContext com.sun.faban.harness.tools.ToolContext
public class ToolContext
This class is a subclass of MasterToolContext.
Constructor Summary | |
---|---|
ToolContext(String tool,
ServiceContext ctx,
ToolDescription desc,
ToolWrapper wrapper)
Constructs the tool context. |
Method Summary | |
---|---|
CommandHandle |
exec(Command cmd,
boolean useOutput)
Executes a command, optionally use the stdout from this command as the tool output. |
CommandHandle |
exec(Command cmd,
boolean useOutput,
int stream)
Executes a command, optionally use the stdout or stderr from this command as the tool output. |
String |
getOutputFile()
Returns name of output file. |
ServiceContext |
getServiceContext()
Returns ServiceContext for the tool. |
String |
getServiceProperty(String key)
Obtains the service property for the given key. |
String |
getTmpDir()
Obtains the temporary directory to be used for storing temporary files. |
List<String> |
getToolArgs()
Returns list of tool arguments. |
String |
getToolName()
Returns tool name. |
int |
getToolStatus()
Returns tool status. |
CommandHandle |
java(Command cmd,
boolean useOutput)
Executes a command, optionally use the stdout from this command as the tool output. |
CommandHandle |
java(Command cmd,
boolean useOutput,
int stream)
Executes a command, optionally use the stdout or stderr from this command as the tool output. |
void |
setOutputFile(String path)
Sets the output file with the given path. |
void |
setOutputStream(CommandHandle handle)
Sets the stdout from a command to be used as the tool output. |
void |
setOutputStream(CommandHandle handle,
int stream)
Sets the stdout or stderr from a command to be used as the tool output. |
Methods inherited from class com.sun.faban.harness.tools.MasterToolContext |
---|
equals, getTool, getToolDescription, getToolId, getToolParams, getToolServiceContext, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToolContext(String tool, ServiceContext ctx, ToolDescription desc, ToolWrapper wrapper)
tool
- The tool namectx
- The service context, if anydesc
- The tool descriptionwrapper
- The tool wrapper responsible for invoking the tool.Method Detail |
---|
public int getToolStatus()
public String getToolName()
public List<String> getToolArgs()
public String getOutputFile()
public void setOutputFile(String path)
path
- The output file path.public String getServiceProperty(String key)
key
- The service property name
public ServiceContext getServiceContext()
public CommandHandle exec(Command cmd, boolean useOutput) throws IOException, InterruptedException
cmd
- The command to executeuseOutput
- Whether to use the output from this command
IOException
- The command failed to execute
InterruptedException
- Interrupted waiting for the commandpublic CommandHandle exec(Command cmd, boolean useOutput, int stream) throws IOException, InterruptedException
cmd
- The command to executeuseOutput
- Whether to use the output from this commandstream
- The stream to use as the output, STDOUT or STDERR
IOException
- The command failed to execute
InterruptedException
- Interrupted waiting for the commandpublic CommandHandle java(Command cmd, boolean useOutput) throws IOException, InterruptedException
cmd
- The command to executeuseOutput
- Whether to use the output from this command
IOException
- The command failed to execute
InterruptedException
- Interrupted waiting for the commandpublic CommandHandle java(Command cmd, boolean useOutput, int stream) throws IOException, InterruptedException
cmd
- The command to executeuseOutput
- Whether to use the output from this commandstream
- The stream to use as the output, STDOUT or STDERR
IOException
- The command failed to execute
InterruptedException
- Interrupted waiting for the commandpublic void setOutputStream(CommandHandle handle)
handle
- The command handle to the command to capture.public void setOutputStream(CommandHandle handle, int stream)
handle
- The command handle to the command to capturestream
- The stream to use as the output, STDOUT or STDERRpublic String getTmpDir()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |