Package org.apache.activemq.broker
Class BrokerBroadcaster
- java.lang.Object
-
- org.apache.activemq.broker.BrokerFilter
-
- org.apache.activemq.broker.BrokerBroadcaster
-
public class BrokerBroadcaster extends BrokerFilter
Used to add listeners for Broker actions
-
-
Field Summary
Fields Modifier and Type Field Description protected Broker[]listeners-
Fields inherited from class org.apache.activemq.broker.BrokerFilter
next
-
-
Constructor Summary
Constructors Constructor Description BrokerBroadcaster(Broker next)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack)Used to acknowledge the receipt of a message by a client.voidaddBroker(Connection connection, BrokerInfo info)A remote Broker connectsvoidaddConnection(ConnectionContext context, ConnectionInfo info)A client is establishing a connection with the broker.SubscriptionaddConsumer(ConnectionContext context, ConsumerInfo info)Adds a consumer.DestinationaddDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemporary)Used to create a destination.voidaddListener(Broker broker)voidaddProducer(ConnectionContext context, ProducerInfo info)Adds a producer.voidaddSession(ConnectionContext context, SessionInfo info)Adds a session.voidbeginTransaction(ConnectionContext context, TransactionId xid)Starts a transaction.voidcommitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase)Commits a transaction.voidforgetTransaction(ConnectionContext context, TransactionId transactionId)Forgets a transaction.voidgc()protected Broker[]getListeners()protected List<Broker>getListenersAsList()intprepareTransaction(ConnectionContext context, TransactionId xid)Prepares a transaction.voidremoveConnection(ConnectionContext context, ConnectionInfo info, Throwable error)A client is disconnecting from the broker.voidremoveConsumer(ConnectionContext context, ConsumerInfo info)Removes a consumer.voidremoveDestination(ConnectionContext context, ActiveMQDestination destination, long timeout)Used to destroy a destination.voidremoveListener(Broker broker)voidremoveProducer(ConnectionContext context, ProducerInfo info)Removes a producer.voidremoveSession(ConnectionContext context, SessionInfo info)Removes a session.voidremoveSubscription(ConnectionContext context, RemoveSubscriptionInfo info)Deletes a durable subscription.voidrollbackTransaction(ConnectionContext context, TransactionId xid)Rollsback a transaction.voidsend(ProducerBrokerExchange producerExchange, Message messageSend)Send a message to the broker to using the specified destination.voidstart()voidstop()-
Methods inherited from class org.apache.activemq.broker.BrokerFilter
addDestinationInfo, brokerServiceStarted, fastProducer, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getNext, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeDestinationInfo, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, virtualDestinationAdded, virtualDestinationRemoved
-
-
-
-
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:RegionUsed to acknowledge the receipt of a message by a client.- Specified by:
acknowledgein interfaceRegion- Overrides:
acknowledgein classBrokerFilter- 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:BrokerA client is establishing a connection with the broker.- Specified by:
addConnectionin interfaceBroker- Overrides:
addConnectionin classBrokerFilter- Throws:
Exception- TODO
-
addConsumer
public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Description copied from interface:RegionAdds a consumer.- Specified by:
addConsumerin interfaceRegion- Overrides:
addConsumerin classBrokerFilter- 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:BrokerAdds a producer.- Specified by:
addProducerin interfaceBroker- Specified by:
addProducerin interfaceRegion- Overrides:
addProducerin classBrokerFilter- Parameters:
context- the environment 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:BrokerCommits a transaction.- Specified by:
commitTransactionin interfaceBroker- Overrides:
commitTransactionin classBrokerFilter- Throws:
Exception- TODO
-
removeSubscription
public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception
Description copied from interface:RegionDeletes a durable subscription.- Specified by:
removeSubscriptionin interfaceRegion- Overrides:
removeSubscriptionin classBrokerFilter- 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:BrokerPrepares a transaction. Only valid for xa transactions.- Specified by:
prepareTransactionin interfaceBroker- Overrides:
prepareTransactionin classBrokerFilter- Returns:
- id
- Throws:
Exception- TODO
-
removeConnection
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
Description copied from interface:BrokerA client is disconnecting from the broker.- Specified by:
removeConnectionin interfaceBroker- Overrides:
removeConnectionin classBrokerFilter- 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:RegionRemoves a consumer.- Specified by:
removeConsumerin interfaceRegion- Overrides:
removeConsumerin classBrokerFilter- 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:BrokerRemoves a producer.- Specified by:
removeProducerin interfaceBroker- Specified by:
removeProducerin interfaceRegion- Overrides:
removeProducerin classBrokerFilter- Parameters:
context- the environment the operation is being executed under.- Throws:
Exception- TODO
-
rollbackTransaction
public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception
Description copied from interface:BrokerRollsback a transaction.- Specified by:
rollbackTransactionin interfaceBroker- Overrides:
rollbackTransactionin classBrokerFilter- Throws:
Exception- TODO
-
send
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception
Description copied from interface:RegionSend 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:
sendin interfaceRegion- Overrides:
sendin classBrokerFilter- 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:BrokerStarts a transaction.- Specified by:
beginTransactionin interfaceBroker- Overrides:
beginTransactionin classBrokerFilter- Throws:
Exception- TODO
-
forgetTransaction
public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception
Description copied from interface:BrokerForgets a transaction.- Specified by:
forgetTransactionin interfaceBroker- Overrides:
forgetTransactionin classBrokerFilter- Throws:
Exception
-
addDestination
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemporary) throws Exception
Description copied from interface:RegionUsed 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:
addDestinationin interfaceRegion- Overrides:
addDestinationin classBrokerFilterdestination- 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:RegionUsed 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:
removeDestinationin interfaceRegion- Overrides:
removeDestinationin classBrokerFilter- 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:
startin interfaceService- Overrides:
startin classBrokerFilter- Throws:
Exception
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceService- Overrides:
stopin classBrokerFilter- Throws:
Exception
-
addSession
public void addSession(ConnectionContext context, SessionInfo info) throws Exception
Description copied from interface:BrokerAdds a session.- Specified by:
addSessionin interfaceBroker- Overrides:
addSessionin classBrokerFilter- Throws:
Exception- TODO
-
removeSession
public void removeSession(ConnectionContext context, SessionInfo info) throws Exception
Description copied from interface:BrokerRemoves a session.- Specified by:
removeSessionin interfaceBroker- Overrides:
removeSessionin classBrokerFilter- Throws:
Exception- TODO
-
gc
public void gc()
- Specified by:
gcin interfaceRegion- Overrides:
gcin classBrokerFilter
-
addBroker
public void addBroker(Connection connection, BrokerInfo info)
Description copied from interface:BrokerA remote Broker connects- Specified by:
addBrokerin interfaceBroker- Overrides:
addBrokerin classBrokerFilter
-
getListeners
protected Broker[] getListeners()
-
addListener
public void addListener(Broker broker)
-
removeListener
public void removeListener(Broker broker)
-
-