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(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 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 reference to the concurrent hash map that holds known destinations, do not modify
|
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() |
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() |
java.net.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 |
removeBroker(Connection connection,
BrokerInfo info)
Remove a BrokerInfo
|
protected void |
removeBrokerInClusterUpdate(BrokerInfo info) |
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 |
setAllowTempAutoCreationOnSend(boolean allowTempAutoCreationOnSend) |
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, slowConsumerpublic 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.IOExceptionpublic java.util.Map<ActiveMQDestination,Destination> getDestinationMap()
RegiongetDestinationMap in interface RegiongetDestinationMap in class EmptyBrokerpublic java.util.Set<Destination> getDestinations(ActiveMQDestination destination)
RegiongetDestinations in interface RegiongetDestinations in class EmptyBrokerpublic Broker getAdaptor(java.lang.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 java.lang.Exception
start in interface Servicestart in class EmptyBrokerjava.lang.Exceptionpublic void stop()
throws java.lang.Exception
stop in interface Servicestop in class EmptyBrokerjava.lang.Exceptionpublic PolicyMap getDestinationPolicy()
public void addConnection(ConnectionContext context, ConnectionInfo info) throws java.lang.Exception
BrokeraddConnection in interface BrokeraddConnection in class EmptyBrokerjava.lang.Exception - TODOpublic void removeConnection(ConnectionContext context, ConnectionInfo info, java.lang.Throwable error) throws java.lang.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.java.lang.Exception - TODOprotected boolean isEqual(ConnectionId connectionId, ConnectionId connectionId2)
public Connection[] getClients() throws java.lang.Exception
getClients in interface BrokergetClients in class EmptyBrokerjava.lang.Exception - TODOpublic Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean createIfTemp) throws java.lang.Exception
RegionaddDestination in interface RegionaddDestination in class EmptyBrokerdestination - the destination to create.java.lang.Exception - TODOpublic void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws java.lang.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 quiescejava.lang.Exception - TODOpublic void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws java.lang.Exception
BrokeraddDestinationInfo in interface BrokeraddDestinationInfo in class EmptyBrokerjava.lang.Exceptionpublic void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws java.lang.Exception
BrokerremoveDestinationInfo in interface BrokerremoveDestinationInfo in class EmptyBrokerjava.lang.Exceptionpublic ActiveMQDestination[] getDestinations() throws java.lang.Exception
getDestinations in interface BrokergetDestinations in class EmptyBrokerjava.lang.Exception - TODOpublic void addProducer(ConnectionContext context, ProducerInfo info) throws java.lang.Exception
BrokeraddProducer in interface BrokeraddProducer in interface RegionaddProducer in class EmptyBrokercontext - the enviorment the operation is being executed under.java.lang.Exception - TODOpublic void removeProducer(ConnectionContext context, ProducerInfo info) throws java.lang.Exception
BrokerremoveProducer in interface BrokerremoveProducer in interface RegionremoveProducer in class EmptyBrokercontext - the enviorment the operation is being executed under.java.lang.Exception - TODOpublic Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws java.lang.Exception
RegionaddConsumer in interface RegionaddConsumer in class EmptyBrokercontext - the environment the operation is being executed under.java.lang.Exception - TODOpublic void removeConsumer(ConnectionContext context, ConsumerInfo info) throws java.lang.Exception
RegionremoveConsumer in interface RegionremoveConsumer in class EmptyBrokercontext - the environment the operation is being executed under.java.lang.Exception - TODOpublic void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws java.lang.Exception
RegionremoveSubscription in interface RegionremoveSubscription in class EmptyBrokercontext - the environment the operation is being executed under.info - TODOjava.lang.Exception - TODOpublic void send(ProducerBrokerExchange producerExchange, Message message) throws java.lang.Exception
Regionsend in interface Regionsend in class EmptyBrokerproducerExchange - the environment the operation is being executed under.java.lang.Exception - TODOpublic void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws java.lang.Exception
Regionacknowledge in interface Regionacknowledge in class EmptyBrokerconsumerExchange - the environment the operation is being executed under.java.lang.Exception - TODOprotected Region getRegion(ActiveMQDestination destination) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic Response messagePull(ConnectionContext context, MessagePull pull) throws java.lang.Exception
RegionmessagePull in interface RegionmessagePull in class EmptyBrokerjava.lang.Exceptionpublic TransactionId[] getPreparedTransactions(ConnectionContext context) throws java.lang.Exception
BrokergetPreparedTransactions in interface BrokergetPreparedTransactions in class EmptyBrokercontext - transaction idsjava.lang.Exception - TODOpublic void beginTransaction(ConnectionContext context, TransactionId xid) throws java.lang.Exception
BrokerbeginTransaction in interface BrokerbeginTransaction in class EmptyBrokerjava.lang.Exception - TODOpublic int prepareTransaction(ConnectionContext context, TransactionId xid) throws java.lang.Exception
BrokerprepareTransaction in interface BrokerprepareTransaction in class EmptyBrokerjava.lang.Exception - TODOpublic void rollbackTransaction(ConnectionContext context, TransactionId xid) throws java.lang.Exception
BrokerrollbackTransaction in interface BrokerrollbackTransaction in class EmptyBrokerjava.lang.Exception - TODOpublic void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws java.lang.Exception
BrokercommitTransaction in interface BrokercommitTransaction in class EmptyBrokerjava.lang.Exception - TODOpublic void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws java.lang.Exception
BrokerforgetTransaction in interface BrokerforgetTransaction in class EmptyBrokerjava.lang.Exceptionpublic void gc()
gc in interface Regiongc in class EmptyBrokerpublic BrokerId getBrokerId()
BrokergetBrokerId in interface BrokergetBrokerId in class EmptyBrokerpublic void setBrokerId(BrokerId brokerId)
public java.lang.String getBrokerName()
BrokergetBrokerName in interface BrokergetBrokerName in class EmptyBrokerpublic void setBrokerName(java.lang.String brokerName)
public DestinationStatistics getDestinationStatistics()
protected javax.jms.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 java.lang.Exception
RegionprocessDispatchNotification in interface RegionprocessDispatchNotification in class EmptyBrokerjava.lang.Exception - TODOpublic boolean isStopped()
isStopped in interface BrokerisStopped in class EmptyBrokerpublic java.util.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 java.util.Map<ConnectionId,ConnectionState> getConnectionStates()
public PListStore getTempDataStore()
getTempDataStore in interface BrokergetTempDataStore in class EmptyBrokerpublic java.net.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 void sendToDeadLetterQueue(ConnectionContext context, MessageReference node, Subscription subscription)
BrokersendToDeadLetterQueue in interface BrokersendToDeadLetterQueue in class EmptyBrokerpublic 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 java.util.concurrent.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)
Copyright © 2005-2013 Red Hat, Inc.. All Rights Reserved.