org.apache.activemq.advisory
Class AdvisoryBroker

java.lang.Object
  extended by org.apache.activemq.broker.BrokerFilter
      extended by org.apache.activemq.advisory.AdvisoryBroker
All Implemented Interfaces:
Broker, Region, Service

public class AdvisoryBroker
extends BrokerFilter

This broker filter handles tracking the state of the broker for purposes of publishing advisory messages to advisory consumers.

Version:
$Revision$

Field Summary
protected  ProducerId advisoryProducerId
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap connections
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap consumers
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap destinations
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap producers
           
 
Fields inherited from class org.apache.activemq.broker.BrokerFilter
next
 
Constructor Summary
AdvisoryBroker(Broker next)
           
 
Method Summary
 void addConnection(ConnectionContext context, ConnectionInfo info)
          A client is establishing a connection with the broker.
 Subscription addConsumer(ConnectionContext context, ConsumerInfo info)
          Adds a consumer.
 Destination addDestination(ConnectionContext context, ActiveMQDestination destination)
          Used to create a destination.
 void addDestinationInfo(ConnectionContext context, DestinationInfo info)
          Add and process a DestinationInfo object
 void addProducer(ConnectionContext context, ProducerInfo info)
          Adds a producer.
protected  void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command)
           
protected  void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId)
           
protected  void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId, ActiveMQMessage advisoryMessage)
           
protected  void fireConsumerAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command)
           
protected  void fireConsumerAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId)
           
protected  void fireProducerAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command)
           
protected  void fireProducerAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId)
           
 void removeConnection(ConnectionContext context, ConnectionInfo info, java.lang.Throwable error)
          A client is disconnecting from the broker.
 void removeConsumer(ConnectionContext context, ConsumerInfo info)
          Removes a consumer.
 void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout)
          Used to destroy a destination.
 void removeDestinationInfo(ConnectionContext context, DestinationInfo destInfo)
          Remove and process a DestinationInfo object
 void removeProducer(ConnectionContext context, ProducerInfo info)
          Removes a producer.
 
Methods inherited from class org.apache.activemq.broker.BrokerFilter
acknowledge, addBroker, addSession, beginTransaction, commitTransaction, forgetTransaction, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getClients, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getPeerBrokerInfos, getPendingDurableSubscriberPolicy, getPreparedTransactions, getTempDataStore, isFaultTolerantConfiguration, isSlaveBroker, isStopped, messagePull, prepareTransaction, processDispatch, processDispatchNotification, removeBroker, removeSession, removeSubscription, rollbackTransaction, send, setAdminConnectionContext, setPendingDurableSubscriberPolicy, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connections

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap connections

consumers

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap consumers

producers

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap producers

destinations

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap destinations

advisoryProducerId

protected final ProducerId advisoryProducerId
Constructor Detail

AdvisoryBroker

public AdvisoryBroker(Broker next)
Method Detail

addConnection

public void addConnection(ConnectionContext context,
                          ConnectionInfo info)
                   throws java.lang.Exception
Description copied from interface: Broker
A client is establishing a connection with the broker.

Specified by:
addConnection in interface Broker
Overrides:
addConnection in class BrokerFilter
Throws:
java.lang.Exception - TODO

addConsumer

public Subscription addConsumer(ConnectionContext context,
                                ConsumerInfo info)
                         throws java.lang.Exception
Description copied from interface: Region
Adds a consumer.

Specified by:
addConsumer in interface Region
Overrides:
addConsumer in class BrokerFilter
Parameters:
context - the environment the operation is being executed under.
Returns:
TODO
Throws:
java.lang.Exception - TODO

addProducer

public void addProducer(ConnectionContext context,
                        ProducerInfo info)
                 throws java.lang.Exception
Description copied from interface: Broker
Adds a producer.

Specified by:
addProducer in interface Broker
Overrides:
addProducer in class BrokerFilter
Parameters:
context - the enviorment the operation is being executed under.
Throws:
java.lang.Exception - TODO

addDestination

public Destination addDestination(ConnectionContext context,
                                  ActiveMQDestination destination)
                           throws java.lang.Exception
Description copied from interface: Region
Used to create a destination. Usually, this method is invoked as a side-effect of sending a message to a destination that does not exist yet.

Specified by:
addDestination in interface Region
Overrides:
addDestination in class BrokerFilter
destination - the destination to create.
Returns:
TODO
Throws:
java.lang.Exception - TODO

addDestinationInfo

public void addDestinationInfo(ConnectionContext context,
                               DestinationInfo info)
                        throws java.lang.Exception
Description copied from interface: Broker
Add and process a DestinationInfo object

Specified by:
addDestinationInfo in interface Broker
Overrides:
addDestinationInfo in class BrokerFilter
Throws:
java.lang.Exception

removeDestination

public void removeDestination(ConnectionContext context,
                              ActiveMQDestination destination,
                              long timeout)
                       throws java.lang.Exception
Description copied from interface: Region
Used to destroy a destination. This should try to quiesce use of the destination up to the timeout allotted time before removing the destination. This will remove all persistent messages associated with the destination.

Specified by:
removeDestination in interface Region
Overrides:
removeDestination in class BrokerFilter
Parameters:
context - the environment the operation is being executed under.
destination - what is being removed from the broker.
timeout - the max amount of time to wait for the destination to quiesce
Throws:
java.lang.Exception - TODO

removeDestinationInfo

public void removeDestinationInfo(ConnectionContext context,
                                  DestinationInfo destInfo)
                           throws java.lang.Exception
Description copied from interface: Broker
Remove and process a DestinationInfo object

Specified by:
removeDestinationInfo in interface Broker
Overrides:
removeDestinationInfo in class BrokerFilter
Throws:
java.lang.Exception

removeConnection

public void removeConnection(ConnectionContext context,
                             ConnectionInfo info,
                             java.lang.Throwable error)
                      throws java.lang.Exception
Description copied from interface: Broker
A client is disconnecting from the broker.

Specified by:
removeConnection in interface Broker
Overrides:
removeConnection in class BrokerFilter
Parameters:
context - the environment the operation is being executed under.
error - null if the client requested the disconnect or the error that caused the client to disconnect.
Throws:
java.lang.Exception - TODO

removeConsumer

public void removeConsumer(ConnectionContext context,
                           ConsumerInfo info)
                    throws java.lang.Exception
Description copied from interface: Region
Removes a consumer.

Specified by:
removeConsumer in interface Region
Overrides:
removeConsumer in class BrokerFilter
Parameters:
context - the environment the operation is being executed under.
Throws:
java.lang.Exception - TODO

removeProducer

public void removeProducer(ConnectionContext context,
                           ProducerInfo info)
                    throws java.lang.Exception
Description copied from interface: Broker
Removes a producer.

Specified by:
removeProducer in interface Broker
Overrides:
removeProducer in class BrokerFilter
Parameters:
context - the enviorment the operation is being executed under.
Throws:
java.lang.Exception - TODO

fireAdvisory

protected void fireAdvisory(ConnectionContext context,
                            ActiveMQTopic topic,
                            Command command)
                     throws java.lang.Exception
Throws:
java.lang.Exception

fireAdvisory

protected void fireAdvisory(ConnectionContext context,
                            ActiveMQTopic topic,
                            Command command,
                            ConsumerId targetConsumerId)
                     throws java.lang.Exception
Throws:
java.lang.Exception

fireConsumerAdvisory

protected void fireConsumerAdvisory(ConnectionContext context,
                                    ActiveMQTopic topic,
                                    Command command)
                             throws java.lang.Exception
Throws:
java.lang.Exception

fireConsumerAdvisory

protected void fireConsumerAdvisory(ConnectionContext context,
                                    ActiveMQTopic topic,
                                    Command command,
                                    ConsumerId targetConsumerId)
                             throws java.lang.Exception
Throws:
java.lang.Exception

fireProducerAdvisory

protected void fireProducerAdvisory(ConnectionContext context,
                                    ActiveMQTopic topic,
                                    Command command)
                             throws java.lang.Exception
Throws:
java.lang.Exception

fireProducerAdvisory

protected void fireProducerAdvisory(ConnectionContext context,
                                    ActiveMQTopic topic,
                                    Command command,
                                    ConsumerId targetConsumerId)
                             throws java.lang.Exception
Throws:
java.lang.Exception

fireAdvisory

protected void fireAdvisory(ConnectionContext context,
                            ActiveMQTopic topic,
                            Command command,
                            ConsumerId targetConsumerId,
                            ActiveMQMessage advisoryMessage)
                     throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2011 Apache Software Foundation. All Rights Reserved.