IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.recorder.core.extensibility
Interface IClientContext

All Superinterfaces:
IRecordingComponentContext

public interface IClientContext
extends IRecordingComponentContext

A context class that provides the necessary infrastructure for a client delegate to operate. The context is passed to the client delegate during its initialization. This interface is not meant to be implemented by extensions.


Method Summary
 void clientStarted()
          Indicates that the client has started and is now running.
 void clientStopped(boolean failure)
          Indicates that the client is now terminated.
 RecorderConfiguration getBoundRecorderConfiguration(short recorderId)
          Returns a configuration of a recorder bound to this client.
 short[] getBoundRecorderIds(boolean sameVirtualMachine)
          Returns the IDs of recorders bound to this client.
 Object getBoundRecorderProperty(short recorderId, String propertyName)
          Returns a runtime property of a recorder bound to this client.
 ClientConfiguration getClientConfiguration()
          Returns the client configuration that the client delegate must conform to.
 
Methods inherited from interface com.ibm.rational.test.lt.recorder.core.extensibility.IRecordingComponentContext
currentTime, dispatchMessage, getComponentUniqueId, getLog, getTimeReference
 

Method Detail

getClientConfiguration

ClientConfiguration getClientConfiguration()
Returns the client configuration that the client delegate must conform to. This method should be typically called during the delegate initialization, although it can be also invoked later.

Returns:
the client configuration that the client delegate must conform to. This instance never changes through the delegate lifetime.

clientStarted

void clientStarted()
Indicates that the client has started and is now running. If produced, this event must be the first event sent by a delegate after its start() method has been invoked. It cannot be sent more than once through the delegate lifetime.


clientStopped

void clientStopped(boolean failure)
Indicates that the client is now terminated. If produced, this event must either follow a IClientContext.clientStarted() event, or be the first event sent by a delegate after its start() method has been invoked. It cannot be sent more than once through the delegate lifetime. After this event is received by the context, the framework will dispose the client delegate. Therefore, no more event should be issued by the delegate after this one.

Parameters:
failed - Indicates whether the termination occurs because of a problem (true) or as a regular and expected termination (false). The framework will interpret a client terminating because of a failure as a reason for terminating the entire session. In other words, setting this argument to true will cause the session to stop. Otherwise, the session will stop only once all clients are terminated. It is the client responsibility to log information about the failure reason through messages sent to the user and/or the error log.

getBoundRecorderIds

short[] getBoundRecorderIds(boolean sameVirtualMachine)
Returns the IDs of recorders bound to this client.

Parameters:
sameVirtualMachine - Whether the list should be restricted to recorders that are deployed to the same virtual machine as the client. RESTRICTION to the current version: when the client is remotely deployed, only true is supported.
Returns:
A list, possibly empty, of recorder instances.

getBoundRecorderProperty

Object getBoundRecorderProperty(short recorderId,
                                String propertyName)
                                throws UnsupportedPropertyException
Returns a runtime property of a recorder bound to this client. There is a current restriction in this API that limits this to recorders deployed to the same virtual machine as the client, if the client is remotely deployed. This limitation may be removed in future versions.

Parameters:
recorderId - The id of a recorder that is bound to this client (limitation for this version: and that live in the same virtual machine if the client is remotely deployed).
propertyName - The name of the property to retrieve.
Returns:
The value of the property.
Throws:
UnsupportedPropertyException - If the recorder does not support the property (either because it does not define such a property, or because the property is read at an inappropriate time, or because the recorder does not exist, or because the recorder is not bound to the client, or because it is deployed to a different virtual machine).

getBoundRecorderConfiguration

RecorderConfiguration getBoundRecorderConfiguration(short recorderId)
Returns a configuration of a recorder bound to this client. There is a current restriction in this API that limits this to recorders deployed to the same virtual machine as the client, if the client is remotely deployed. This limitation may be removed in future versions.

Parameters:
recorderId - The id of a recorder that is bound to this client (limitation for this version: and that live in the same virtual machine if the client is remotely deployed).
Returns:
The recorder configuration, or null if the recorder does not exist, or is not bound to the client, or is deployed to a different virtual machine.

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.