public class BrokerFilter extends Object implements Broker
Constructor and Description |
---|
BrokerFilter(Broker next) |
Modifier and Type | Method and Description |
---|---|
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 |
addDestinationInfo(ConnectionContext context,
DestinationInfo info)
Add and process a DestinationInfo object
|
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 |
brokerServiceStarted()
called when the brokerService starts
|
void |
commitTransaction(ConnectionContext context,
TransactionId xid,
boolean onePhase)
Commits a transaction.
|
void |
fastProducer(ConnectionContext context,
ProducerInfo producerInfo,
ActiveMQDestination destination)
Called to notify a producer is too fast
|
void |
forgetTransaction(ConnectionContext context,
TransactionId transactionId)
Forgets a transaction.
|
void |
gc() |
Broker |
getAdaptor(Class<?> type)
Get a Broker from the Broker Stack that is a particular class
|
ConnectionContext |
getAdminConnectionContext() |
BrokerId |
getBrokerId()
Get the id of the broker
|
String |
getBrokerName()
Get the name of the broker
|
long |
getBrokerSequenceId() |
BrokerService |
getBrokerService() |
Connection[] |
getClients() |
Map<ActiveMQDestination,Destination> |
getDestinationMap()
Returns a reference to the concurrent hash map that holds known destinations, do not modify
|
Map<ActiveMQDestination,Destination> |
getDestinationMap(ActiveMQDestination destination)
return a reference destination map of a region based on the destination type
|
ActiveMQDestination[] |
getDestinations() |
Set<Destination> |
getDestinations(ActiveMQDestination destination)
Provide an exact or wildcard lookup of destinations in the region
|
Set<ActiveMQDestination> |
getDurableDestinations() |
ThreadPoolExecutor |
getExecutor() |
Broker |
getNext() |
BrokerInfo[] |
getPeerBrokerInfos()
Get the BrokerInfo's of any connected Brokers
|
TransactionId[] |
getPreparedTransactions(ConnectionContext context)
Gets a list of all the prepared xa transactions.
|
Broker |
getRoot()
Ensure we get the Broker at the top of the Stack
|
Scheduler |
getScheduler() |
PListStore |
getTempDataStore() |
URI |
getVmConnectorURI() |
boolean |
isExpired(MessageReference messageReference)
Determine if a message has expired -allows default behaviour to be
overriden - as the timestamp set by the producer can be out of sync with
the broker
|
boolean |
isFaultTolerantConfiguration() |
void |
isFull(ConnectionContext context,
Destination destination,
Usage<?> usage)
Called when a Usage reaches a limit
|
boolean |
isStopped() |
void |
messageConsumed(ConnectionContext context,
MessageReference messageReference)
called when message is consumed
|
void |
messageDelivered(ConnectionContext context,
MessageReference messageReference)
Called when message is delivered to the broker
|
void |
messageDiscarded(ConnectionContext context,
Subscription sub,
MessageReference messageReference)
Called when a message is discarded - e.g.
|
void |
messageExpired(ConnectionContext context,
MessageReference message,
Subscription subscription)
A Message has Expired
|
Response |
messagePull(ConnectionContext context,
MessagePull pull)
Allows a consumer to pull a message from a queue
|
void |
networkBridgeStarted(BrokerInfo brokerInfo,
boolean createdByDuplex,
String remoteIp) |
void |
networkBridgeStopped(BrokerInfo brokerInfo) |
void |
nowMasterBroker()
called when the broker becomes the master in a master/slave
configuration
|
void |
postProcessDispatch(MessageDispatch messageDispatch)
Notify the Broker that a dispatch has happened
|
int |
prepareTransaction(ConnectionContext context,
TransactionId xid)
Prepares a transaction.
|
void |
preProcessDispatch(MessageDispatch messageDispatch)
Notify the Broker that a dispatch is going to happen
|
void |
processConsumerControl(ConsumerBrokerExchange consumerExchange,
ConsumerControl control) |
void |
processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
Process a notification of a dispatch - used by a Slave Broker
|
void |
reapplyInterceptor() |
void |
removeBroker(Connection connection,
BrokerInfo info)
Remove a BrokerInfo
|
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 |
removeDestinationInfo(ConnectionContext context,
DestinationInfo info)
Remove and process a DestinationInfo object
|
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.
|
boolean |
sendToDeadLetterQueue(ConnectionContext context,
MessageReference messageReference,
Subscription subscription,
Throwable poisonCause)
A message needs to go the a DLQ
|
void |
setAdminConnectionContext(ConnectionContext adminConnectionContext)
Sets the default administration connection context used when configuring
the broker on startup or via JMX
|
void |
slowConsumer(ConnectionContext context,
Destination destination,
Subscription subs)
Called when there is a slow consumer
|
void |
start() |
void |
stop() |
void |
virtualDestinationAdded(ConnectionContext context,
VirtualDestination virtualDestination) |
void |
virtualDestinationRemoved(ConnectionContext context,
VirtualDestination virtualDestination) |
public BrokerFilter(Broker next)
public Broker getAdaptor(Class<?> type)
Broker
getAdaptor
in interface Broker
public Map<ActiveMQDestination,Destination> getDestinationMap()
Region
getDestinationMap
in interface Region
public Map<ActiveMQDestination,Destination> getDestinationMap(ActiveMQDestination destination)
Broker
getDestinationMap
in interface Broker
public Set<Destination> getDestinations(ActiveMQDestination destination)
Region
getDestinations
in interface Region
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception
Region
acknowledge
in interface Region
consumerExchange
- the environment the operation is being executed under.Exception
- TODOpublic Response messagePull(ConnectionContext context, MessagePull pull) throws Exception
Region
messagePull
in interface Region
Exception
public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception
Broker
addConnection
in interface Broker
Exception
- TODOpublic Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Region
addConsumer
in interface Region
context
- the environment the operation is being executed under.Exception
- TODOpublic void addProducer(ConnectionContext context, ProducerInfo info) throws Exception
Broker
addProducer
in interface Broker
addProducer
in interface Region
context
- the environment the operation is being executed under.Exception
- TODOpublic void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception
Broker
commitTransaction
in interface Broker
Exception
- TODOpublic void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception
Region
removeSubscription
in interface Region
context
- the environment the operation is being executed under.info
- TODOException
- TODOpublic TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception
Broker
getPreparedTransactions
in interface Broker
context
- transaction idsException
- TODOpublic int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception
Broker
prepareTransaction
in interface Broker
Exception
- TODOpublic void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
Broker
removeConnection
in interface Broker
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.Exception
- TODOpublic void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Region
removeConsumer
in interface Region
context
- the environment the operation is being executed under.Exception
- TODOpublic void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception
Broker
removeProducer
in interface Broker
removeProducer
in interface Region
context
- the environment the operation is being executed under.Exception
- TODOpublic void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception
Broker
rollbackTransaction
in interface Broker
Exception
- TODOpublic void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception
Region
public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception
Broker
beginTransaction
in interface Broker
Exception
- TODOpublic void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception
Broker
forgetTransaction
in interface Broker
Exception
public Connection[] getClients() throws Exception
getClients
in interface Broker
Exception
- TODOpublic Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemporary) throws Exception
Region
addDestination
in interface Region
destination
- the destination to create.Exception
- TODOpublic void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception
Region
removeDestination
in interface Region
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 quiesceException
- TODOpublic ActiveMQDestination[] getDestinations() throws Exception
getDestinations
in interface Broker
Exception
- TODOpublic void addSession(ConnectionContext context, SessionInfo info) throws Exception
Broker
addSession
in interface Broker
Exception
- TODOpublic void removeSession(ConnectionContext context, SessionInfo info) throws Exception
Broker
removeSession
in interface Broker
Exception
- TODOpublic BrokerId getBrokerId()
Broker
getBrokerId
in interface Broker
public String getBrokerName()
Broker
getBrokerName
in interface Broker
public void addBroker(Connection connection, BrokerInfo info)
Broker
public void removeBroker(Connection connection, BrokerInfo info)
Broker
removeBroker
in interface Broker
public BrokerInfo[] getPeerBrokerInfos()
Broker
getPeerBrokerInfos
in interface Broker
public void preProcessDispatch(MessageDispatch messageDispatch)
Broker
preProcessDispatch
in interface Broker
public void postProcessDispatch(MessageDispatch messageDispatch)
Broker
postProcessDispatch
in interface Broker
public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception
Region
processDispatchNotification
in interface Region
Exception
- TODOpublic boolean isStopped()
public Set<ActiveMQDestination> getDurableDestinations()
getDurableDestinations
in interface Broker
public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
Broker
addDestinationInfo
in interface Broker
Exception
public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
Broker
removeDestinationInfo
in interface Broker
Exception
public boolean isFaultTolerantConfiguration()
isFaultTolerantConfiguration
in interface Broker
public ConnectionContext getAdminConnectionContext()
getAdminConnectionContext
in interface Broker
public void setAdminConnectionContext(ConnectionContext adminConnectionContext)
Broker
setAdminConnectionContext
in interface Broker
public PListStore getTempDataStore()
getTempDataStore
in interface Broker
public URI getVmConnectorURI()
getVmConnectorURI
in interface Broker
public void brokerServiceStarted()
Broker
brokerServiceStarted
in interface Broker
public BrokerService getBrokerService()
getBrokerService
in interface Broker
public boolean isExpired(MessageReference messageReference)
Broker
public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription)
Broker
messageExpired
in interface Broker
subscription
- (may be null)public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, Subscription subscription, Throwable poisonCause)
Broker
sendToDeadLetterQueue
in interface Broker
poisonCause
- reason for dlq submission, may be nullpublic Broker getRoot()
Broker
public long getBrokerSequenceId()
getBrokerSequenceId
in interface Broker
public void fastProducer(ConnectionContext context, ProducerInfo producerInfo, ActiveMQDestination destination)
Broker
fastProducer
in interface Broker
public void isFull(ConnectionContext context, Destination destination, Usage<?> usage)
Broker
public void messageConsumed(ConnectionContext context, MessageReference messageReference)
Broker
messageConsumed
in interface Broker
public void messageDelivered(ConnectionContext context, MessageReference messageReference)
Broker
messageDelivered
in interface Broker
public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference)
Broker
messageDiscarded
in interface Broker
public void slowConsumer(ConnectionContext context, Destination destination, Subscription subs)
Broker
slowConsumer
in interface Broker
public void virtualDestinationAdded(ConnectionContext context, VirtualDestination virtualDestination)
virtualDestinationAdded
in interface Broker
public void virtualDestinationRemoved(ConnectionContext context, VirtualDestination virtualDestination)
virtualDestinationRemoved
in interface Broker
public void nowMasterBroker()
Broker
nowMasterBroker
in interface Broker
public void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control)
processConsumerControl
in interface Region
public void reapplyInterceptor()
reapplyInterceptor
in interface Region
public Scheduler getScheduler()
getScheduler
in interface Broker
public ThreadPoolExecutor getExecutor()
getExecutor
in interface Broker
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp)
networkBridgeStarted
in interface Broker
public void networkBridgeStopped(BrokerInfo brokerInfo)
networkBridgeStopped
in interface Broker
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.