systemic.sif.sifcommon.subscriber
Class SubscriberMessageConsumer

java.lang.Object
  extended by systemic.sif.sifcommon.subscriber.SubscriberMessageConsumer
All Implemented Interfaces:
java.lang.Runnable

public class SubscriberMessageConsumer
extends java.lang.Object
implements java.lang.Runnable

This class allows the subscriber to consume messages in a multi-threaded manner according to the producer-consumer design pattern.

Author:
Joerg Huber

Constructor Summary
SubscriberMessageConsumer(SubscriberQueue<SubscriberMessage> queue, java.lang.String consumerID, BaseSubscriber subscriber)
          This method initialises a Consumer for SubscriberMessages.
 
Method Summary
 void run()
          Required for this class to run in its own thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriberMessageConsumer

public SubscriberMessageConsumer(SubscriberQueue<SubscriberMessage> queue,
                                 java.lang.String consumerID,
                                 BaseSubscriber subscriber)
This method initialises a Consumer for SubscriberMessages. The 'subscriber' parameter is required by the consumer when messages are processed. At this point the consumer will call the appropriate method on the subscriber: processResponse() for response type of SubscriberMessage or processEvent() for event type of SubscriberMessage.

Parameters:
queue - The queue on which this consumer will listen on.
consumerID - A name of the consumer. Mainly needed for nice debug and error reporting.
subscriber - The subscriber to which this consumer will be assigned to.
See Also:
BaseSubscriber.processEvent(systemic.sif.sifcommon.model.SIFEvent, openadk.library.Zone, systemic.sif.sifcommon.mapping.MappingInfo, java.lang.String), BaseSubscriber.processResponse(openadk.library.SIFDataObject, openadk.library.Zone, systemic.sif.sifcommon.mapping.MappingInfo, java.lang.String)
Method Detail

run

public void run()
Required for this class to run in its own thread.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()