org.apache.activemq.broker
Interface Broker

All Superinterfaces:
Region, Service
All Known Implementing Classes:
AdvisoryBroker, AuthorizationBroker, BrokerBroadcaster, BrokerFilter, BrokerPluginSupport, CompositeDestinationBroker, ConnectionDotFileInterceptor, DestinationDotFileInterceptor, DotFileInterceptorSupport, EmptyBroker, ErrorBroker, InsertableMutableBrokerFilter, JaasAuthenticationBroker, JaasCertificateAuthenticationBroker, LoggingBrokerPlugin, ManagedRegionBroker, MasterBroker, MulticastTraceBrokerPlugin, MutableBrokerFilter, RegionBroker, SimpleAuthenticationBroker, TimeStampingBrokerPlugin, TransactionBroker, UDPTraceBrokerPlugin, UserIDBroker

public interface Broker
extends Region, Service

The Message Broker which routes messages, maintains subscriptions and connections, acknowledges messages and handles transactions.

Version:
$Revision: 1.8 $

Method Summary
 void addBroker(Connection connection, BrokerInfo info)
          A remote Broker connects
 void addConnection(ConnectionContext context, ConnectionInfo info)
          A client is establishing a connection with the broker.
 void addDestinationInfo(ConnectionContext context, DestinationInfo info)
          Add and process a DestinationInfo object
 void addProducer(ConnectionContext context, ProducerInfo info)
          Adds a producer.
 void addSession(ConnectionContext context, SessionInfo info)
          Adds a session.
 void beginTransaction(ConnectionContext context, TransactionId xid)
          Starts a transaction.
 void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase)
          Commits a transaction.
 void forgetTransaction(ConnectionContext context, TransactionId transactionId)
          Forgets a transaction.
 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
 Connection[] getClients()
           
 ActiveMQDestination[] getDestinations()
           
 java.util.Set getDurableDestinations()
           
 BrokerInfo[] getPeerBrokerInfos()
          Get the BrokerInfo's of any connected Brokers
 PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy()
           
 TransactionId[] getPreparedTransactions(ConnectionContext context)
          Gets a list of all the prepared xa transactions.
 Store getTempDataStore()
           
 boolean isFaultTolerantConfiguration()
           
 boolean isSlaveBroker()
           
 boolean isStopped()
           
 int prepareTransaction(ConnectionContext context, TransactionId xid)
          Prepares a transaction.
 void processDispatch(MessageDispatch messageDispatch)
          Notify the Broker that a dispatch has happened
 void removeBroker(Connection connection, BrokerInfo info)
          Remove a BrokerInfo
 void removeConnection(ConnectionContext context, ConnectionInfo info, java.lang.Throwable error)
          A client is disconnecting from the broker.
 void removeDestinationInfo(ConnectionContext context, DestinationInfo info)
          Remove and process a DestinationInfo object
 void removeProducer(ConnectionContext context, ProducerInfo info)
          Removes a producer.
 void removeSession(ConnectionContext context, SessionInfo info)
          Removes a session.
 void rollbackTransaction(ConnectionContext context, TransactionId xid)
          Rollsback a transaction.
 void setAdminConnectionContext(ConnectionContext adminConnectionContext)
          Sets the default administration connection context used when configuring the broker on startup or via JMX
 void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy)
           
 
Methods inherited from interface org.apache.activemq.broker.region.Region
acknowledge, addConsumer, addDestination, gc, getDestinationMap, getDestinations, messagePull, processDispatchNotification, removeConsumer, removeDestination, removeSubscription, send
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

getAdaptor

Broker getAdaptor(java.lang.Class type)
Get a Broker from the Broker Stack that is a particular class

Parameters:
type -
Returns:

getBrokerId

BrokerId getBrokerId()
Get the id of the broker

Parameters:
context -
info -
client -

getBrokerName

java.lang.String getBrokerName()
Get the name of the broker


addBroker

void addBroker(Connection connection,
               BrokerInfo info)
A remote Broker connects

Parameters:
contection -
info -
client -

removeBroker

void removeBroker(Connection connection,
                  BrokerInfo info)
Remove a BrokerInfo

Parameters:
connection -
info -

addConnection

void addConnection(ConnectionContext context,
                   ConnectionInfo info)
                   throws java.lang.Exception
A client is establishing a connection with the broker.

Parameters:
context -
info -
client -
Throws:
java.lang.Exception - TODO

removeConnection

void removeConnection(ConnectionContext context,
                      ConnectionInfo info,
                      java.lang.Throwable error)
                      throws java.lang.Exception
A client is disconnecting from the broker.

Parameters:
context - the environment the operation is being executed under.
info -
client -
error - null if the client requested the disconnect or the error that caused the client to disconnect.
Throws:
java.lang.Exception - TODO

addSession

void addSession(ConnectionContext context,
                SessionInfo info)
                throws java.lang.Exception
Adds a session.

Parameters:
context -
info -
Throws:
java.lang.Exception - TODO

removeSession

void removeSession(ConnectionContext context,
                   SessionInfo info)
                   throws java.lang.Exception
Removes a session.

Parameters:
context -
info -
Throws:
java.lang.Exception - TODO

addProducer

void addProducer(ConnectionContext context,
                 ProducerInfo info)
                 throws java.lang.Exception
Adds a producer.

Parameters:
context - the enviorment the operation is being executed under.
Throws:
java.lang.Exception - TODO

removeProducer

void removeProducer(ConnectionContext context,
                    ProducerInfo info)
                    throws java.lang.Exception
Removes a producer.

Parameters:
context - the enviorment the operation is being executed under.
Throws:
java.lang.Exception - TODO

getClients

Connection[] getClients()
                        throws java.lang.Exception
Returns:
all clients added to the Broker.
Throws:
java.lang.Exception - TODO

getDestinations

ActiveMQDestination[] getDestinations()
                                      throws java.lang.Exception
Returns:
all destinations added to the Broker.
Throws:
java.lang.Exception - TODO

getPreparedTransactions

TransactionId[] getPreparedTransactions(ConnectionContext context)
                                        throws java.lang.Exception
Gets a list of all the prepared xa transactions.

Parameters:
client -
Throws:
java.lang.Exception - TODO

beginTransaction

void beginTransaction(ConnectionContext context,
                      TransactionId xid)
                      throws java.lang.Exception
Starts a transaction.

Parameters:
client -
xid -
Throws:
java.lang.Exception - TODO

prepareTransaction

int prepareTransaction(ConnectionContext context,
                       TransactionId xid)
                       throws java.lang.Exception
Prepares a transaction. Only valid for xa transactions.

Parameters:
client -
xid -
Returns:
Throws:
java.lang.Exception - TODO

rollbackTransaction

void rollbackTransaction(ConnectionContext context,
                         TransactionId xid)
                         throws java.lang.Exception
Rollsback a transaction.

Parameters:
client -
xid -
Throws:
java.lang.Exception - TODO

commitTransaction

void commitTransaction(ConnectionContext context,
                       TransactionId xid,
                       boolean onePhase)
                       throws java.lang.Exception
Commits a transaction.

Parameters:
client -
xid -
onePhase -
Throws:
java.lang.Exception - TODO

forgetTransaction

void forgetTransaction(ConnectionContext context,
                       TransactionId transactionId)
                       throws java.lang.Exception
Forgets a transaction.

Parameters:
client -
xid -
onePhase -
Throws:
java.lang.Exception - TODO

getPeerBrokerInfos

BrokerInfo[] getPeerBrokerInfos()
Get the BrokerInfo's of any connected Brokers

Returns:
array of peer BrokerInfos

processDispatch

void processDispatch(MessageDispatch messageDispatch)
Notify the Broker that a dispatch has happened

Parameters:
messageDispatch -

isSlaveBroker

boolean isSlaveBroker()
Returns:
true if the broker is running as a slave

isStopped

boolean isStopped()
Returns:
true if the broker has stopped

getDurableDestinations

java.util.Set getDurableDestinations()
Returns:
a Set of all durable destinations

addDestinationInfo

void addDestinationInfo(ConnectionContext context,
                        DestinationInfo info)
                        throws java.lang.Exception
Add and process a DestinationInfo object

Parameters:
context -
info -
Throws:
java.lang.Exception

removeDestinationInfo

void removeDestinationInfo(ConnectionContext context,
                           DestinationInfo info)
                           throws java.lang.Exception
Remove and process a DestinationInfo object

Parameters:
context -
info -
Throws:
java.lang.Exception

isFaultTolerantConfiguration

boolean isFaultTolerantConfiguration()
Returns:
true if fault tolerant

getAdminConnectionContext

ConnectionContext getAdminConnectionContext()
Returns:
the connection context used to make administration operations on startup or via JMX MBeans

setAdminConnectionContext

void setAdminConnectionContext(ConnectionContext adminConnectionContext)
Sets the default administration connection context used when configuring the broker on startup or via JMX

Parameters:
adminConnectionContext -

getPendingDurableSubscriberPolicy

PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy()
Returns:
the pendingDurableSubscriberPolicy

setPendingDurableSubscriberPolicy

void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy)
Parameters:
pendingDurableSubscriberPolicy - the pendingDurableSubscriberPolicy to set

getTempDataStore

Store getTempDataStore()
Returns:
the broker's temp data store
Throws:
java.lang.Exception


Copyright © 2009 Apache Software Foundation. All Rights Reserved.