|
IBM Rational Performance Tester SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.rational.test.lt.recorder.core.extensibility.BaseClientDelegate
com.ibm.rational.test.lt.recorder.core.clients.AbstractExecutableClientDelegate
com.ibm.rational.test.lt.recorder.core.clients.ProcessBuilderClientDelegate
public abstract class ProcessBuilderClientDelegate
An implementation of AbstractExecutableClientDelegate
, using a Java
ProcessBuilder to launch the executable. This class must be sub-classed to initialize
the required properties in ProcessBuilderClientDelegate.initialize(IClientContext)
. A concrete implementation
of this client is accessible using the client ID com.ibm.rational.test.lt.recorder.core.application.
Field Summary |
---|
Fields inherited from class com.ibm.rational.test.lt.recorder.core.clients.AbstractExecutableClientDelegate |
---|
ARGUMENTS_PROPERTY, CONSOLE_ERR_PROPERTY, CONSOLE_IN_PROPERTY, CONSOLE_OUT_PROPERTY, ENVIRONMENT_PROPERTY, PROGRAM_PATH_PROPERTY, WAIT_FOR_PROCESS_TREE_TERMINATION_PROPERTY, WORKKING_DIRECTORY_PROPERTY |
Constructor Summary | |
---|---|
ProcessBuilderClientDelegate()
|
Method Summary | |
---|---|
protected static String |
compactCommand(List<String> command)
|
protected static String |
compactEnvironment(Map<String,String> env)
|
protected static List<String> |
explodeCommand(String command)
|
protected static Map<String,String> |
explodeEnvironment(String env)
|
protected List<String> |
getArguments()
|
protected Map<String,String> |
getEnvironment()
|
protected File |
getProgramPath()
|
protected File |
getWorkingDirectory()
|
void |
initialize(IClientContext context)
This method should be overloaded by implementations to set (at least) the program path property ( ProcessBuilderClientDelegate.setProgramPath(File) ), and optionally the working
directory (ProcessBuilderClientDelegate.setWorkingDirectory(File) and the environment
(ProcessBuilderClientDelegate.setEnvironment(Map) ). |
protected boolean |
isShowErrConsole()
|
protected boolean |
isShowInConsole()
|
protected boolean |
isShowOutConsole()
|
protected boolean |
isWaitForProcessTreeTermination()
|
void |
kill()
Asks the client delegate to stop the client immediately and lose data if necessary. |
protected void |
processAboutToStart()
Override this method to perform actions just before the process starts |
protected void |
processTerminated(boolean failed)
Override this method to perform actions when the process terminates. |
protected void |
setArguments(List<String> args)
|
protected void |
setArguments(String compactArguments)
|
protected void |
setEnvironment(Map<String,String> environment)
|
protected void |
setEnvironment(String environment)
|
protected void |
setProgramPath(File path)
|
protected void |
setProgramPath(String path)
|
protected void |
setShowErrConsole(boolean show)
|
protected void |
setShowInConsole(boolean show)
|
protected void |
setShowOutConsole(boolean show)
|
protected void |
setWaitForProcessTreeTermination(boolean wait)
|
protected void |
setWorkingDirectory(File dir)
|
protected void |
setWorkingDirectory(String dir)
|
void |
start()
Asks the client delegate to start the client. |
void |
stop()
Asks the client delegate to stop the client. |
Methods inherited from class com.ibm.rational.test.lt.recorder.core.clients.AbstractExecutableClientDelegate |
---|
getProperty, setProperty |
Methods inherited from class com.ibm.rational.test.lt.recorder.core.extensibility.BaseClientDelegate |
---|
getContext, messageReceived, postStop, preStart, sendStarted, sendStopped, sendUserMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProcessBuilderClientDelegate()
Method Detail |
---|
public void initialize(IClientContext context) throws DelegateInitializeException
ProcessBuilderClientDelegate.setProgramPath(File)
), and optionally the working
directory (ProcessBuilderClientDelegate.setWorkingDirectory(File)
and the environment
(ProcessBuilderClientDelegate.setEnvironment(Map)
). Implementations should call the super implementation
first.
initialize
in interface IClientDelegate
initialize
in class BaseClientDelegate
context
- The client context, that provides the client configuration
that this instance should conform to, and a mechanism for the delegate
to send events to other involved components.
CoreException
DelegateInitializeException
- If the delegate cannot be initialized or will not be able
to run properly.public final void start()
IClientDelegate
IClientContext.clientStarted()
.
public final void stop()
IClientDelegate
IClientDelegate.start()
has been invoked. This method should return
without waiting for the stop process to be completed. The delegate is required to
notify its context when the stop is complete by invoking IClientContext#clientStopped()
.
public final void kill()
IClientDelegate
IClientDelegate.start()
has been invoked. This method should return
without waiting for the stop process to be completed. The delegate is required to
notify its context when the stop is complete by invoking IClientContext#clientStopped()
.
protected void processTerminated(boolean failed)
failed
- protected void processAboutToStart() throws Exception
Exception
protected void setProgramPath(String path)
protected void setArguments(String compactArguments)
protected void setWorkingDirectory(String dir)
protected void setEnvironment(String environment)
protected void setProgramPath(File path)
setProgramPath
in class AbstractExecutableClientDelegate
protected void setArguments(List<String> args)
setArguments
in class AbstractExecutableClientDelegate
protected void setEnvironment(Map<String,String> environment)
setEnvironment
in class AbstractExecutableClientDelegate
protected void setWorkingDirectory(File dir)
setWorkingDirectory
in class AbstractExecutableClientDelegate
protected void setShowOutConsole(boolean show)
setShowOutConsole
in class AbstractExecutableClientDelegate
protected void setShowErrConsole(boolean show)
setShowErrConsole
in class AbstractExecutableClientDelegate
protected void setShowInConsole(boolean show)
setShowInConsole
in class AbstractExecutableClientDelegate
protected void setWaitForProcessTreeTermination(boolean wait)
setWaitForProcessTreeTermination
in class AbstractExecutableClientDelegate
protected File getProgramPath()
getProgramPath
in class AbstractExecutableClientDelegate
protected List<String> getArguments()
getArguments
in class AbstractExecutableClientDelegate
protected File getWorkingDirectory()
getWorkingDirectory
in class AbstractExecutableClientDelegate
protected Map<String,String> getEnvironment()
getEnvironment
in class AbstractExecutableClientDelegate
protected boolean isShowOutConsole()
isShowOutConsole
in class AbstractExecutableClientDelegate
protected boolean isShowErrConsole()
isShowErrConsole
in class AbstractExecutableClientDelegate
protected boolean isShowInConsole()
isShowInConsole
in class AbstractExecutableClientDelegate
protected boolean isWaitForProcessTreeTermination()
isWaitForProcessTreeTermination
in class AbstractExecutableClientDelegate
protected static List<String> explodeCommand(String command)
protected static String compactCommand(List<String> command)
protected static Map<String,String> explodeEnvironment(String env)
protected static String compactEnvironment(Map<String,String> env)
|
IBM Rational Performance Tester SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |