java.lang.Object
org.activemq.broker.impl.BrokerContainerImpl
- All Implemented Interfaces:
- org.activemq.broker.BrokerContainer, org.activemq.capacity.CapacityMonitorEventListener, org.activemq.service.Service
- public class BrokerContainerImpl
- extends java.lang.Object
- implements org.activemq.broker.BrokerContainer, org.activemq.capacity.CapacityMonitorEventListener
Represents the ActiveMQ JMS Broker which typically has one or many connectors
- Version:
- $Revision: 1.1.1.1 $
|
Constructor Summary |
BrokerContainerImpl()
|
BrokerContainerImpl(org.activemq.broker.Broker broker,
org.activemq.broker.BrokerContext context)
|
BrokerContainerImpl(java.lang.String brokerName)
|
BrokerContainerImpl(java.lang.String brokerName,
org.activemq.broker.BrokerContext context)
|
BrokerContainerImpl(java.lang.String brokerName,
org.activemq.broker.BrokerContext context,
org.activemq.io.util.MemoryBoundedObjectManager memoryManager)
|
BrokerContainerImpl(java.lang.String brokerName,
org.activemq.io.util.MemoryBoundedObjectManager memoryManager)
|
BrokerContainerImpl(java.lang.String brokerName,
org.activemq.store.PersistenceAdapter persistenceAdapter)
|
BrokerContainerImpl(java.lang.String brokerName,
org.activemq.store.PersistenceAdapter persistenceAdapter,
org.activemq.broker.BrokerContext context)
|
BrokerContainerImpl(java.lang.String brokerName,
java.lang.String clusterName)
|
BrokerContainerImpl(java.lang.String brokerName,
java.lang.String clusterName,
org.activemq.broker.BrokerContext context)
|
BrokerContainerImpl(java.lang.String brokerName,
java.lang.String clusterName,
org.activemq.store.PersistenceAdapter persistenceAdapter,
org.activemq.broker.BrokerContext context)
|
|
Method Summary |
void |
acknowledgeMessage(org.activemq.broker.BrokerClient client,
org.activemq.message.MessageAck ack)
Acknowledge reciept of a message |
void |
addConnector(org.activemq.broker.BrokerConnector connector)
Called when a new connector is added to this container |
void |
addConnector(java.lang.String bindAddress)
Adds a new transport connector for the given bind address |
void |
addConnector(java.lang.String bindAddress,
org.activemq.io.WireFormat wireFormat)
Adds a new transport connector for the given bind address and wire format |
void |
addConnector(org.activemq.transport.TransportServerChannel transportConnector)
Adds a new transport connector for the given transportConnector |
org.activemq.transport.NetworkConnector |
addNetworkConnector()
Adds a new network connector |
void |
addNetworkConnector(org.activemq.transport.NetworkConnector connector)
Adds a new network connector |
org.activemq.transport.NetworkConnector |
addNetworkConnector(java.lang.String uri)
Adds a new network connector for the given URI |
protected void |
addShutdownHook()
|
void |
capacityChanged(org.activemq.capacity.CapacityMonitorEvent event)
Update any message producers about our capacity to handle messages |
protected void |
checkBrokerSet()
|
private void |
checkTempDestinationExistance(org.activemq.message.ActiveMQDestination dest)
|
void |
commitTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid,
boolean onePhase)
Commit an XA transaction. |
void |
commitTransaction(org.activemq.broker.BrokerClient client,
java.lang.String transactionId)
Commit a transaction |
protected void |
containerShutdown()
Causes a clean shutdown of the container when the VM is being shut down |
protected java.util.Map |
createLocalDiscoveryDetails()
|
void |
deregisterConnection(org.activemq.broker.BrokerClient client,
org.activemq.message.ConnectionInfo info)
un-registers a Connection |
void |
deregisterMessageConsumer(org.activemq.broker.BrokerClient client,
org.activemq.message.ConsumerInfo info)
De-register a MessageConsumer from the Broker |
void |
deregisterMessageProducer(org.activemq.broker.BrokerClient client,
org.activemq.message.ProducerInfo info)
De-register a MessageProducer from the Broker |
void |
deregisterRemoteClientID(java.lang.String remoteClientID)
deregister a remote clientID |
void |
deregisterSession(org.activemq.broker.BrokerClient client,
org.activemq.message.SessionInfo info)
De-register a client-side Session from the Broker (used for monitoring) |
protected void |
doDeRegistration(java.lang.String oldName)
|
protected void |
doRegistration(java.lang.String brokerName)
|
void |
durableUnsubscribe(org.activemq.broker.BrokerClient client,
org.activemq.message.DurableUnsubscribe ds)
Command to delete a durable topic subscription |
org.activemq.broker.Broker |
getBroker()
|
org.activemq.service.DeadLetterPolicy |
getDeadLetterPolicy()
|
org.activemq.transport.DiscoveryAgent |
getDiscoveryAgent()
Returns the discovery agent if one is available or null if discovery is not
enabled |
protected java.lang.String |
getLocalBrokerName()
|
protected java.lang.String |
getLocalConnectionURL()
|
java.util.List |
getNetworkConnectors()
Returns a list of org.activemq.transport.NetworkConnector
instances used to communicate with the network of org.activemq.broker.Broker instances |
org.activemq.store.PersistenceAdapter |
getPersistenceAdapter()
Returns the persistence adapter |
org.activemq.message.ActiveMQXid[] |
getPreparedTransactions(org.activemq.broker.BrokerClient client)
Gets the prepared XA transactions. |
org.activemq.service.RedeliveryPolicy |
getRedeliveryPolicy()
|
org.activemq.security.SecurityAdapter |
getSecurityAdapter()
Returns the security adapter used to authenticate and authorize access to JMS resources |
java.util.List |
getTransportConnectors()
Returns the transport connectors used to communicate with
clients |
int |
prepareTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid)
Prepare an XA transaction. |
void |
registerConnection(org.activemq.broker.BrokerClient client,
org.activemq.message.ConnectionInfo info)
registers a new Connection |
void |
registerMessageConsumer(org.activemq.broker.BrokerClient client,
org.activemq.message.ConsumerInfo info)
Registers a MessageConsumer |
void |
registerMessageProducer(org.activemq.broker.BrokerClient client,
org.activemq.message.ProducerInfo info)
Registers a MessageProducer |
void |
registerRemoteClientID(java.lang.String remoteClientID)
register a remote clientID |
void |
registerSession(org.activemq.broker.BrokerClient client,
org.activemq.message.SessionInfo info)
Register a client-side Session (used for Monitoring) |
void |
removeConnector(org.activemq.broker.BrokerConnector connector)
Called when a connector is removed to this container |
void |
removeNetworkConnector(org.activemq.transport.NetworkConnector connector)
Removes the given network connector |
void |
rollbackTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid)
Rollback an XA transaction. |
void |
rollbackTransaction(org.activemq.broker.BrokerClient client,
java.lang.String transactionId)
Rollback a transacton |
void |
sendMessage(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQMessage message)
Send a non-transacted message to the Broker |
void |
setDeadLetterPolicy(org.activemq.service.DeadLetterPolicy deadLetterPolicy)
|
void |
setDiscoveryAgent(org.activemq.transport.DiscoveryAgent discoveryAgent)
|
void |
setNetworkConnectors(java.util.List networkConnectors)
|
void |
setPersistenceAdapter(org.activemq.store.PersistenceAdapter persistenceAdapter)
|
void |
setRedeliveryPolicy(org.activemq.service.RedeliveryPolicy redeliveryPolicy)
|
void |
setSecurityAdapter(org.activemq.security.SecurityAdapter securityAdapter)
Sets the security adapter used to authenticate and authorize access to JMS resources |
void |
setTransportConnectors(java.util.List transportConnectors)
|
void |
start()
start the Container |
void |
startTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid)
Start an XA transaction. |
void |
startTransaction(org.activemq.broker.BrokerClient client,
java.lang.String transactionId)
Start a transaction from the Client session |
void |
stop()
Stop the Container |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DISABLE_CLEAN_SHUTDOWN_PROPERTY
public static final java.lang.String DISABLE_CLEAN_SHUTDOWN_PROPERTY
- See Also:
- Constant Field Values
log
private static final org.apache.commons.logging.Log log
useLoggingForShutdownErrors
private static final boolean useLoggingForShutdownErrors
- See Also:
- Constant Field Values
context
private org.activemq.broker.BrokerContext context
broker
private org.activemq.broker.Broker broker
clientIds
private java.util.Map clientIds
consumerInfos
private java.util.Map consumerInfos
producerInfos
private java.util.Map producerInfos
transportConnectors
private java.util.List transportConnectors
shutdownHook
private java.lang.Thread shutdownHook
stopped
private boolean stopped
networkConnectors
private java.util.List networkConnectors
discoveryAgent
private org.activemq.transport.DiscoveryAgent discoveryAgent
localDiscoveryDetails
private java.util.Map localDiscoveryDetails
remoteClientIds
private java.util.Set remoteClientIds
BrokerContainerImpl
public BrokerContainerImpl()
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
org.activemq.io.util.MemoryBoundedObjectManager memoryManager)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
java.lang.String clusterName)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
org.activemq.store.PersistenceAdapter persistenceAdapter)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
org.activemq.broker.BrokerContext context)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
org.activemq.broker.BrokerContext context,
org.activemq.io.util.MemoryBoundedObjectManager memoryManager)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
java.lang.String clusterName,
org.activemq.broker.BrokerContext context)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
org.activemq.store.PersistenceAdapter persistenceAdapter,
org.activemq.broker.BrokerContext context)
BrokerContainerImpl
public BrokerContainerImpl(java.lang.String brokerName,
java.lang.String clusterName,
org.activemq.store.PersistenceAdapter persistenceAdapter,
org.activemq.broker.BrokerContext context)
BrokerContainerImpl
public BrokerContainerImpl(org.activemq.broker.Broker broker,
org.activemq.broker.BrokerContext context)
start
public void start()
throws javax.jms.JMSException
- start the Container
- Specified by:
start in interface org.activemq.service.Service
stop
public void stop()
throws javax.jms.JMSException
- Stop the Container
- Specified by:
stop in interface org.activemq.service.Service
registerConnection
public void registerConnection(org.activemq.broker.BrokerClient client,
org.activemq.message.ConnectionInfo info)
throws javax.jms.JMSException
- registers a new Connection
- Specified by:
registerConnection in interface org.activemq.broker.BrokerContainer
deregisterConnection
public void deregisterConnection(org.activemq.broker.BrokerClient client,
org.activemq.message.ConnectionInfo info)
throws javax.jms.JMSException
- un-registers a Connection
- Specified by:
deregisterConnection in interface org.activemq.broker.BrokerContainer
registerMessageConsumer
public void registerMessageConsumer(org.activemq.broker.BrokerClient client,
org.activemq.message.ConsumerInfo info)
throws javax.jms.JMSException
- Registers a MessageConsumer
- Specified by:
registerMessageConsumer in interface org.activemq.broker.BrokerContainer
deregisterMessageConsumer
public void deregisterMessageConsumer(org.activemq.broker.BrokerClient client,
org.activemq.message.ConsumerInfo info)
throws javax.jms.JMSException
- De-register a MessageConsumer from the Broker
- Specified by:
deregisterMessageConsumer in interface org.activemq.broker.BrokerContainer
registerMessageProducer
public void registerMessageProducer(org.activemq.broker.BrokerClient client,
org.activemq.message.ProducerInfo info)
throws javax.jms.JMSException
- Registers a MessageProducer
- Specified by:
registerMessageProducer in interface org.activemq.broker.BrokerContainer
deregisterMessageProducer
public void deregisterMessageProducer(org.activemq.broker.BrokerClient client,
org.activemq.message.ProducerInfo info)
throws javax.jms.JMSException
- De-register a MessageProducer from the Broker
- Specified by:
deregisterMessageProducer in interface org.activemq.broker.BrokerContainer
registerSession
public void registerSession(org.activemq.broker.BrokerClient client,
org.activemq.message.SessionInfo info)
throws javax.jms.JMSException
- Register a client-side Session (used for Monitoring)
- Specified by:
registerSession in interface org.activemq.broker.BrokerContainer
deregisterSession
public void deregisterSession(org.activemq.broker.BrokerClient client,
org.activemq.message.SessionInfo info)
throws javax.jms.JMSException
- De-register a client-side Session from the Broker (used for monitoring)
- Specified by:
deregisterSession in interface org.activemq.broker.BrokerContainer
startTransaction
public void startTransaction(org.activemq.broker.BrokerClient client,
java.lang.String transactionId)
throws javax.jms.JMSException
- Start a transaction from the Client session
- Specified by:
startTransaction in interface org.activemq.broker.BrokerContainer
rollbackTransaction
public void rollbackTransaction(org.activemq.broker.BrokerClient client,
java.lang.String transactionId)
throws javax.jms.JMSException
- Rollback a transacton
- Specified by:
rollbackTransaction in interface org.activemq.broker.BrokerContainer
commitTransaction
public void commitTransaction(org.activemq.broker.BrokerClient client,
java.lang.String transactionId)
throws javax.jms.JMSException
- Commit a transaction
- Specified by:
commitTransaction in interface org.activemq.broker.BrokerContainer
sendMessage
public void sendMessage(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQMessage message)
throws javax.jms.JMSException
- Send a non-transacted message to the Broker
- Specified by:
sendMessage in interface org.activemq.broker.BrokerContainer
registerRemoteClientID
public void registerRemoteClientID(java.lang.String remoteClientID)
- register a remote clientID
- Specified by:
registerRemoteClientID in interface org.activemq.broker.BrokerContainer
deregisterRemoteClientID
public void deregisterRemoteClientID(java.lang.String remoteClientID)
- deregister a remote clientID
- Specified by:
deregisterRemoteClientID in interface org.activemq.broker.BrokerContainer
checkTempDestinationExistance
private void checkTempDestinationExistance(org.activemq.message.ActiveMQDestination dest)
throws javax.jms.InvalidDestinationException
acknowledgeMessage
public void acknowledgeMessage(org.activemq.broker.BrokerClient client,
org.activemq.message.MessageAck ack)
throws javax.jms.JMSException
- Acknowledge reciept of a message
- Specified by:
acknowledgeMessage in interface org.activemq.broker.BrokerContainer
durableUnsubscribe
public void durableUnsubscribe(org.activemq.broker.BrokerClient client,
org.activemq.message.DurableUnsubscribe ds)
throws javax.jms.JMSException
- Command to delete a durable topic subscription
- Specified by:
durableUnsubscribe in interface org.activemq.broker.BrokerContainer
startTransaction
public void startTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid)
throws javax.transaction.xa.XAException
- Start an XA transaction.
- Specified by:
startTransaction in interface org.activemq.broker.BrokerContainer
getPreparedTransactions
public org.activemq.message.ActiveMQXid[] getPreparedTransactions(org.activemq.broker.BrokerClient client)
throws javax.transaction.xa.XAException
- Gets the prepared XA transactions.
- Specified by:
getPreparedTransactions in interface org.activemq.broker.BrokerContainer
prepareTransaction
public int prepareTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid)
throws javax.transaction.xa.XAException
- Prepare an XA transaction.
- Specified by:
prepareTransaction in interface org.activemq.broker.BrokerContainer
rollbackTransaction
public void rollbackTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid)
throws javax.transaction.xa.XAException
- Rollback an XA transaction.
- Specified by:
rollbackTransaction in interface org.activemq.broker.BrokerContainer
commitTransaction
public void commitTransaction(org.activemq.broker.BrokerClient client,
org.activemq.message.ActiveMQXid xid,
boolean onePhase)
throws javax.transaction.xa.XAException
- Commit an XA transaction.
- Specified by:
commitTransaction in interface org.activemq.broker.BrokerContainer
capacityChanged
public void capacityChanged(org.activemq.capacity.CapacityMonitorEvent event)
- Update any message producers about our capacity to handle messages
- Specified by:
capacityChanged in interface org.activemq.capacity.CapacityMonitorEventListener
getTransportConnectors
public java.util.List getTransportConnectors()
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Returns the transport connectors used to communicate with
clients
- Specified by:
getTransportConnectors in interface org.activemq.broker.BrokerContainer
setTransportConnectors
public void setTransportConnectors(java.util.List transportConnectors)
- Specified by:
setTransportConnectors in interface org.activemq.broker.BrokerContainer
addConnector
public void addConnector(org.activemq.broker.BrokerConnector connector)
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Called when a new connector is added to this container
- Specified by:
addConnector in interface org.activemq.broker.BrokerContainer
removeConnector
public void removeConnector(org.activemq.broker.BrokerConnector connector)
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Called when a connector is removed to this container
- Specified by:
removeConnector in interface org.activemq.broker.BrokerContainer
addConnector
public void addConnector(java.lang.String bindAddress)
throws javax.jms.JMSException
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Adds a new transport connector for the given bind address
- Specified by:
addConnector in interface org.activemq.broker.BrokerContainer
addConnector
public void addConnector(java.lang.String bindAddress,
org.activemq.io.WireFormat wireFormat)
throws javax.jms.JMSException
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Adds a new transport connector for the given bind address and wire format
- Specified by:
addConnector in interface org.activemq.broker.BrokerContainer
addConnector
public void addConnector(org.activemq.transport.TransportServerChannel transportConnector)
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Adds a new transport connector for the given transportConnector
- Specified by:
addConnector in interface org.activemq.broker.BrokerContainer
getNetworkConnectors
public java.util.List getNetworkConnectors()
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Returns a list of org.activemq.transport.NetworkConnector
instances used to communicate with the network of org.activemq.broker.Broker instances
- Specified by:
getNetworkConnectors in interface org.activemq.broker.BrokerContainer
setNetworkConnectors
public void setNetworkConnectors(java.util.List networkConnectors)
- Specified by:
setNetworkConnectors in interface org.activemq.broker.BrokerContainer
addNetworkConnector
public org.activemq.transport.NetworkConnector addNetworkConnector(java.lang.String uri)
throws javax.jms.JMSException
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Adds a new network connector for the given URI
- Specified by:
addNetworkConnector in interface org.activemq.broker.BrokerContainer
addNetworkConnector
public org.activemq.transport.NetworkConnector addNetworkConnector()
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Adds a new network connector
- Specified by:
addNetworkConnector in interface org.activemq.broker.BrokerContainer
addNetworkConnector
public void addNetworkConnector(org.activemq.transport.NetworkConnector connector)
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Adds a new network connector
- Specified by:
addNetworkConnector in interface org.activemq.broker.BrokerContainer
removeNetworkConnector
public void removeNetworkConnector(org.activemq.transport.NetworkConnector connector)
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Removes the given network connector
- Specified by:
removeNetworkConnector in interface org.activemq.broker.BrokerContainer
getBroker
public org.activemq.broker.Broker getBroker()
- Specified by:
getBroker in interface org.activemq.broker.BrokerContainer
getPersistenceAdapter
public org.activemq.store.PersistenceAdapter getPersistenceAdapter()
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Returns the persistence adapter
- Specified by:
getPersistenceAdapter in interface org.activemq.broker.BrokerContainer
setPersistenceAdapter
public void setPersistenceAdapter(org.activemq.store.PersistenceAdapter persistenceAdapter)
- Specified by:
setPersistenceAdapter in interface org.activemq.broker.BrokerContainer
getDiscoveryAgent
public org.activemq.transport.DiscoveryAgent getDiscoveryAgent()
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Returns the discovery agent if one is available or null if discovery is not
enabled
- Specified by:
getDiscoveryAgent in interface org.activemq.broker.BrokerContainer
setDiscoveryAgent
public void setDiscoveryAgent(org.activemq.transport.DiscoveryAgent discoveryAgent)
- Specified by:
setDiscoveryAgent in interface org.activemq.broker.BrokerContainer
getSecurityAdapter
public org.activemq.security.SecurityAdapter getSecurityAdapter()
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Returns the security adapter used to authenticate and authorize access to JMS resources
- Specified by:
getSecurityAdapter in interface org.activemq.broker.BrokerContainer
setSecurityAdapter
public void setSecurityAdapter(org.activemq.security.SecurityAdapter securityAdapter)
- Description copied from interface:
org.activemq.broker.BrokerContainer
- Sets the security adapter used to authenticate and authorize access to JMS resources
- Specified by:
setSecurityAdapter in interface org.activemq.broker.BrokerContainer
getRedeliveryPolicy
public org.activemq.service.RedeliveryPolicy getRedeliveryPolicy()
setRedeliveryPolicy
public void setRedeliveryPolicy(org.activemq.service.RedeliveryPolicy redeliveryPolicy)
getDeadLetterPolicy
public org.activemq.service.DeadLetterPolicy getDeadLetterPolicy()
setDeadLetterPolicy
public void setDeadLetterPolicy(org.activemq.service.DeadLetterPolicy deadLetterPolicy)
checkBrokerSet
protected void checkBrokerSet()
createLocalDiscoveryDetails
protected java.util.Map createLocalDiscoveryDetails()
getLocalBrokerName
protected java.lang.String getLocalBrokerName()
getLocalConnectionURL
protected java.lang.String getLocalConnectionURL()
addShutdownHook
protected void addShutdownHook()
containerShutdown
protected void containerShutdown()
- Causes a clean shutdown of the container when the VM is being shut down
doDeRegistration
protected void doDeRegistration(java.lang.String oldName)
doRegistration
protected void doRegistration(java.lang.String brokerName)