org.openorb.notify.queue

Class Pusher

public class Pusher extends NotifyThread

This class is the base class for the various types of Pusher subclasses (e.g. AnyPusher, SequencePusher, etc) and contains all of the common code.

Author: Shawn Boyce

Constructor Summary
Pusher(String id, EventQueue queue, ConsumerProxyManagement proxy, ORB orb, Logger logger)
Default constructor.
Method Summary
voidfinishWorkAndStopThread()
Finish pending work and stop the thread
voidpushEvent(Object event)
This method is invoked by the proxy upon receipt of a new event.
voidrun()
The run method waits for new events and pushes them in the queue.
voidsetConnectionActive(boolean isConnectionActive)
This method sets the connection activity.
voidsetConsumer(ConsumerAdapter consumer)
This method sets a consumer
voidsetPropertiesRepository(PropertiesRepository propertiesRepository)
Sets the properties repository.
voidstopThread()
Stop the thread.

Constructor Detail

Pusher

public Pusher(String id, EventQueue queue, ConsumerProxyManagement proxy, ORB orb, Logger logger)
Default constructor.

Parameters: id The id. queue The event queue. proxy The consumer proxy management. orb The ORB. logger The logger.

Method Detail

finishWorkAndStopThread

public void finishWorkAndStopThread()
Finish pending work and stop the thread

pushEvent

public void pushEvent(Object event)
This method is invoked by the proxy upon receipt of a new event. If the class is threaded ( call to start() ) then it returns immediately, otherwise it returns after delivering the event to the connected consumer.

Parameters: event The event to push.

run

public void run()
The run method waits for new events and pushes them in the queue.

setConnectionActive

public void setConnectionActive(boolean isConnectionActive)
This method sets the connection activity.

Parameters: isConnectionActive Indicates if connection is active.

setConsumer

public void setConsumer(ConsumerAdapter consumer)
This method sets a consumer

setPropertiesRepository

public void setPropertiesRepository(PropertiesRepository propertiesRepository)
Sets the properties repository.

Parameters: propertiesRepository the properties repository.

stopThread

public void stopThread()
Stop the thread.