public interface Broker extends Region, Service
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
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(ActiveMQDestination destination)
return a reference destination map of a region based on the destination type
|
ActiveMQDestination[] |
getDestinations() |
Set<ActiveMQDestination> |
getDurableDestinations() |
ThreadPoolExecutor |
getExecutor() |
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 messageReference,
Subscription subscription)
A Message has Expired
|
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 |
removeBroker(Connection connection,
BrokerInfo info)
Remove a BrokerInfo
|
void |
removeConnection(ConnectionContext context,
ConnectionInfo info,
Throwable error)
A client is disconnecting from the broker.
|
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 |
rollbackTransaction(ConnectionContext context,
TransactionId xid)
Rollsback a transaction.
|
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 |
virtualDestinationAdded(ConnectionContext context,
VirtualDestination virtualDestination) |
void |
virtualDestinationRemoved(ConnectionContext context,
VirtualDestination virtualDestination) |
acknowledge, addConsumer, addDestination, gc, getDestinationMap, getDestinations, messagePull, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeConsumer, removeDestination, removeSubscription, send
Broker getAdaptor(Class<?> type)
type
- BrokerId getBrokerId()
String getBrokerName()
void addBroker(Connection connection, BrokerInfo info)
void removeBroker(Connection connection, BrokerInfo info)
connection
- info
- void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception
Exception
- TODOvoid removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
context
- the environment the operation is being executed under.info
- error
- null if the client requested the disconnect or the error
that caused the client to disconnect.Exception
- TODOvoid addSession(ConnectionContext context, SessionInfo info) throws Exception
context
- info
- Exception
- TODOvoid removeSession(ConnectionContext context, SessionInfo info) throws Exception
context
- info
- Exception
- TODOvoid addProducer(ConnectionContext context, ProducerInfo info) throws Exception
addProducer
in interface Region
context
- the environment the operation is being executed under.Exception
- TODOvoid removeProducer(ConnectionContext context, ProducerInfo info) throws Exception
removeProducer
in interface Region
context
- the environment the operation is being executed under.Exception
- TODOConnection[] getClients() throws Exception
Exception
- TODOActiveMQDestination[] getDestinations() throws Exception
Exception
- TODOMap<ActiveMQDestination,Destination> getDestinationMap(ActiveMQDestination destination)
destination
- TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception
context
- transaction idsException
- TODOvoid beginTransaction(ConnectionContext context, TransactionId xid) throws Exception
context
- xid
- Exception
- TODOint prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception
context
- xid
- Exception
- TODOvoid rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception
context
- xid
- Exception
- TODOvoid commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception
context
- xid
- onePhase
- Exception
- TODOvoid forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception
context
- transactionId
- Exception
BrokerInfo[] getPeerBrokerInfos()
void preProcessDispatch(MessageDispatch messageDispatch)
messageDispatch
- void postProcessDispatch(MessageDispatch messageDispatch)
messageDispatch
- boolean isStopped()
Set<ActiveMQDestination> getDurableDestinations()
void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
context
- info
- Exception
void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
context
- info
- Exception
boolean isFaultTolerantConfiguration()
ConnectionContext getAdminConnectionContext()
void setAdminConnectionContext(ConnectionContext adminConnectionContext)
adminConnectionContext
- PListStore getTempDataStore()
URI getVmConnectorURI()
void brokerServiceStarted()
BrokerService getBrokerService()
Broker getRoot()
boolean isExpired(MessageReference messageReference)
messageReference
- void messageExpired(ConnectionContext context, MessageReference messageReference, Subscription subscription)
context
- messageReference
- subscription
- (may be null)boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, Subscription subscription, Throwable poisonCause)
context
- messageReference
- poisonCause
- reason for dlq submission, may be nulllong getBrokerSequenceId()
void messageConsumed(ConnectionContext context, MessageReference messageReference)
context
- messageReference
- void messageDelivered(ConnectionContext context, MessageReference messageReference)
context
- messageReference
- void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference)
context
- sub
- messageReference
- void slowConsumer(ConnectionContext context, Destination destination, Subscription subs)
context
- destination
- subs
- void fastProducer(ConnectionContext context, ProducerInfo producerInfo, ActiveMQDestination destination)
context
- producerInfo
- destination
- void isFull(ConnectionContext context, Destination destination, Usage<?> usage)
context
- destination
- usage
- void virtualDestinationAdded(ConnectionContext context, VirtualDestination virtualDestination)
void virtualDestinationRemoved(ConnectionContext context, VirtualDestination virtualDestination)
void nowMasterBroker()
Scheduler getScheduler()
ThreadPoolExecutor getExecutor()
void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp)
void networkBridgeStopped(BrokerInfo brokerInfo)
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.