public class RegionBroker extends EmptyBroker
Modifier and Type | Field and Description |
---|---|
protected BrokerService |
brokerService |
protected java.util.Map<ConnectionId,ConnectionState> |
connectionStates |
protected DestinationFactory |
destinationFactory |
protected DestinationStatistics |
destinationStatistics |
static java.lang.String |
ORIGINAL_EXPIRATION |
Constructor and Description |
---|
RegionBroker(BrokerService brokerService,
TaskRunnerFactory taskRunnerFactory,
SystemUsage memoryManager,
DestinationFactory destinationFactory,
DestinationInterceptor destinationInterceptor,
Scheduler scheduler,
java.util.concurrent.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() |
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 create)
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 javax.jms.JMSException |
createUnknownDestinationTypeException(ActiveMQDestination destination) |
protected void |
doStop(ServiceStopper ss) |
void |
forgetTransaction(ConnectionContext context,
TransactionId transactionId)
Forgets a transaction.
|
void |
gc() |
Broker |
getAdaptor(java.lang.Class type)
Get a Broker from the Broker Stack that is a particular class
|
ConnectionContext |
getAdminConnectionContext() |
BrokerId |
getBrokerId()
Get the id of the broker
|
java.lang.String |
getBrokerName()
Get the name of the broker
|
long |
getBrokerSequenceId() |
BrokerService |
getBrokerService() |
Connection[] |
getClients() |
java.util.Map<ConnectionId,ConnectionState> |
getConnectionStates() |
DestinationInterceptor |
getDestinationInterceptor() |
java.util.Map<ActiveMQDestination,Destination> |
getDestinationMap()
Returns a copy of the current destinations available in the region
|
PolicyMap |
getDestinationPolicy() |
ActiveMQDestination[] |
getDestinations() |
java.util.Set<Destination> |
getDestinations(ActiveMQDestination destination)
Provide an exact or wildcard lookup of destinations in the region
|
DestinationStatistics |
getDestinationStatistics() |
java.util.Set<ActiveMQDestination> |
getDurableDestinations() |
java.util.concurrent.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() |
Broker |
getRoot()
Ensure we get the Broker at the top of the Stack
|
Scheduler |
getScheduler() |
PListStore |
getTempDataStore() |
Region |
getTempQueueRegion() |
Region |
getTempTopicRegion() |
Region |
getTopicRegion() |
java.net.URI |
getVmConnectorURI() |
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 |
isSlaveBroker() |
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 |
removeAdvisoryTopics(java.lang.String destinationType,
ConnectionContext context,
ActiveMQDestination destination,
long timeout) |
void |
removeBroker(Connection connection,
BrokerInfo info)
Remove a BrokerInfo
|
protected void |
removeBrokerInClusterUpdate() |
void |
removeConnection(ConnectionContext context,
ConnectionInfo info,
java.lang.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.
|
void |
sendToDeadLetterQueue(ConnectionContext context,
MessageReference node,
Subscription subscription)
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 |
setBrokerId(BrokerId brokerId) |
void |
setBrokerName(java.lang.String brokerName) |
void |
setKeepDurableSubsActive(boolean keepDurableSubsActive) |
void |
start() |
void |
stop() |
addSession, fastProducer, isFaultTolerantConfiguration, isFull, messageConsumed, messageDelivered, messageDiscarded, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, removeSession, slowConsumer
public static final java.lang.String ORIGINAL_EXPIRATION
protected final DestinationStatistics destinationStatistics
protected DestinationFactory destinationFactory
protected final java.util.Map<ConnectionId,ConnectionState> connectionStates
protected final BrokerService brokerService
public RegionBroker(BrokerService brokerService, TaskRunnerFactory taskRunnerFactory, SystemUsage memoryManager, DestinationFactory destinationFactory, DestinationInterceptor destinationInterceptor, Scheduler scheduler, java.util.concurrent.ThreadPoolExecutor executor) throws java.io.IOException
java.io.IOException
public java.util.Map<ActiveMQDestination,Destination> getDestinationMap()
Region
getDestinationMap
in interface Region
getDestinationMap
in class EmptyBroker
public java.util.Set<Destination> getDestinations(ActiveMQDestination destination)
Region
getDestinations
in interface Region
getDestinations
in class EmptyBroker
public Broker getAdaptor(java.lang.Class type)
Broker
getAdaptor
in interface Broker
getAdaptor
in class EmptyBroker
public 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 java.lang.Exception
start
in interface Service
start
in class EmptyBroker
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface Service
stop
in class EmptyBroker
java.lang.Exception
public PolicyMap getDestinationPolicy()
public void addConnection(ConnectionContext context, ConnectionInfo info) throws java.lang.Exception
Broker
addConnection
in interface Broker
addConnection
in class EmptyBroker
java.lang.Exception
- TODOpublic void removeConnection(ConnectionContext context, ConnectionInfo info, java.lang.Throwable error) throws java.lang.Exception
Broker
removeConnection
in interface Broker
removeConnection
in class EmptyBroker
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.java.lang.Exception
- TODOprotected boolean isEqual(ConnectionId connectionId, ConnectionId connectionId2)
public Connection[] getClients() throws java.lang.Exception
getClients
in interface Broker
getClients
in class EmptyBroker
java.lang.Exception
- TODOpublic Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean create) throws java.lang.Exception
Region
addDestination
in interface Region
addDestination
in class EmptyBroker
destination
- the destination to create.java.lang.Exception
- TODOpublic void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws java.lang.Exception
Region
removeDestination
in interface Region
removeDestination
in class EmptyBroker
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 quiescejava.lang.Exception
- TODOpublic void removeAdvisoryTopics(java.lang.String destinationType, ConnectionContext context, ActiveMQDestination destination, long timeout) throws java.lang.Exception
java.lang.Exception
public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws java.lang.Exception
Broker
addDestinationInfo
in interface Broker
addDestinationInfo
in class EmptyBroker
java.lang.Exception
public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws java.lang.Exception
Broker
removeDestinationInfo
in interface Broker
removeDestinationInfo
in class EmptyBroker
java.lang.Exception
public ActiveMQDestination[] getDestinations() throws java.lang.Exception
getDestinations
in interface Broker
getDestinations
in class EmptyBroker
java.lang.Exception
- TODOpublic void addProducer(ConnectionContext context, ProducerInfo info) throws java.lang.Exception
Broker
addProducer
in interface Broker
addProducer
in interface Region
addProducer
in class EmptyBroker
context
- the enviorment the operation is being executed under.java.lang.Exception
- TODOpublic void removeProducer(ConnectionContext context, ProducerInfo info) throws java.lang.Exception
Broker
removeProducer
in interface Broker
removeProducer
in interface Region
removeProducer
in class EmptyBroker
context
- the enviorment the operation is being executed under.java.lang.Exception
- TODOpublic Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws java.lang.Exception
Region
addConsumer
in interface Region
addConsumer
in class EmptyBroker
context
- the environment the operation is being executed under.java.lang.Exception
- TODOpublic void removeConsumer(ConnectionContext context, ConsumerInfo info) throws java.lang.Exception
Region
removeConsumer
in interface Region
removeConsumer
in class EmptyBroker
context
- the environment the operation is being executed under.java.lang.Exception
- TODOpublic void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws java.lang.Exception
Region
removeSubscription
in interface Region
removeSubscription
in class EmptyBroker
context
- the environment the operation is being executed under.info
- TODOjava.lang.Exception
- TODOpublic void send(ProducerBrokerExchange producerExchange, Message message) throws java.lang.Exception
Region
send
in interface Region
send
in class EmptyBroker
producerExchange
- the environment the operation is being executed under.java.lang.Exception
- TODOpublic void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws java.lang.Exception
Region
acknowledge
in interface Region
acknowledge
in class EmptyBroker
consumerExchange
- the environment the operation is being executed under.java.lang.Exception
- TODOpublic Response messagePull(ConnectionContext context, MessagePull pull) throws java.lang.Exception
Region
messagePull
in interface Region
messagePull
in class EmptyBroker
java.lang.Exception
public TransactionId[] getPreparedTransactions(ConnectionContext context) throws java.lang.Exception
Broker
getPreparedTransactions
in interface Broker
getPreparedTransactions
in class EmptyBroker
context
- transaction idsjava.lang.Exception
- TODOpublic void beginTransaction(ConnectionContext context, TransactionId xid) throws java.lang.Exception
Broker
beginTransaction
in interface Broker
beginTransaction
in class EmptyBroker
java.lang.Exception
- TODOpublic int prepareTransaction(ConnectionContext context, TransactionId xid) throws java.lang.Exception
Broker
prepareTransaction
in interface Broker
prepareTransaction
in class EmptyBroker
java.lang.Exception
- TODOpublic void rollbackTransaction(ConnectionContext context, TransactionId xid) throws java.lang.Exception
Broker
rollbackTransaction
in interface Broker
rollbackTransaction
in class EmptyBroker
java.lang.Exception
- TODOpublic void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws java.lang.Exception
Broker
commitTransaction
in interface Broker
commitTransaction
in class EmptyBroker
java.lang.Exception
- TODOpublic void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws java.lang.Exception
Broker
forgetTransaction
in interface Broker
forgetTransaction
in class EmptyBroker
java.lang.Exception
public void gc()
gc
in interface Region
gc
in class EmptyBroker
public BrokerId getBrokerId()
Broker
getBrokerId
in interface Broker
getBrokerId
in class EmptyBroker
public void setBrokerId(BrokerId brokerId)
public java.lang.String getBrokerName()
Broker
getBrokerName
in interface Broker
getBrokerName
in class EmptyBroker
public void setBrokerName(java.lang.String brokerName)
public DestinationStatistics getDestinationStatistics()
protected javax.jms.JMSException createUnknownDestinationTypeException(ActiveMQDestination destination)
public void addBroker(Connection connection, BrokerInfo info)
Broker
addBroker
in interface Broker
addBroker
in class EmptyBroker
public void removeBroker(Connection connection, BrokerInfo info)
Broker
removeBroker
in interface Broker
removeBroker
in class EmptyBroker
public BrokerInfo[] getPeerBrokerInfos()
Broker
getPeerBrokerInfos
in interface Broker
getPeerBrokerInfos
in class EmptyBroker
public void preProcessDispatch(MessageDispatch messageDispatch)
Broker
preProcessDispatch
in interface Broker
preProcessDispatch
in class EmptyBroker
public void postProcessDispatch(MessageDispatch messageDispatch)
Broker
postProcessDispatch
in interface Broker
postProcessDispatch
in class EmptyBroker
public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws java.lang.Exception
Region
processDispatchNotification
in interface Region
processDispatchNotification
in class EmptyBroker
java.lang.Exception
- TODOpublic boolean isSlaveBroker()
public boolean isStopped()
isStopped
in interface Broker
isStopped
in class EmptyBroker
public java.util.Set<ActiveMQDestination> getDurableDestinations()
getDurableDestinations
in interface Broker
getDurableDestinations
in class EmptyBroker
protected void doStop(ServiceStopper ss)
public boolean isKeepDurableSubsActive()
public void setKeepDurableSubsActive(boolean keepDurableSubsActive)
public DestinationInterceptor getDestinationInterceptor()
public ConnectionContext getAdminConnectionContext()
getAdminConnectionContext
in interface Broker
getAdminConnectionContext
in class EmptyBroker
public void setAdminConnectionContext(ConnectionContext adminConnectionContext)
Broker
setAdminConnectionContext
in interface Broker
setAdminConnectionContext
in class EmptyBroker
public java.util.Map<ConnectionId,ConnectionState> getConnectionStates()
public PListStore getTempDataStore()
getTempDataStore
in interface Broker
getTempDataStore
in class EmptyBroker
public java.net.URI getVmConnectorURI()
getVmConnectorURI
in interface Broker
getVmConnectorURI
in class EmptyBroker
public void brokerServiceStarted()
Broker
brokerServiceStarted
in interface Broker
brokerServiceStarted
in class EmptyBroker
public BrokerService getBrokerService()
getBrokerService
in interface Broker
getBrokerService
in class EmptyBroker
public boolean isExpired(MessageReference messageReference)
Broker
isExpired
in interface Broker
isExpired
in class EmptyBroker
public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription)
Broker
messageExpired
in interface Broker
messageExpired
in class EmptyBroker
public void sendToDeadLetterQueue(ConnectionContext context, MessageReference node, Subscription subscription)
Broker
sendToDeadLetterQueue
in interface Broker
sendToDeadLetterQueue
in class EmptyBroker
public Broker getRoot()
Broker
getRoot
in interface Broker
getRoot
in class EmptyBroker
public long getBrokerSequenceId()
getBrokerSequenceId
in interface Broker
getBrokerSequenceId
in class EmptyBroker
public Scheduler getScheduler()
getScheduler
in interface Broker
getScheduler
in class EmptyBroker
public java.util.concurrent.ThreadPoolExecutor getExecutor()
getExecutor
in interface Broker
getExecutor
in class EmptyBroker
public void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control)
processConsumerControl
in interface Region
processConsumerControl
in class EmptyBroker
protected void addBrokerInClusterUpdate()
protected void removeBrokerInClusterUpdate()
protected void purgeInactiveDestinations()
Copyright © 2005-2012. All Rights Reserved.