org.openorb.notify.queue
Class Pusher

java.lang.Object
  extended by org.openorb.notify.NotifyThread
      extended by org.openorb.notify.queue.Pusher
All Implemented Interfaces:
java.lang.Runnable, ThreadManagement

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(java.lang.String id, EventQueue queue, ConsumerProxyManagement proxy, org.omg.CORBA.ORB orb, org.apache.avalon.framework.logger.Logger logger)
          Default constructor.
 
Method Summary
 void finishWorkAndStopThread()
          Finish pending work and stop the thread
 void pushEvent(java.lang.Object event)
          This method is invoked by the proxy upon receipt of a new event.
 void run()
          The run method waits for new events and pushes them in the queue.
 void setConnectionActive(boolean isConnectionActive)
          This method sets the connection activity.
 void setConsumer(ConsumerAdapter consumer)
          This method sets a consumer
 void setPropertiesRepository(PropertiesRepository propertiesRepository)
          Sets the properties repository.
 void stopThread()
          Stop the thread.
 
Methods inherited from class org.openorb.notify.NotifyThread
getLogger, resumeThread, startThread, suspendThread, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pusher

public Pusher(java.lang.String id,
              EventQueue queue,
              ConsumerProxyManagement proxy,
              org.omg.CORBA.ORB orb,
              org.apache.avalon.framework.logger.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

setConnectionActive

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

Parameters:
isConnectionActive - Indicates if connection is active.

pushEvent

public void pushEvent(java.lang.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.

setConsumer

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


run

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


stopThread

public void stopThread()
Stop the thread.

Specified by:
stopThread in interface ThreadManagement
Overrides:
stopThread in class NotifyThread

finishWorkAndStopThread

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

Specified by:
finishWorkAndStopThread in interface ThreadManagement
Overrides:
finishWorkAndStopThread in class NotifyThread

setPropertiesRepository

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

Parameters:
propertiesRepository - the properties repository.