IBM Rational Performance Tester SDK

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

All Superinterfaces:
IPacketAttachmentFactory, IRecordingComponentContext

public interface IRecorderContext
extends IRecordingComponentContext, IPacketAttachmentFactory

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


Method Summary
 IPacketAttachment createPacketAttachment()
          Creates a new packet attachment in write-only mode.
 RecorderConfiguration getRecorderConfiguration()
          Returns the recorder configuration that the recorder delegate must conform to.
 void packetCaptured(IRecorderPacket packet)
          Notifies the framework that a packet was captured by the recorder.
 void recorderPaused()
          Indicates that the recorder is running, but recording is disabled.
 void recorderResumed()
          Indicates that the recorder is running and recording.
 void recorderStopped(boolean failed)
          Indicates that the recorder is terminated.
 void registerMonitor(IRecorderMonitor monitor)
          Registers and initializes the specified monitor so it can operate within the recording framework.
 
Methods inherited from interface com.ibm.rational.test.lt.recorder.core.extensibility.IRecordingComponentContext
currentTime, dispatchMessage, getComponentUniqueId, getLog, getTimeReference
 

Method Detail

getRecorderConfiguration

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

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

recorderResumed

void recorderResumed()
Indicates that the recorder is running and recording. The delegate is responsible of invoking this method whenever the recorder has completed its start process, or when it is changing from "paused" state to "recording" state. This method is thread-safe and may be invoked from any thread.


recorderPaused

void recorderPaused()
Indicates that the recorder is running, but recording is disabled. The delegate is responsible of invoking this method whenever the recorder has completed its start process, or when it is changing from "running" state to "paused" state. This method is thread-safe and may be invoked from any thread.


recorderStopped

void recorderStopped(boolean failed)
Indicates that the recorder is terminated. A recorder is required to always send this event during its lifetime, and no more event can be sent after this one. Besides, all packet attachments created by the delegate should be closed at the time this event is sent. After this event is received by the context, the framework will dispose the recorder delegate. This method is thread-safe and may be invoked from any thread.

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 recorder 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 recorder responsibility to log information about the failure reason through messages sent to the user and/or the error log.

packetCaptured

void packetCaptured(IRecorderPacket packet)
Notifies the framework that a packet was captured by the recorder. The framework expects the packet to be immutable once this method is invoked. However it may contain references to one or more IPacketAttachment: these attachments are allowed to have an active output stream even after this method is invoked.

Parameters:
packet - A recorder packet, whose implementation is recorder-dependent.

createPacketAttachment

IPacketAttachment createPacketAttachment()
Creates a new packet attachment in write-only mode. Packet attachments are used to store large contents which may not fit in memory. The returned attachment must be referenced from one or more packets, otherwise the reader will have no way to retrieve them.

Specified by:
createPacketAttachment in interface IPacketAttachmentFactory
Returns:
A packet attachment in write-only mode. The output stream of the returned attachment is already opened and must be closed by the caller.

registerMonitor

void registerMonitor(IRecorderMonitor monitor)
Registers and initializes the specified monitor so it can operate within the recording framework.

Parameters:
monitor - An uninitialized recorder monitor.

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.