IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.recorder.core.clients
Class AbstractExecutableClientDelegate

java.lang.Object
  extended by com.ibm.rational.test.lt.recorder.core.extensibility.BaseClientDelegate
      extended by com.ibm.rational.test.lt.recorder.core.clients.AbstractExecutableClientDelegate
All Implemented Interfaces:
IClientDelegate, IRecordingComponentDelegate
Direct Known Subclasses:
ProcessBuilderClientDelegate

public abstract class AbstractExecutableClientDelegate
extends BaseClientDelegate

An abstract implementation of client delegate that launches a process. The API defined by this class must be implemented by any client delegate that needs to launch a process.
In addition, the client must declare in its extension declaration in plugin.xml that it extends the client ID com.ibm.rational.test.lt.recorder.core.executableClient. This client delegate publishes runtime properties (command line, working directory and environment...). These runtime properties may be read and/or modified by client decorators.

See Also:
An implementation of this class, based on Java implementation of process launching.

Field Summary
static String ARGUMENTS_PROPERTY
          This runtime property defines the arguments to be passed to the executable.
static String CONSOLE_ERR_PROPERTY
          This runtime property defines whether the error output stream of the process should be visible to the user.
static String CONSOLE_IN_PROPERTY
          This runtime property defines whether the input console of the process should be available to the user.
static String CONSOLE_OUT_PROPERTY
          This runtime property defines whether the standard output stream of the process should be visible to the user.
static String ENVIRONMENT_PROPERTY
          This runtime property defines the initial variables environment of the program to execute.
static String PROGRAM_PATH_PROPERTY
          This runtime property defines the path of the executable to execute.
static String WAIT_FOR_PROCESS_TREE_TERMINATION_PROPERTY
          This runtime property defines whether the client should wait only for the process it has launched to exit before reporting termination (value: false), or if it should wait for the whole process tree (i.e. the launched process, and any child process directly or indirectly launched by it or by a child) (value: true).
static String WORKKING_DIRECTORY_PROPERTY
          This runtime property defines the working directory where the executable should be started.
 
Constructor Summary
AbstractExecutableClientDelegate()
           
 
Method Summary
protected abstract  List<String> getArguments()
           
protected abstract  Map<String,String> getEnvironment()
           
protected abstract  File getProgramPath()
           
 Object getProperty(String name)
          Gets a runtime property of the delegate.
protected abstract  File getWorkingDirectory()
           
protected abstract  boolean isShowErrConsole()
           
protected abstract  boolean isShowInConsole()
           
protected abstract  boolean isShowOutConsole()
           
protected abstract  boolean isWaitForProcessTreeTermination()
           
protected abstract  void setArguments(List<String> args)
           
protected abstract  void setEnvironment(Map<String,String> environment)
           
protected abstract  void setProgramPath(File path)
           
 void setProperty(String name, Object value)
          Sets the value of a runtime property of the delegate.
protected abstract  void setShowErrConsole(boolean show)
           
protected abstract  void setShowInConsole(boolean show)
           
protected abstract  void setShowOutConsole(boolean show)
           
protected abstract  void setWaitForProcessTreeTermination(boolean wait)
           
protected abstract  void setWorkingDirectory(File dir)
           
 
Methods inherited from class com.ibm.rational.test.lt.recorder.core.extensibility.BaseClientDelegate
getContext, initialize, messageReceived, postStop, preStart, sendStarted, sendStopped, sendUserMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.rational.test.lt.recorder.core.extensibility.IClientDelegate
kill, start, stop
 

Field Detail

PROGRAM_PATH_PROPERTY

public static final String PROGRAM_PATH_PROPERTY
This runtime property defines the path of the executable to execute. Value type: java.io.File. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.application. In this case, its value type is java.lang.String and it must represent an absolute path to the executable.

See Also:
Constant Field Values

ARGUMENTS_PROPERTY

public static final String ARGUMENTS_PROPERTY
This runtime property defines the arguments to be passed to the executable. Value type: java.util.List. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.application. In this case, its value type is java.lang.String and it must contain the arguments separated by a white space.

See Also:
Constant Field Values

WORKKING_DIRECTORY_PROPERTY

public static final String WORKKING_DIRECTORY_PROPERTY
This runtime property defines the working directory where the executable should be started. Value type: java.io.File. The property value may be null, meaning that the current directory of the lauching process is to be used. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.application. In this case, its value type is java.lang.String and it must represent an absolute path the directory. Default value is null.

See Also:
Constant Field Values

ENVIRONMENT_PROPERTY

public static final String ENVIRONMENT_PROPERTY
This runtime property defines the initial variables environment of the program to execute. Value type: java.util.Map. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.executableClient. In this case, its value type is java.lang.String and it must represent the set of variable environments, in the form of a semi-colon-separated list of pairs name=value (e.g. "variable1=value1;variable2=value2").

See Also:
Constant Field Values

CONSOLE_OUT_PROPERTY

public static final String CONSOLE_OUT_PROPERTY
This runtime property defines whether the standard output stream of the process should be visible to the user. Otherwise, any content directed to the standard output by the executable will be discarded. Value type: java.lang.Boolean. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.application. In this case, its value type is boolean.

See Also:
Constant Field Values

CONSOLE_ERR_PROPERTY

public static final String CONSOLE_ERR_PROPERTY
This runtime property defines whether the error output stream of the process should be visible to the user. Otherwise, any content directed to the error output by the executable will be discarded. Value type: java.lang.Boolean. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.application. In this case, its value type is boolean.

See Also:
Constant Field Values

CONSOLE_IN_PROPERTY

public static final String CONSOLE_IN_PROPERTY
This runtime property defines whether the input console of the process should be available to the user. Otherwise, no input may be sent to the input stream of the executable. Value type: java.lang.Boolean. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.application. In this case, its value type is boolean.

See Also:
Constant Field Values

WAIT_FOR_PROCESS_TREE_TERMINATION_PROPERTY

public static final String WAIT_FOR_PROCESS_TREE_TERMINATION_PROPERTY
This runtime property defines whether the client should wait only for the process it has launched to exit before reporting termination (value: false), or if it should wait for the whole process tree (i.e. the launched process, and any child process directly or indirectly launched by it or by a child) (value: true). Value type: java.lang.Boolean. Default value: true. This property can also be used in the client configuration of com.ibm.rational.test.lt.recorder.core.application. In this case, its value type is boolean.

See Also:
Constant Field Values
Constructor Detail

AbstractExecutableClientDelegate

public AbstractExecutableClientDelegate()
Method Detail

setWorkingDirectory

protected abstract void setWorkingDirectory(File dir)

setProgramPath

protected abstract void setProgramPath(File path)

setArguments

protected abstract void setArguments(List<String> args)

setEnvironment

protected abstract void setEnvironment(Map<String,String> environment)

setShowOutConsole

protected abstract void setShowOutConsole(boolean show)

setShowErrConsole

protected abstract void setShowErrConsole(boolean show)

setShowInConsole

protected abstract void setShowInConsole(boolean show)

setWaitForProcessTreeTermination

protected abstract void setWaitForProcessTreeTermination(boolean wait)

getArguments

protected abstract List<String> getArguments()

getProgramPath

protected abstract File getProgramPath()

getWorkingDirectory

protected abstract File getWorkingDirectory()

getEnvironment

protected abstract Map<String,String> getEnvironment()

isShowOutConsole

protected abstract boolean isShowOutConsole()

isShowErrConsole

protected abstract boolean isShowErrConsole()

isShowInConsole

protected abstract boolean isShowInConsole()

isWaitForProcessTreeTermination

protected abstract boolean isWaitForProcessTreeTermination()

getProperty

public Object getProperty(String name)
                   throws UnsupportedPropertyException
Description copied from interface: IRecordingComponentDelegate
Gets a runtime property of the delegate. The meaning of the property and its value is specific to the delegate and part of the interface between the delegate and other recording components. In particular, the time when the value can be read is let to the delegate implementation (for instance, a property may be read only after the component has started).

Specified by:
getProperty in interface IRecordingComponentDelegate
Overrides:
getProperty in class BaseClientDelegate
Parameters:
name - The property name
Returns:
The property value
Throws:
UnsupportedPropertyException - If the delegate does not support the property (either because it does not define such a property, or because the property is read at an inappropriate time).

setProperty

public void setProperty(String name,
                        Object value)
                 throws UnsupportedPropertyException
Description copied from interface: IRecordingComponentDelegate
Sets the value of a runtime property of the delegate. The meaning of the property and its value is specific to the delegate and part of the interface between the delegate and other recording components. In particular, the time when the value can be set is defined by the delegate implementation (for instance, a property may be set only before the component is started).

Specified by:
setProperty in interface IRecordingComponentDelegate
Overrides:
setProperty in class BaseClientDelegate
Parameters:
name - The property name
Throws:
UnsupportedPropertyException - If the delegate does not support the property (either because it does not define such a property, or because the property is set at an inappropriate time).

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.