org.activemq.service.impl
Class DispatchWorker

java.lang.Object
  extended by org.activemq.service.impl.DispatchWorker
All Implemented Interfaces:
Runnable, Service

public class DispatchWorker
extends Object
implements Runnable, Service

A Dispatcher that polls for updates for active Message Consumers

Version:
$Revision: 1.1.1.1 $

Constructor Summary
DispatchWorker()
           
 
Method Summary
 void addActiveSubscription(BrokerClient client, Subscription sub)
          Add an active subscription
protected  boolean dispatchMessages(Subscription subscription, boolean dispatched)
           
protected  void doPoll()
           
 void register(MessageContainerManager mcm)
          Register the MessageContainerManager for the Dispatcher
 void removeActiveSubscription(BrokerClient client, Subscription sub)
          remove an active subscription
 void run()
          dispatch messages to active Consumers
 void start()
          start the DispatchWorker
 void stop()
          stop the DispatchWorker
 void wakeup()
          Called to indicate that there is work to do on a Subscription this will wake up a Dispatch Worker if it is waiting for messages to dispatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispatchWorker

public DispatchWorker()
Method Detail

register

public void register(MessageContainerManager mcm)
Register the MessageContainerManager for the Dispatcher

Parameters:
mcm -

wakeup

public void wakeup()
Called to indicate that there is work to do on a Subscription this will wake up a Dispatch Worker if it is waiting for messages to dispatch


addActiveSubscription

public void addActiveSubscription(BrokerClient client,
                                  Subscription sub)
Add an active subscription

Parameters:
client -
sub -

removeActiveSubscription

public void removeActiveSubscription(BrokerClient client,
                                     Subscription sub)
remove an active subscription

Parameters:
client -
sub -

run

public void run()
dispatch messages to active Consumers

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

start

public void start()
start the DispatchWorker

Specified by:
start in interface Service
See Also:
Service.start()

stop

public void stop()
stop the DispatchWorker

Specified by:
stop in interface Service
See Also:
Service.stop()

dispatchMessages

protected boolean dispatchMessages(Subscription subscription,
                                   boolean dispatched)
                            throws JMSException
Throws:
JMSException

doPoll

protected void doPoll()


Copyright © 2004-2008 Protique, Ltd.. All Rights Reserved.