BrokerContainerImpl (ActiveMQ 1.1 API)
Keywords: org.codehaus.activemq.broker.impl.BrokerContainerImpl class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.broker.impl
Class BrokerContainerImpl

    java.lang.Object
      org.codehaus.activemq.broker.impl.BrokerContainerImpl

All Implemented Interfaces:
  BrokerContainer, CapacityMonitorEventListener, Service

public class BrokerContainerImpl
extends Object
implements BrokerContainer, CapacityMonitorEventListener

Represents the ActiveMQ JMS Broker which typically has one or many connectors

Version:
  $Revision: 1.34 $

Constructor Summary
`BrokerContainerImpl()`
`BrokerContainerImpl(Broker broker, BrokerContext context)`
`BrokerContainerImpl(String brokerName)`
`BrokerContainerImpl(String brokerName, BrokerContext context)`
`BrokerContainerImpl(String brokerName, PersistenceAdapter persistenceAdapter)`
`BrokerContainerImpl(String brokerName, PersistenceAdapter persistenceAdapter, BrokerContext context)`

Method Summary
`void` | `acknowledgeMessage(BrokerClient client, MessageAck ack)` Acknowledge reciept of a message
`void` | `acknowledgeTransactedMessage(BrokerClient client, String transactionId, MessageAck ack)` Acknowledge receipt of a message within a transaction context
`void` | `addConnector(BrokerConnector connector)` Called when a new connector is added to this container
`void` | `addConnector(String bindAddress)` Adds a new transport connector for the given bind address
`void` | `addConnector(String bindAddress, WireFormat wireFormat)` Adds a new transport connector for the given bind address and wire format
`void` | `addConnector(TransportServerChannel transportConnector)` Adds a new transport connector for the given transportConnector
`NetworkConnector` | `addNetworkConnector()` Adds a new network connector
`void` | `addNetworkConnector(NetworkConnector connector)` Adds a new network connector
`NetworkConnector` | `addNetworkConnector(String uri)` Adds a new network connector for the given URI
`protected void` | `addShutdownHook()`
`void` | `capacityChanged(CapacityMonitorEvent event)` Update any message producers about our capacity to handle messages
`protected void` | `checkBrokerSet()`
`void` | `commitTransaction(BrokerClient client, ActiveMQXid xid, boolean onePhase)` Commit an XA transaction.
`void` | `commitTransaction(BrokerClient client, String transactionId)` Commit a transaction
`protected void` | `containerShutdown()` Causes a clean shutdown of the container when the VM is being shut down
`protected Map` | `createLocalDiscoveryDetails()`
`void` | `deregisterConnection(BrokerClient client, ConnectionInfo info)` un-registers a Connection
`void` | `deregisterMessageConsumer(BrokerClient client, ConsumerInfo info)` De-register a MessageConsumer from the Broker
`void` | `deregisterMessageProducer(BrokerClient client, ProducerInfo info)` De-register a MessageProducer from the Broker
`void` | `deregisterSession(BrokerClient client, SessionInfo info)` De-register a client-side Session from the Broker (used for monitoring)
`void` | `durableUnsubscribe(BrokerClient client, DurableUnsubscribe ds)` Command to delete a durable topic subscription
`Broker` | `getBroker()`
`DiscoveryAgent` | `getDiscoveryAgent()` Returns the discovery agent if one is available or null if discovery is not enabled
`protected String` | `getLocalBrokerName()`
`protected String` | `getLocalConnectionURL()`
`List` | `getNetworkConnectors()` Returns a list of `NetworkConnector` instances used to communicate with the network of `Broker` instances
`PersistenceAdapter` | `getPersistenceAdapter()` Returns the persistence adapter
`ActiveMQXid[]` | `getPreparedTransactions(BrokerClient client)` Gets the prepared XA transactions.
`RedeliveryPolicy` | `getRedeliveryPolicy()`
`SecurityAdapter` | `getSecurityAdapter()` Returns the security adapter used to authenticate and authorize access to JMS resources
`List` | `getTransportConnectors()` Returns the transport connectors used to communicate with clients
`int` | `prepareTransaction(BrokerClient client, ActiveMQXid xid)` Prepare an XA transaction.
`void` | `registerConnection(BrokerClient client, ConnectionInfo info)` registers a new Connection
`void` | `registerMessageConsumer(BrokerClient client, ConsumerInfo info)` Registers a MessageConsumer
`void` | `registerMessageProducer(BrokerClient client, ProducerInfo info)` Registers a MessageProducer
`void` | `registerSession(BrokerClient client, SessionInfo info)` Register a client-side Session (used for Monitoring)
`void` | `removeConnector(BrokerConnector connector)` Called when a connector is removed to this container
`void` | `removeNetworkConnector(NetworkConnector connector)` Removes the given network connector
`void` | `rollbackTransaction(BrokerClient client, ActiveMQXid xid)` Rollback an XA transaction.
`void` | `rollbackTransaction(BrokerClient client, String transactionId)` Rollback a transacton
`void` | `sendMessage(BrokerClient client, ActiveMQMessage message)` Send a non-transacted message to the Broker
`void` | `sendTransactedMessage(BrokerClient client, String transactionId, ActiveMQMessage message)` send message with a transaction context
`void` | `setDiscoveryAgent(DiscoveryAgent discoveryAgent)`
`void` | `setNetworkConnectors(List networkConnectors)`
`void` | `setPersistenceAdapter(PersistenceAdapter persistenceAdapter)`
`void` | `setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)`
`void` | `setSecurityAdapter(SecurityAdapter securityAdapter)` Sets the security adapter used to authenticate and authorize access to JMS resources
`void` | `setTransportConnectors(List transportConnectors)`
`void` | `start()` start the Container
`void` | `startTransaction(BrokerClient client, ActiveMQXid xid)` Start an XA transaction.
`void` | `startTransaction(BrokerClient client, 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`

Constructor Detail

### BrokerContainerImpl

    public BrokerContainerImpl()

### BrokerContainerImpl

    public BrokerContainerImpl(String brokerName)

### BrokerContainerImpl

    public BrokerContainerImpl(String brokerName,
                               PersistenceAdapter persistenceAdapter)

### BrokerContainerImpl

    public BrokerContainerImpl(String brokerName,
                               BrokerContext context)

### BrokerContainerImpl

    public BrokerContainerImpl(String brokerName,
                               PersistenceAdapter persistenceAdapter,
                               BrokerContext context)

### BrokerContainerImpl

    public BrokerContainerImpl(Broker broker,
                               BrokerContext context)

Parameters:
  `broker` -

Method Detail

### start

    public void start()
               throws JMSException

  start the Container

  Specified by:
    `start` in interface `Service`
  Throws:
    `JMSException`

### stop

    public void stop()
              throws JMSException

  Stop the Container

  Specified by:
    `stop` in interface `Service`
  Throws:
    `JMSException`

### registerConnection

    public void registerConnection(BrokerClient client,
                                   ConnectionInfo info)
                            throws JMSException

  registers a new Connection

  Specified by:
    `registerConnection` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` - infomation about the client-side Connection
  Throws:
    `InvalidClientIDException` - if the ClientID of the Connection is a duplicate
    `JMSException`

### deregisterConnection

    public void deregisterConnection(BrokerClient client,
                                     ConnectionInfo info)
                              throws JMSException

  un-registers a Connection

  Specified by:
    `deregisterConnection` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` - infomation about the client-side Connection
  Throws:
    `JMSException`

### registerMessageConsumer

    public void registerMessageConsumer(BrokerClient client,
                                        ConsumerInfo info)
                                 throws JMSException

  Registers a MessageConsumer

  Specified by:
    `registerMessageConsumer` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` -
  Throws:
    `JMSException`
    `JMSSecurityException` - if client authentication fails for the Destination the Consumer applies for

### deregisterMessageConsumer

    public void deregisterMessageConsumer(BrokerClient client,
                                          ConsumerInfo info)
                                   throws JMSException

  De-register a MessageConsumer from the Broker

  Specified by:
    `deregisterMessageConsumer` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` -
  Throws:
    `JMSException`

### registerMessageProducer

    public void registerMessageProducer(BrokerClient client,
                                        ProducerInfo info)
                                 throws JMSException

  Registers a MessageProducer

  Specified by:
    `registerMessageProducer` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` -
  Throws:
    `JMSException`
    `JMSSecurityException` - if client authentication fails for the Destination the Consumer applies for

### deregisterMessageProducer

    public void deregisterMessageProducer(BrokerClient client,
                                          ProducerInfo info)
                                   throws JMSException

  De-register a MessageProducer from the Broker

  Specified by:
    `deregisterMessageProducer` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` -
  Throws:
    `JMSException`

### registerSession

    public void registerSession(BrokerClient client,
                                SessionInfo info)
                         throws JMSException

  Register a client-side Session (used for Monitoring)

  Specified by:
    `registerSession` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` -
  Throws:
    `JMSException`

### deregisterSession

    public void deregisterSession(BrokerClient client,
                                  SessionInfo info)
                           throws JMSException

  De-register a client-side Session from the Broker (used for monitoring)

  Specified by:
    `deregisterSession` in interface `BrokerContainer`
  Parameters:
    `client` -
    `info` -
  Throws:
    `JMSException`

### startTransaction

    public void startTransaction(BrokerClient client,
                                 String transactionId)
                          throws JMSException

  Start a transaction from the Client session

  Specified by:
    `startTransaction` in interface `BrokerContainer`
  Parameters:
    `client` -
    `transactionId` -
  Throws:
    `JMSException`

### rollbackTransaction

    public void rollbackTransaction(BrokerClient client,
                                    String transactionId)
                             throws JMSException

  Rollback a transacton

  Specified by:
    `rollbackTransaction` in interface `BrokerContainer`
  Parameters:
    `client` -
    `transactionId` -
  Throws:
    `JMSException`

### commitTransaction

    public void commitTransaction(BrokerClient client,
                                  String transactionId)
                           throws JMSException

  Commit a transaction

  Specified by:
    `commitTransaction` in interface `BrokerContainer`
  Parameters:
    `client` -
    `transactionId` -
  Throws:
    `JMSException`

### sendTransactedMessage

    public void sendTransactedMessage(BrokerClient client,
                                      String transactionId,
                                      ActiveMQMessage message)
                               throws JMSException

  send message with a transaction context

  Specified by:
    `sendTransactedMessage` in interface `BrokerContainer`
  Parameters:
    `client` -
    `transactionId` -
    `message` -
  Throws:
    `JMSException`

### acknowledgeTransactedMessage

    public void acknowledgeTransactedMessage(BrokerClient client,
                                             String transactionId,
                                             MessageAck ack)
                                      throws JMSException

  Acknowledge receipt of a message within a transaction context

  Specified by:
    `acknowledgeTransactedMessage` in interface `BrokerContainer`
  Parameters:
    `client` -
    `transactionId` -
    `ack` -
  Throws:
    `JMSException`

### sendMessage

    public void sendMessage(BrokerClient client,
                            ActiveMQMessage message)
                     throws JMSException

  Send a non-transacted message to the Broker

  Specified by:
    `sendMessage` in interface `BrokerContainer`
  Parameters:
    `client` -
    `message` -
  Throws:
    `JMSException`

### acknowledgeMessage

    public void acknowledgeMessage(BrokerClient client,
                                   MessageAck ack)
                            throws JMSException

  Acknowledge reciept of a message

  Specified by:
    `acknowledgeMessage` in interface `BrokerContainer`
  Parameters:
    `client` -
    `ack` -
  Throws:
    `JMSException`

### durableUnsubscribe

    public void durableUnsubscribe(BrokerClient client,
                                   DurableUnsubscribe ds)
                            throws JMSException

  Command to delete a durable topic subscription

  Specified by:
    `durableUnsubscribe` in interface `BrokerContainer`
  Parameters:
    `client` -
    `ds` -
  Throws:
    `JMSException`

### startTransaction

    public void startTransaction(BrokerClient client,
                                 ActiveMQXid xid)
                          throws XAException

  Start an XA transaction.

  Specified by:
    `startTransaction` in interface `BrokerContainer`
  Parameters:
    `client` -
    `xid` -
  Throws:
    `XAException`

### getPreparedTransactions

    public ActiveMQXid[] getPreparedTransactions(BrokerClient client)
                                          throws XAException

  Gets the prepared XA transactions.

  Specified by:
    `getPreparedTransactions` in interface `BrokerContainer`
  Parameters:
    `client` -
  Returns:
  Throws:
    `XAException`

### prepareTransaction

    public int prepareTransaction(BrokerClient client,
                                  ActiveMQXid xid)
                           throws XAException

  Prepare an XA transaction.

  Specified by:
    `prepareTransaction` in interface `BrokerContainer`
  Parameters:
    `client` -
    `xid` -
  Throws:
    `XAException`

### rollbackTransaction

    public void rollbackTransaction(BrokerClient client,
                                    ActiveMQXid xid)
                             throws XAException

  Rollback an XA transaction.

  Specified by:
    `rollbackTransaction` in interface `BrokerContainer`
  Parameters:
    `client` -
    `xid` -
  Throws:
    `XAException`

### commitTransaction

    public void commitTransaction(BrokerClient client,
                                  ActiveMQXid xid,
                                  boolean onePhase)
                           throws XAException

  Commit an XA transaction.

  Specified by:
    `commitTransaction` in interface `BrokerContainer`
  Parameters:
    `client` -
    `xid` -
    `onePhase` -
  Throws:
    `XAException`

### capacityChanged

    public void capacityChanged(CapacityMonitorEvent event)

  Update any message producers about our capacity to handle messages

  Specified by:
    `capacityChanged` in interface `CapacityMonitorEventListener`
  Parameters:
    `event` -

### getTransportConnectors

    public List getTransportConnectors()

  Description copied from interface: `BrokerContainer`
  Returns the transport connectors used to communicate with clients

  Specified by:
    `getTransportConnectors` in interface `BrokerContainer`

### setTransportConnectors

    public void setTransportConnectors(List transportConnectors)

  Specified by:
    `setTransportConnectors` in interface `BrokerContainer`

### addConnector

    public void addConnector(BrokerConnector connector)

  Description copied from interface: `BrokerContainer`
  Called when a new connector is added to this container

  Specified by:
    `addConnector` in interface `BrokerContainer`
  Parameters:
    `connector` -

### removeConnector

    public void removeConnector(BrokerConnector connector)

  Description copied from interface: `BrokerContainer`
  Called when a connector is removed to this container

  Specified by:
    `removeConnector` in interface `BrokerContainer`
  Parameters:
    `connector` -

### addConnector

    public void addConnector(String bindAddress)
                      throws JMSException

  Description copied from interface: `BrokerContainer`
  Adds a new transport connector for the given bind address

  Specified by:
    `addConnector` in interface `BrokerContainer`
  Throws:
    `JMSException`

### addConnector

    public void addConnector(String bindAddress,
                             WireFormat wireFormat)
                      throws JMSException

  Description copied from interface: `BrokerContainer`
  Adds a new transport connector for the given bind address and wire format

  Specified by:
    `addConnector` in interface `BrokerContainer`
  Throws:
    `JMSException`

### addConnector

    public void addConnector(TransportServerChannel transportConnector)

  Description copied from interface: `BrokerContainer`
  Adds a new transport connector for the given transportConnector

  Specified by:
    `addConnector` in interface `BrokerContainer`

### getNetworkConnectors

    public List getNetworkConnectors()

  Description copied from interface: `BrokerContainer`
  Returns a list of `NetworkConnector` instances used to communicate with the network of `Broker` instances

  Specified by:
    `getNetworkConnectors` in interface `BrokerContainer`

### setNetworkConnectors

    public void setNetworkConnectors(List networkConnectors)

  Specified by:
    `setNetworkConnectors` in interface `BrokerContainer`

### addNetworkConnector

    public NetworkConnector addNetworkConnector(String uri)

  Description copied from interface: `BrokerContainer`
  Adds a new network connector for the given URI

  Specified by:
    `addNetworkConnector` in interface `BrokerContainer`

### addNetworkConnector

    public NetworkConnector addNetworkConnector()

  Description copied from interface: `BrokerContainer`
  Adds a new network connector

  Specified by:
    `addNetworkConnector` in interface `BrokerContainer`
  Returns:
    the newly created network connector

### addNetworkConnector

    public void addNetworkConnector(NetworkConnector connector)

  Description copied from interface: `BrokerContainer`
  Adds a new network connector

  Specified by:
    `addNetworkConnector` in interface `BrokerContainer`

### removeNetworkConnector

    public void removeNetworkConnector(NetworkConnector connector)

  Description copied from interface: `BrokerContainer`
  Removes the given network connector

  Specified by:
    `removeNetworkConnector` in interface `BrokerContainer`

### getBroker

    public Broker getBroker()

  Specified by:
    `getBroker` in interface `BrokerContainer`
  Returns:
    the Broker for the Container

### getPersistenceAdapter

    public PersistenceAdapter getPersistenceAdapter()

  Description copied from interface: `BrokerContainer`
  Returns the persistence adapter

  Specified by:
    `getPersistenceAdapter` in interface `BrokerContainer`

### setPersistenceAdapter

    public void setPersistenceAdapter(PersistenceAdapter persistenceAdapter)

  Specified by:
    `setPersistenceAdapter` in interface `BrokerContainer`

### getDiscoveryAgent

    public DiscoveryAgent getDiscoveryAgent()

  Description copied from interface: `BrokerContainer`
  Returns the discovery agent if one is available or null if discovery is not enabled

  Specified by:
    `getDiscoveryAgent` in interface `BrokerContainer`

### setDiscoveryAgent

    public void setDiscoveryAgent(DiscoveryAgent discoveryAgent)

  Specified by:
    `setDiscoveryAgent` in interface `BrokerContainer`

### getSecurityAdapter

    public SecurityAdapter getSecurityAdapter()

  Description copied from interface: `BrokerContainer`
  Returns the security adapter used to authenticate and authorize access to JMS resources

  Specified by:
    `getSecurityAdapter` in interface `BrokerContainer`

### setSecurityAdapter

    public void setSecurityAdapter(SecurityAdapter securityAdapter)

  Description copied from interface: `BrokerContainer`
  Sets the security adapter used to authenticate and authorize access to JMS resources

  Specified by:
    `setSecurityAdapter` in interface `BrokerContainer`

### getRedeliveryPolicy

    public RedeliveryPolicy getRedeliveryPolicy()

### setRedeliveryPolicy

    public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)

### checkBrokerSet

    protected void checkBrokerSet()

### createLocalDiscoveryDetails

    protected Map createLocalDiscoveryDetails()

### getLocalBrokerName

    protected String getLocalBrokerName()

### getLocalConnectionURL

    protected String getLocalConnectionURL()

### addShutdownHook

    protected void addShutdownHook()

### containerShutdown

    protected void containerShutdown()

  Causes a clean shutdown of the container when the VM is being shut down

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.