IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.recorder.core.extensibility
Class AnnotationStateHandler

java.lang.Object
  extended by com.ibm.rational.test.lt.recorder.core.extensibility.AnnotationStateHandler
All Implemented Interfaces:
IAnnotationStateHandler

public abstract class AnnotationStateHandler
extends Object
implements IAnnotationStateHandler

Handles state management for one or more annotation types. Only one handler can manage states for a specific annotation type. Handlers must be declared using the extension point com.ibm.rational.test.lt.recorder.core.recorderAnnotation.
A state manager can process annotations sent to the annotation recorder by overriding AnnotationStateHandler.annotate(RecorderAnnotation, long). It can decide to not allow the annotation to be recorded. In addition, a state handler can publish some services to external entities (such as a UI control) by defining an interface it extends and that extends IAnnotationStateHandler. It allows external entities to register themselves as listener to the state handler. In order to broadcast events to listeners, the state handler must notify them using AnnotationStateHandler.notifyListeners(IAnnotationStateEvent).


Constructor Summary
AnnotationStateHandler()
           
 
Method Summary
 void addListener(IAnnotationStateListener listener)
           
 void addManagedAnnotationType(String type)
           
 void annotate(RecorderAnnotation annotation, long interactionTime)
          Sub-classes should override this method in order to examine the annotation.
 void complete()
          Invoked when the annotation recorder is about to terminate.
 Set<String> getManagedAnnotationTypes()
           
protected  com.ibm.rational.test.lt.recorder.core.internal.annotations.AnnotationRecorder getRecorder()
           
 void initialize()
          Invoked when the annotation recorder has just started running.
protected  void notifyListeners(IAnnotationStateEvent event)
           
 void removeListener(IAnnotationStateListener listener)
           
 void setRecorder(com.ibm.rational.test.lt.recorder.core.internal.annotations.AnnotationRecorder recorder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationStateHandler

public AnnotationStateHandler()
Method Detail

setRecorder

public final void setRecorder(com.ibm.rational.test.lt.recorder.core.internal.annotations.AnnotationRecorder recorder)

getRecorder

protected final com.ibm.rational.test.lt.recorder.core.internal.annotations.AnnotationRecorder getRecorder()

addManagedAnnotationType

public final void addManagedAnnotationType(String type)

getManagedAnnotationTypes

public final Set<String> getManagedAnnotationTypes()

annotate

public void annotate(RecorderAnnotation annotation,
                     long interactionTime)
Sub-classes should override this method in order to examine the annotation. If the annotation is allowed to be recorded, the method must invoke its super implementation with identical parameters. If the annotation must be discarded (i.e. not recorded), it should not invoke the super implementation. This implementation forwards the annotation to the annotation recorder as is.

Parameters:
annotation - The annotation to process.
interactionTime - How long the user spent interacting with the UI in order to make this annotation.

addListener

public void addListener(IAnnotationStateListener listener)
Specified by:
addListener in interface IAnnotationStateHandler

removeListener

public void removeListener(IAnnotationStateListener listener)
Specified by:
removeListener in interface IAnnotationStateHandler

notifyListeners

protected void notifyListeners(IAnnotationStateEvent event)

initialize

public void initialize()
Invoked when the annotation recorder has just started running. This implementation does nothing.


complete

public void complete()
Invoked when the annotation recorder is about to terminate. This is the last chance to emit an annotation. This implementation does nothing.


IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.