org.apache.activemq.broker
Class BrokerBroadcaster

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

public class BrokerBroadcaster
extends BrokerFilter

Used to add listeners for Broker actions


Field Summary
protected  Broker[] listeners
           
 
Fields inherited from class org.apache.activemq.broker.BrokerFilter
next
 
Constructor Summary
BrokerBroadcaster(Broker next)
           
 
Method Summary
 void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack)
          Used to acknowledge the receipt of a message by a client.
 void addBroker(Connection connection, BrokerInfo info)
          A remote Broker connects
 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, boolean createIfTemporary)
          Used to create a destination.
 void addListener(Broker broker)
           
 void addProducer(ConnectionContext context, ProducerInfo info)
          Adds a producer.
 void addSession(ConnectionContext context, SessionInfo info)
          Adds a session.
 void beginTransaction(ConnectionContext context, TransactionId xid)
          Starts a transaction.
 void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase)
          Commits a transaction.
 void forgetTransaction(ConnectionContext context, TransactionId transactionId)
          Forgets a transaction.
 void gc()
           
protected  Broker[] getListeners()
           
protected  List<Broker> getListenersAsList()
           
 int prepareTransaction(ConnectionContext context, TransactionId xid)
          Prepares a transaction.
 void removeConnection(ConnectionContext context, ConnectionInfo info, 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 removeListener(Broker broker)
           
 void removeProducer(ConnectionContext context, ProducerInfo info)
          Removes a producer.
 void removeSession(ConnectionContext context, SessionInfo info)
          Removes a session.
 void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info)
          Deletes a durable subscription.
 void rollbackTransaction(ConnectionContext context, TransactionId xid)
          Rollsback a transaction.
 void send(ProducerBrokerExchange producerExchange, Message messageSend)
          Send a message to the broker to using the specified destination.
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.activemq.broker.BrokerFilter
addDestinationInfo, brokerServiceStarted, fastProducer, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, preProcessDispatch, processConsumerControl, processDispatchNotification, removeBroker, removeDestinationInfo, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected volatile Broker[] listeners
Constructor Detail

BrokerBroadcaster

public BrokerBroadcaster(Broker next)
Method Detail

acknowledge

public void acknowledge(ConsumerBrokerExchange consumerExchange,
                        MessageAck ack)
                 throws Exception
Description copied from interface: Region
Used to acknowledge the receipt of a message by a client.

Specified by:
acknowledge in interface Region
Overrides:
acknowledge in class BrokerFilter
Parameters:
consumerExchange - the environment the operation is being executed under.
Throws:
Exception - TODO

addConnection

public void addConnection(ConnectionContext context,
                          ConnectionInfo info)
                   throws 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:
Exception - TODO

addConsumer

public Subscription addConsumer(ConnectionContext context,
                                ConsumerInfo info)
                         throws 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:
Exception - TODO

addProducer

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

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

commitTransaction

public void commitTransaction(ConnectionContext context,
                              TransactionId xid,
                              boolean onePhase)
                       throws Exception
Description copied from interface: Broker
Commits a transaction.

Specified by:
commitTransaction in interface Broker
Overrides:
commitTransaction in class BrokerFilter
Throws:
Exception - TODO

removeSubscription

public void removeSubscription(ConnectionContext context,
                               RemoveSubscriptionInfo info)
                        throws Exception
Description copied from interface: Region
Deletes a durable subscription.

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

prepareTransaction

public int prepareTransaction(ConnectionContext context,
                              TransactionId xid)
                       throws Exception
Description copied from interface: Broker
Prepares a transaction. Only valid for xa transactions.

Specified by:
prepareTransaction in interface Broker
Overrides:
prepareTransaction in class BrokerFilter
Returns:
id
Throws:
Exception - TODO

removeConnection

public void removeConnection(ConnectionContext context,
                             ConnectionInfo info,
                             Throwable error)
                      throws 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:
Exception - TODO

removeConsumer

public void removeConsumer(ConnectionContext context,
                           ConsumerInfo info)
                    throws 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:
Exception - TODO

removeProducer

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

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

rollbackTransaction

public void rollbackTransaction(ConnectionContext context,
                                TransactionId xid)
                         throws Exception
Description copied from interface: Broker
Rollsback a transaction.

Specified by:
rollbackTransaction in interface Broker
Overrides:
rollbackTransaction in class BrokerFilter
Throws:
Exception - TODO

send

public void send(ProducerBrokerExchange producerExchange,
                 Message messageSend)
          throws Exception
Description copied from interface: Region
Send a message to the broker to using the specified destination. The destination specified in the message does not need to match the destination the message is sent to. This is handy in case the message is being sent to a dead letter destination.

Specified by:
send in interface Region
Overrides:
send in class BrokerFilter
Parameters:
producerExchange - the environment the operation is being executed under.
Throws:
Exception - TODO

beginTransaction

public void beginTransaction(ConnectionContext context,
                             TransactionId xid)
                      throws Exception
Description copied from interface: Broker
Starts a transaction.

Specified by:
beginTransaction in interface Broker
Overrides:
beginTransaction in class BrokerFilter
Throws:
Exception - TODO

forgetTransaction

public void forgetTransaction(ConnectionContext context,
                              TransactionId transactionId)
                       throws Exception
Description copied from interface: Broker
Forgets a transaction.

Specified by:
forgetTransaction in interface Broker
Overrides:
forgetTransaction in class BrokerFilter
Throws:
Exception

addDestination

public Destination addDestination(ConnectionContext context,
                                  ActiveMQDestination destination,
                                  boolean createIfTemporary)
                           throws 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:
Exception - TODO

removeDestination

public void removeDestination(ConnectionContext context,
                              ActiveMQDestination destination,
                              long timeout)
                       throws 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:
Exception - TODO

start

public void start()
           throws Exception
Specified by:
start in interface Service
Overrides:
start in class BrokerFilter
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Overrides:
stop in class BrokerFilter
Throws:
Exception

addSession

public void addSession(ConnectionContext context,
                       SessionInfo info)
                throws Exception
Description copied from interface: Broker
Adds a session.

Specified by:
addSession in interface Broker
Overrides:
addSession in class BrokerFilter
Throws:
Exception - TODO

removeSession

public void removeSession(ConnectionContext context,
                          SessionInfo info)
                   throws Exception
Description copied from interface: Broker
Removes a session.

Specified by:
removeSession in interface Broker
Overrides:
removeSession in class BrokerFilter
Throws:
Exception - TODO

gc

public void gc()
Specified by:
gc in interface Region
Overrides:
gc in class BrokerFilter

addBroker

public void addBroker(Connection connection,
                      BrokerInfo info)
Description copied from interface: Broker
A remote Broker connects

Specified by:
addBroker in interface Broker
Overrides:
addBroker in class BrokerFilter

getListeners

protected Broker[] getListeners()

addListener

public void addListener(Broker broker)

removeListener

public void removeListener(Broker broker)

getListenersAsList

protected List<Broker> getListenersAsList()


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.