public class RegionBroker extends EmptyBroker
| Modifier and Type | Field and Description |
|---|---|
protected BrokerService |
brokerService |
protected Map<ConnectionId,ConnectionState> |
connectionStates |
protected DestinationFactory |
destinationFactory |
protected DestinationStatistics |
destinationStatistics |
static String |
ORIGINAL_EXPIRATION |
| Constructor and Description |
|---|
RegionBroker(BrokerService brokerService,
TaskRunnerFactory taskRunnerFactory,
SystemUsage memoryManager,
DestinationFactory destinationFactory,
DestinationInterceptor destinationInterceptor,
Scheduler scheduler,
ThreadPoolExecutor executor) |
| 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
|
protected void |
addBrokerInClusterUpdate(BrokerInfo info) |
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 createIfTemp)
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 |
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.
|
protected Region |
createQueueRegion(SystemUsage memoryManager,
TaskRunnerFactory taskRunnerFactory,
DestinationFactory destinationFactory) |
protected Region |
createTempQueueRegion(SystemUsage memoryManager,
TaskRunnerFactory taskRunnerFactory,
DestinationFactory destinationFactory) |
protected Region |
createTempTopicRegion(SystemUsage memoryManager,
TaskRunnerFactory taskRunnerFactory,
DestinationFactory destinationFactory) |
protected Region |
createTopicRegion(SystemUsage memoryManager,
TaskRunnerFactory taskRunnerFactory,
DestinationFactory destinationFactory) |
protected JMSException |
createUnknownDestinationTypeException(ActiveMQDestination destination) |
protected void |
doStop(ServiceStopper ss) |
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() |
ConnectionContext |
getConnectionContext(String clientId) |
Map<ConnectionId,ConnectionState> |
getConnectionStates() |
DestinationInterceptor |
getDestinationInterceptor() |
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
|
PolicyMap |
getDestinationPolicy() |
ActiveMQDestination[] |
getDestinations() |
Set<Destination> |
getDestinations(ActiveMQDestination destination)
Provide an exact or wildcard lookup of destinations in the region
|
DestinationStatistics |
getDestinationStatistics() |
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.
|
Region |
getQueueRegion() |
protected Region |
getRegion(ActiveMQDestination destination) |
Broker |
getRoot()
Ensure we get the Broker at the top of the Stack
|
Scheduler |
getScheduler() |
PListStore |
getTempDataStore() |
Region |
getTempQueueRegion() |
Region |
getTempTopicRegion() |
Region |
getTopicRegion() |
URI |
getVmConnectorURI() |
boolean |
isAllowTempAutoCreationOnSend() |
protected boolean |
isEqual(ConnectionId connectionId,
ConnectionId connectionId2) |
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 |
isKeepDurableSubsActive() |
boolean |
isStopped() |
void |
messageExpired(ConnectionContext context,
MessageReference node,
Subscription subscription)
A Message has Expired
|
Response |
messagePull(ConnectionContext context,
MessagePull pull)
Allows a consumer to pull a message from a queue
|
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
|
protected void |
purgeInactiveDestinations() |
void |
reapplyInterceptor() |
void |
removeBroker(Connection connection,
BrokerInfo info)
Remove a BrokerInfo
|
protected void |
removeBrokerInClusterUpdate(BrokerInfo info) |
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 |
removeSubscription(ConnectionContext context,
RemoveSubscriptionInfo info)
Deletes a durable subscription.
|
void |
rollbackTransaction(ConnectionContext context,
TransactionId xid)
Rollsback a transaction.
|
void |
send(ProducerBrokerExchange producerExchange,
Message message)
Send a message to the broker to using the specified destination.
|
boolean |
sendToDeadLetterQueue(ConnectionContext context,
MessageReference node,
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 |
setAllowTempAutoCreationOnSend(boolean allowTempAutoCreationOnSend) |
void |
setBrokerId(BrokerId brokerId) |
void |
setBrokerName(String brokerName) |
void |
setKeepDurableSubsActive(boolean keepDurableSubsActive) |
void |
start() |
void |
stop() |
addSession, fastProducer, isFaultTolerantConfiguration, isFull, messageConsumed, messageDelivered, messageDiscarded, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, removeSession, slowConsumerpublic static final String ORIGINAL_EXPIRATION
protected final DestinationStatistics destinationStatistics
protected DestinationFactory destinationFactory
protected final Map<ConnectionId,ConnectionState> connectionStates
protected final BrokerService brokerService
public RegionBroker(BrokerService brokerService, TaskRunnerFactory taskRunnerFactory, SystemUsage memoryManager, DestinationFactory destinationFactory, DestinationInterceptor destinationInterceptor, Scheduler scheduler, ThreadPoolExecutor executor) throws IOException
IOExceptionpublic Map<ActiveMQDestination,Destination> getDestinationMap()
RegiongetDestinationMap in interface RegiongetDestinationMap in class EmptyBrokerpublic Map<ActiveMQDestination,Destination> getDestinationMap(ActiveMQDestination destination)
BrokergetDestinationMap in interface BrokergetDestinationMap in class EmptyBrokerpublic Set<Destination> getDestinations(ActiveMQDestination destination)
RegiongetDestinations in interface RegiongetDestinations in class EmptyBrokerpublic Broker getAdaptor(Class type)
BrokergetAdaptor in interface BrokergetAdaptor in class EmptyBrokerpublic Region getQueueRegion()
public Region getTempQueueRegion()
public Region getTempTopicRegion()
public Region getTopicRegion()
protected Region createTempTopicRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory)
protected Region createTempQueueRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory)
protected Region createTopicRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory)
protected Region createQueueRegion(SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory)
public void start() throws Exception
start in interface Servicestart in class EmptyBrokerExceptionpublic void stop() throws Exception
stop in interface Servicestop in class EmptyBrokerExceptionpublic PolicyMap getDestinationPolicy()
public ConnectionContext getConnectionContext(String clientId)
public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception
BrokeraddConnection in interface BrokeraddConnection in class EmptyBrokerException - TODOpublic void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
BrokerremoveConnection in interface BrokerremoveConnection in class EmptyBrokercontext - 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 - TODOprotected boolean isEqual(ConnectionId connectionId, ConnectionId connectionId2)
public Connection[] getClients() throws Exception
getClients in interface BrokergetClients in class EmptyBrokerException - TODOpublic Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemp) throws Exception
RegionaddDestination in interface RegionaddDestination in class EmptyBrokerdestination - the destination to create.Exception - TODOpublic void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception
RegionremoveDestination in interface RegionremoveDestination in class EmptyBrokercontext - 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 void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
BrokeraddDestinationInfo in interface BrokeraddDestinationInfo in class EmptyBrokerExceptionpublic void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
BrokerremoveDestinationInfo in interface BrokerremoveDestinationInfo in class EmptyBrokerExceptionpublic ActiveMQDestination[] getDestinations() throws Exception
getDestinations in interface BrokergetDestinations in class EmptyBrokerException - TODOpublic void addProducer(ConnectionContext context, ProducerInfo info) throws Exception
BrokeraddProducer in interface BrokeraddProducer in interface RegionaddProducer in class EmptyBrokercontext - the enviorment the operation is being executed under.Exception - TODOpublic void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception
BrokerremoveProducer in interface BrokerremoveProducer in interface RegionremoveProducer in class EmptyBrokercontext - the enviorment the operation is being executed under.Exception - TODOpublic Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
RegionaddConsumer in interface RegionaddConsumer in class EmptyBrokercontext - the environment the operation is being executed under.Exception - TODOpublic void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
RegionremoveConsumer in interface RegionremoveConsumer in class EmptyBrokercontext - the environment the operation is being executed under.Exception - TODOpublic void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception
RegionremoveSubscription in interface RegionremoveSubscription in class EmptyBrokercontext - the environment the operation is being executed under.info - TODOException - TODOpublic void send(ProducerBrokerExchange producerExchange, Message message) throws Exception
Regionsend in interface Regionsend in class EmptyBrokerproducerExchange - the environment the operation is being executed under.Exception - TODOpublic void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception
Regionacknowledge in interface Regionacknowledge in class EmptyBrokerconsumerExchange - the environment the operation is being executed under.Exception - TODOprotected Region getRegion(ActiveMQDestination destination) throws JMSException
JMSExceptionpublic Response messagePull(ConnectionContext context, MessagePull pull) throws Exception
RegionmessagePull in interface RegionmessagePull in class EmptyBrokerExceptionpublic TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception
BrokergetPreparedTransactions in interface BrokergetPreparedTransactions in class EmptyBrokercontext - transaction idsException - TODOpublic void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception
BrokerbeginTransaction in interface BrokerbeginTransaction in class EmptyBrokerException - TODOpublic int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception
BrokerprepareTransaction in interface BrokerprepareTransaction in class EmptyBrokerException - TODOpublic void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception
BrokerrollbackTransaction in interface BrokerrollbackTransaction in class EmptyBrokerException - TODOpublic void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception
BrokercommitTransaction in interface BrokercommitTransaction in class EmptyBrokerException - TODOpublic void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception
BrokerforgetTransaction in interface BrokerforgetTransaction in class EmptyBrokerExceptionpublic void gc()
gc in interface Regiongc in class EmptyBrokerpublic BrokerId getBrokerId()
BrokergetBrokerId in interface BrokergetBrokerId in class EmptyBrokerpublic void setBrokerId(BrokerId brokerId)
public String getBrokerName()
BrokergetBrokerName in interface BrokergetBrokerName in class EmptyBrokerpublic void setBrokerName(String brokerName)
public DestinationStatistics getDestinationStatistics()
protected JMSException createUnknownDestinationTypeException(ActiveMQDestination destination)
public void addBroker(Connection connection, BrokerInfo info)
BrokeraddBroker in interface BrokeraddBroker in class EmptyBrokerpublic void removeBroker(Connection connection, BrokerInfo info)
BrokerremoveBroker in interface BrokerremoveBroker in class EmptyBrokerpublic BrokerInfo[] getPeerBrokerInfos()
BrokergetPeerBrokerInfos in interface BrokergetPeerBrokerInfos in class EmptyBrokerpublic void preProcessDispatch(MessageDispatch messageDispatch)
BrokerpreProcessDispatch in interface BrokerpreProcessDispatch in class EmptyBrokerpublic void postProcessDispatch(MessageDispatch messageDispatch)
BrokerpostProcessDispatch in interface BrokerpostProcessDispatch in class EmptyBrokerpublic void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception
RegionprocessDispatchNotification in interface RegionprocessDispatchNotification in class EmptyBrokerException - TODOpublic boolean isStopped()
isStopped in interface BrokerisStopped in class EmptyBrokerpublic Set<ActiveMQDestination> getDurableDestinations()
getDurableDestinations in interface BrokergetDurableDestinations in class EmptyBrokerprotected void doStop(ServiceStopper ss)
public boolean isKeepDurableSubsActive()
public void setKeepDurableSubsActive(boolean keepDurableSubsActive)
public DestinationInterceptor getDestinationInterceptor()
public ConnectionContext getAdminConnectionContext()
getAdminConnectionContext in interface BrokergetAdminConnectionContext in class EmptyBrokerpublic void setAdminConnectionContext(ConnectionContext adminConnectionContext)
BrokersetAdminConnectionContext in interface BrokersetAdminConnectionContext in class EmptyBrokerpublic Map<ConnectionId,ConnectionState> getConnectionStates()
public PListStore getTempDataStore()
getTempDataStore in interface BrokergetTempDataStore in class EmptyBrokerpublic URI getVmConnectorURI()
getVmConnectorURI in interface BrokergetVmConnectorURI in class EmptyBrokerpublic void brokerServiceStarted()
BrokerbrokerServiceStarted in interface BrokerbrokerServiceStarted in class EmptyBrokerpublic BrokerService getBrokerService()
getBrokerService in interface BrokergetBrokerService in class EmptyBrokerpublic boolean isExpired(MessageReference messageReference)
BrokerisExpired in interface BrokerisExpired in class EmptyBrokerpublic void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription)
BrokermessageExpired in interface BrokermessageExpired in class EmptyBrokerpublic boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference node, Subscription subscription, Throwable poisonCause)
BrokersendToDeadLetterQueue in interface BrokersendToDeadLetterQueue in class EmptyBrokerpoisonCause - reason for dlq submission, may be nullpublic Broker getRoot()
BrokergetRoot in interface BrokergetRoot in class EmptyBrokerpublic long getBrokerSequenceId()
getBrokerSequenceId in interface BrokergetBrokerSequenceId in class EmptyBrokerpublic Scheduler getScheduler()
getScheduler in interface BrokergetScheduler in class EmptyBrokerpublic ThreadPoolExecutor getExecutor()
getExecutor in interface BrokergetExecutor in class EmptyBrokerpublic void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control)
processConsumerControl in interface RegionprocessConsumerControl in class EmptyBrokerprotected void addBrokerInClusterUpdate(BrokerInfo info)
protected void removeBrokerInClusterUpdate(BrokerInfo info)
protected void purgeInactiveDestinations()
public boolean isAllowTempAutoCreationOnSend()
public void setAllowTempAutoCreationOnSend(boolean allowTempAutoCreationOnSend)
public void reapplyInterceptor()
reapplyInterceptor in interface RegionreapplyInterceptor in class EmptyBrokerCopyright © 2005–2016 FuseSource, Corp.. All rights reserved.