raccoon.api.eai.endpoint
Interface ISubscriber

All Known Implementing Classes:
TibrvSubscriber

public interface ISubscriber

Common interface for all implementation of EAI Subscribers. An EAI Subscriber doesn't reply to an event, it only deals with it.

Since:
Raccoon v0.5
Version:
$Id: ISubscriber.java,v 1.1 2004/08/08 20:25:56 crouvrais Exp $
Author:
Cedric ROUVRAIS

Method Summary
 void addEventHandler(IEventHandler pNewHandler)
          Adds an Event Handler to this subscriber.
 IPublisher getErrorPublisher()
          Extracts the publisher used for publising internal errors.
 java.lang.String getEventSubject()
          The subject/topic to which this instance is subscribed to.
 java.lang.Object getNativeSub()
          Returns the embedded subscriber.
 long getNbMsgReceived()
          The number of messages received by this subscriber since it has been started.
 void removeEventHandler(java.lang.String pHandlerName)
          Removes an EventHandler from this subscriber.
 void setErrorPublisher(IPublisher pErrorPublisher)
          Defines the error publisher to be used by this instance.
 void setNativeSub(java.lang.Object pSubscriber)
          Assigns the native subscriber to this element.
 

Method Detail

addEventHandler

void addEventHandler(IEventHandler pNewHandler)
                     throws RaccoonException
Adds an Event Handler to this subscriber. Take note: the logical name of the Event Handler (or key) must unique per instance for internal management reasons.

Parameters:
pNewHandler - the new event handler
Throws:
RaccoonException - if the key of the Event Handler has already been inserted into this subscriber.
See Also:
IEventHandler

removeEventHandler

void removeEventHandler(java.lang.String pHandlerName)
                        throws RaccoonException
Removes an EventHandler from this subscriber. First it stops the embedded EventHandler and then it removes it from this Subscriber.

Parameters:
pHandlerName - the logical name of the handler
Throws:
RaccoonException - if the handler couldn't be found.

getNativeSub

java.lang.Object getNativeSub()
Returns the embedded subscriber. To be used in very special circumstances and only if you know what you are doing!

Returns:
embedded subscriber.

setNativeSub

void setNativeSub(java.lang.Object pSubscriber)
                  throws RaccoonException,
                         java.lang.IllegalArgumentException
Assigns the native subscriber to this element.

Parameters:
pSubscriber - the native subscriber.
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)

getEventSubject

java.lang.String getEventSubject()
The subject/topic to which this instance is subscribed to.

Returns:
the string that is the native subject.

getErrorPublisher

IPublisher getErrorPublisher()
Extracts the publisher used for publising internal errors.

Returns:
the error publisher used by this instance.

setErrorPublisher

void setErrorPublisher(IPublisher pErrorPublisher)
                       throws RaccoonException,
                              java.lang.IllegalArgumentException,
                              java.lang.InternalError
Defines the error publisher to be used by this instance.

Parameters:
pErrorPublisher - the error publisher instance
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)
java.lang.InternalError - if the property pParamName hasn't been defined.

getNbMsgReceived

long getNbMsgReceived()
The number of messages received by this subscriber since it has been started.

Returns:
the number of received messages.


Copyright null null. All Rights Reserved.