com.ibm.wsspi.wim.pluginmanager
Interface Subscriber

All Known Subinterfaces:
ModificationSubscriber, NotificationSubscriber

public interface Subscriber

Subscriber Interface provides a generic interface for various Topic Subscribers to write various subscribers which listen in on various topics from the topic-emitters.


Field Summary
static java.lang.String COPYRIGHT_NOTICE
           
 
Method Summary
 java.lang.String getSubscriberName()
          Get the name of the subscriber.
 SubscriberType getSubscriberType()
          Gets the type of Subscriber, NOTIFICATIONTYPE or MODIFICATIONTYPE
 void initSubscriber(java.util.Hashtable initParams)
          Initializes the subscriber.
 void recovery(java.lang.String emitter, int exitPointType, java.lang.String inlineName, ExceptionContext exceptionContext)
          The recovery function is used by subscribers to recover from a FAILURE status type of SubscriberException.
 void shutdownSubscriber()
          Shuts down the subscriber
 

Field Detail

COPYRIGHT_NOTICE

static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values
Method Detail

initSubscriber

void initSubscriber(java.util.Hashtable initParams)
                    throws SubscriberException
Initializes the subscriber.

Parameters:
initParams - A Hashtable including parameters that may be used to initialize the subscriber. This includes the "topicSubscriberName" key who's corresponding value is the subscriber's name as defined in the wim configuration file.
Throws:
SubscriberException

shutdownSubscriber

void shutdownSubscriber()
                        throws SubscriberException
Shuts down the subscriber

Throws:
SubscriberException

recovery

void recovery(java.lang.String emitter,
              int exitPointType,
              java.lang.String inlineName,
              ExceptionContext exceptionContext)
              throws SubscriberException
The recovery function is used by subscribers to recover from a FAILURE status type of SubscriberException. This exception is thrown in two cases: First, when the execution of the subscriber is a system level failure like JMS QueueFactory shutdown or Database shutdown. Second, if the failure should result in non execution of the system code that is associated with the emitter.

Parameters:
emitter - Name of the emitter in which the FAILURE occured
exitPointType - Can be either PREEXIT(0), INLINEEXIT(1), or POSTEXIT(2) defined in com.ibm.websphere.wim.pluginmanager.context.PluginManagerConstants
inlineName - Name of the inline exit
exceptionContext - Exception stack that is associated with the execution of the Emitter
Throws:
SubscriberException

getSubscriberName

java.lang.String getSubscriberName()
Get the name of the subscriber. This method is primarily used for logging purposes. Each subsriber instance can return a string of its choosing for logging purposes. The subscriber implementation can capture the "active" subscriber name via the init method, or return a static string (e.g. "MyFileLoggingSubscriber"), or a dynamic string comprised of both some static prefix and the configured name, etc. For performance reasons it might be suggested that no computation or object allocation occur in this method.

Return:
string name representing the subscriber

getSubscriberType

SubscriberType getSubscriberType()
Gets the type of Subscriber, NOTIFICATIONTYPE or MODIFICATIONTYPE

Return:
SubscriberType returns the type of this Subscriber