raccoon.tibco.tibrv.uitest
Class TibrvPlayer

java.lang.Object
  extended by raccoon.core.types.AbsComponent
      extended by raccoon.core.types.AbsLoadable
          extended by raccoon.core.types.AbsConfigurableLoadable
              extended by raccoon.tibco.tibrv.uitest.TibrvPlayer
All Implemented Interfaces:
IUnitPlayer, IBaseComponent, IConfigurable, ILoadable, ILogable

public class TibrvPlayer
extends AbsConfigurableLoadable
implements IUnitPlayer

The implementation of IUnitPlayer for TIB/Rendezvous.

Since:
Raccoon v0.7
Version:
$Id: TibrvPlayer.java,v 1.3 2003/07/01 19:21:00 crouvrais Exp $
Author:
Cedric ROUVRAIS

Field Summary
 
Fields inherited from class raccoon.core.types.AbsConfigurableLoadable
mConfigurableManager
 
Fields inherited from class raccoon.core.types.AbsLoadable
mIsLoaded
 
Fields inherited from class raccoon.core.types.AbsComponent
mIsInError
 
Fields inherited from interface raccoon.api.eai.uitest.IUnitPlayer
PLAYER_CHANNEL, REPEAT, REPEAT_INFINITE, REPEAT_ONCE
 
Constructor Summary
TibrvPlayer()
          Default constructor, required for dynamic instanciation.
 
Method Summary
 void addPlayerChannel(ComponentFile pRecordingChannel)
          Adds a new player channel to the list of current playing channels.
 void configureParameters()
          Configures the various parameters for this component.
 IFactory getFactory()
          Retrieves the factory instance used to instanciate empty message objects.
 java.util.ArrayList getPlayerChannels()
          The list of channels on which the messages are being sent.
 int getRepeat()
          The number of times this unit player must repeat the specified sequence.
 IXmlToMessage getXmlParser()
          The message to xml parser.
 void load()
          Invoked by the service manager to start this component once it has been configured.
 void run()
          Publishes all the sequenced messages.
 void setFactory(IFactory pFactory)
          Assigns the IFactory used to instanciate empty message objects.
 void setPlayerChannels(java.util.ArrayList pPlayerChannels)
          Sets the channels to which the events are to be sent.
 void setRepeat(int pRepeat)
          Defines the number of times this player should repeat the sequence.
 void setXmlParser(IXmlToMessage pXmlParser)
          Defines the message to xml parser to use.
 void stop()
          Invoke this method to stop the player from sending messages.
 
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable
isStable, setConfigurableManager, setLogger
 
Methods inherited from class raccoon.core.types.AbsLoadable
getLog, isInError, isInitialised, isRunning, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TibrvPlayer

public TibrvPlayer()
Default constructor, required for dynamic instanciation.

Method Detail

getRepeat

public int getRepeat()
The number of times this unit player must repeat the specified sequence.

Specified by:
getRepeat in interface IUnitPlayer
Returns:
the number of repetitions.

setRepeat

public void setRepeat(int pRepeat)
               throws RaccoonException,
                      java.lang.IllegalArgumentException
Defines the number of times this player should repeat the sequence.

Specified by:
setRepeat in interface IUnitPlayer
Parameters:
pRepeat - the number of times this player should repeat the sequence, zero for infinite.
Throws:
RaccoonException - if this component is already running: the component can't be changed. Error code is ErrorCodes.COMPONENT_INITIALISED
java.lang.IllegalArgumentException - if the parameter is null, the message is obtained via MsgHelper.formatNullParamter(java.lang.String, java.lang.Class)

getFactory

public IFactory getFactory()
Retrieves the factory instance used to instanciate empty message objects.

Returns:
the IFactory instance used

setFactory

public void setFactory(IFactory pFactory)
                throws RaccoonException,
                       java.lang.IllegalArgumentException
Assigns the IFactory used to instanciate empty message objects.

Parameters:
pFactory - the factory instance to use.
Throws:
RaccoonException - if this component is already running: the component can't be changed. Error code is ErrorCodes.COMPONENT_INITIALISED
java.lang.IllegalArgumentException - if the parameter is null, the message is obtained via MsgHelper.formatNullParamter(java.lang.String, java.lang.Class)

getXmlParser

public IXmlToMessage getXmlParser()
The message to xml parser.

Returns:
the implementation of IXmlToMessage used.

setXmlParser

public void setXmlParser(IXmlToMessage pXmlParser)
                  throws RaccoonException,
                         java.lang.IllegalArgumentException
Defines the message to xml parser to use.

Parameters:
pXmlParser - the utility to convert TIB/Rendezvous messages into an XML String.
Throws:
RaccoonException - if this component is already running: the component can't be changed. Error code is ErrorCodes.COMPONENT_INITIALISED
java.lang.IllegalArgumentException - if the parameter is null, the message is obtained via MsgHelper.formatNullParamter(java.lang.String, java.lang.Class)

setPlayerChannels

public void setPlayerChannels(java.util.ArrayList pPlayerChannels)
                       throws RaccoonException,
                              java.lang.IllegalArgumentException
Sets the channels to which the events are to be sent.

Specified by:
setPlayerChannels in interface IUnitPlayer
Parameters:
pPlayerChannels - the channels.
Throws:
RaccoonException - if this component is already running: the component can't be changed. Error code is ErrorCodes.COMPONENT_INITIALISED
java.lang.IllegalArgumentException - if the parameter is null, the message is obtained via MsgHelper.formatNullParamter(java.lang.String, java.lang.Class)

getPlayerChannels

public java.util.ArrayList getPlayerChannels()
The list of channels on which the messages are being sent.

Specified by:
getPlayerChannels in interface IUnitPlayer
Returns:
an ArrayList of ComponentFile

addPlayerChannel

public void addPlayerChannel(ComponentFile pRecordingChannel)
                      throws RaccoonException,
                             java.lang.IllegalArgumentException
Adds a new player channel to the list of current playing channels.

Specified by:
addPlayerChannel in interface IUnitPlayer
Parameters:
pRecordingChannel - the new playing channel to add.
Throws:
RaccoonException - if this component is already running: the component can't be changed. Error code is ErrorCodes.COMPONENT_INITIALISED
java.lang.IllegalArgumentException - if the parameter is null, the message is obtained via MsgHelper.formatNullParamter(java.lang.String, java.lang.Class)

load

public void load()
          throws LoadableException
Invoked by the service manager to start this component once it has been configured.

When extended bare in mind that the member variable mIsLoaded should be set to false and then set to true once all the init code has been performed.

Checks if all the required properties are set.

Specified by:
load in interface ILoadable
Overrides:
load in class AbsConfigurableLoadable
Throws:
LoadableException - if this component isn't initialisable or is already running.

run

public void run()
         throws RaccoonException
Publishes all the sequenced messages.

Specified by:
run in interface IUnitPlayer
Throws:
RaccoonException - if the publication is interrupted.

stop

public void stop()
Invoke this method to stop the player from sending messages.


configureParameters

public void configureParameters()
Configures the various parameters for this component. This method should configure the instance of IConfigurableManager provided during the invocation of AbsConfigurableLoadable.setConfigurableManager(raccoon.api.types.IConfigurableManager).

Specified by:
configureParameters in interface IConfigurable
Overrides:
configureParameters in class AbsConfigurableLoadable


Copyright null null. All Rights Reserved.