org.apache.activemq.broker
Class BrokerService

java.lang.Object
  extended by org.apache.activemq.broker.BrokerService
All Implemented Interfaces:
java.io.Serializable, Service
Direct Known Subclasses:
SslBrokerService, XBeanBrokerService

public class BrokerService
extends java.lang.Object
implements Service, java.io.Serializable

Manages the lifecycle of an ActiveMQ Broker. A BrokerService consists of a number of transport connectors, network connectors and a bunch of properties which can be used to configure the broker as its lazily created.

Version:
$Revision: 1.1 $
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_PORT
           
 
Constructor Summary
BrokerService()
           
 
Method Summary
 TransportConnector addConnector(java.lang.String bindAddress)
          Adds a new transport connector for the given bind address
 TransportConnector addConnector(TransportConnector connector)
          Adds a new transport connector
 TransportConnector addConnector(TransportServer transport)
          Adds a new transport connector for the given TransportServer transport
 TransportConnector addConnector(java.net.URI bindAddress)
          Adds a new transport connector for the given bind address
protected  Broker addInterceptors(Broker broker)
          Strategy method to add interceptors to the broker
 JmsConnector addJmsConnector(JmsConnector connector)
           
 NetworkConnector addNetworkConnector(NetworkConnector connector)
          Adds a new network connector to connect this broker to a federated network
 NetworkConnector addNetworkConnector(java.lang.String discoveryAddress)
          Adds a new network connector using the given discovery address
 NetworkConnector addNetworkConnector(java.net.URI discoveryAddress)
          Adds a new network connector using the given discovery address
 ProxyConnector addProxyConnector(ProxyConnector connector)
           
 ProxyConnector addProxyConnector(java.lang.String bindAddress)
          Adds a new proxy connector using the given bind address
 ProxyConnector addProxyConnector(java.net.URI bindAddress)
          Adds a new proxy connector using the given bind address
 void addService(Service service)
          Adds a new service so that it will be started as part of the broker lifecycle
protected  void addShutdownHook()
           
protected  void configureService(java.lang.Object service)
          Perform any custom dependency injection
protected  void containerShutdown()
          Causes a clean shutdown of the container when the VM is being shut down
protected  ConnectionContext createAdminConnectionContext()
          Factory method to create the new administration connection context object.
protected  Broker createBroker()
          Factory method to create a new broker
protected  javax.management.ObjectName createBrokerObjectName()
           
protected  DestinationInterceptor createDefaultDestinationInterceptor()
          Create the default destination interceptor
protected  javax.management.ObjectName createNetworkConnectorObjectName(NetworkConnector connector)
           
protected  PersistenceAdapter createPersistenceAdapter()
           
protected  DefaultPersistenceAdapterFactory createPersistenceFactory()
           
protected  Broker createRegionBroker()
          Factory method to create the core region broker onto which interceptors are added
protected  TransportConnector createTransportConnector(Broker broker, java.net.URI brokerURI)
           
 void deleteAllMessages()
          Delete all messages from the persistent store
 ConnectionContext getAdminConnectionContext()
          Returns the broker's administration connection context used for configuring the broker at startup
 BrokerView getAdminView()
          Returns the administration view of the broker; used to create and destroy resources such as queues and topics.
 Broker getBroker()
          Returns the message broker
 java.lang.String getBrokerName()
           
 javax.management.ObjectName getBrokerObjectName()
           
 java.io.File getDataDirectory()
           
 DestinationInterceptor[] getDestinationInterceptors()
           
 PolicyMap getDestinationPolicy()
           
 ActiveMQDestination[] getDestinations()
           
 JmsConnector[] getJmsBridgeConnectors()
           
 ManagementContext getManagementContext()
           
 java.lang.String getMasterConnectorURI()
           
 UsageManager getMemoryManager()
           
 MessageAuthorizationPolicy getMessageAuthorizationPolicy()
           
 java.util.List getNetworkConnectors()
           
 java.lang.String[] getNetworkConnectorURIs()
           
 PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy()
           
 PersistenceAdapter getPersistenceAdapter()
           
 PersistenceAdapterFactory getPersistenceFactory()
           
 TaskRunnerFactory getPersistenceTaskRunnerFactory()
           
 int getPersistenceThreadPriority()
           
 BrokerPlugin[] getPlugins()
           
protected  java.lang.Object getPort(java.util.Map options)
          Extracts the port from the options
 java.util.List getProxyConnectors()
           
 Service[] getServices()
           
 TaskRunnerFactory getTaskRunnerFactory()
           
 Store getTempDataStore()
           
 java.io.File getTmpDataDirectory()
           
 java.util.List getTransportConnectors()
           
 java.lang.String[] getTransportConnectorURIs()
           
 java.net.URI getVmConnectorURI()
           
 boolean isAdvisorySupport()
           
 boolean isDeleteAllMessagesOnStartup()
           
 boolean isKeepDurableSubsActive()
           
 boolean isPersistent()
           
 boolean isPopulateJMSXUserID()
           
 boolean isShutdownOnMasterFailure()
           
 boolean isSlave()
           
 boolean isStarted()
           
 boolean isUseJmx()
           
 boolean isUseLoggingForShutdownErrors()
           
 boolean isUseShutdownHook()
           
 boolean isUseVirtualTopics()
           
protected  void logError(java.lang.String message, java.lang.Throwable e)
           
 void masterFailed()
           
protected  void processHelperProperties()
          Handles any lazy-creation helper properties which are added to make things easier to configure inside environments such as Spring
protected  TransportConnector registerConnectorMBean(TransportConnector connector)
           
protected  void registerFTConnectorMBean(MasterConnector connector)
           
protected  void registerJmsConnectorMBean(JmsConnector connector)
           
protected  void registerNetworkConnectorMBean(NetworkConnector connector)
           
protected  void registerProxyConnectorMBean(ProxyConnector connector)
           
 boolean removeConnector(TransportConnector connector)
          Stops and removes a transport connector from the broker.
 JmsConnector removeJmsConnector(JmsConnector connector)
           
 boolean removeNetworkConnector(NetworkConnector connector)
          Removes the given network connector without stopping it.
protected  void removeShutdownHook()
           
 void setAdminView(BrokerView adminView)
           
 void setAdvisorySupport(boolean advisorySupport)
          Allows the support of advisory messages to be disabled for performance reasons.
 void setBrokerName(java.lang.String brokerName)
          Sets the name of this broker; which must be unique in the network
 void setBrokerObjectName(javax.management.ObjectName brokerObjectName)
          Sets the JMX ObjectName for this broker
 void setDataDirectory(java.io.File dataDirectory)
          Sets the directory in which the data files will be stored by default for the JDBC and Journal persistence adaptors.
 void setDeleteAllMessagesOnStartup(boolean deletePersistentMessagesOnStartup)
          Sets whether or not all messages are deleted on startup - mostly only useful for testing.
 void setDestinationFactory(DestinationFactory destinationFactory)
           
 void setDestinationInterceptors(DestinationInterceptor[] destinationInterceptors)
          Sets the destination interceptors to use
 void setDestinationPolicy(PolicyMap policyMap)
          Sets the destination specific policies available either for exact destinations or for wildcard areas of destinations.
 void setDestinations(ActiveMQDestination[] destinations)
          Sets the destinations which should be loaded/created on startup
 void setJmsBridgeConnectors(JmsConnector[] jmsConnectors)
           
 void setKeepDurableSubsActive(boolean keepDurableSubsActive)
           
 void setManagementContext(ManagementContext managementContext)
           
 void setMasterConnectorURI(java.lang.String masterConnectorURI)
           
 void setMemoryManager(UsageManager memoryManager)
           
 void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy)
          Sets the policy used to decide if the current connection is authorized to consume a given message
 void setNetworkConnectors(java.util.List networkConnectors)
          Sets the network connectors which this broker will use to connect to other brokers in a federated network
 void setNetworkConnectorURIs(java.lang.String[] networkConnectorURIs)
           
 void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy)
           
 void setPersistenceAdapter(PersistenceAdapter persistenceAdapter)
          Sets the persistence adaptor implementation to use for this broker
 void setPersistenceFactory(PersistenceAdapterFactory persistenceFactory)
           
 void setPersistenceTaskRunnerFactory(TaskRunnerFactory persistenceTaskRunnerFactory)
           
 void setPersistenceThreadPriority(int persistenceThreadPriority)
           
 void setPersistent(boolean persistent)
          Sets whether or not persistence is enabled or disabled.
 void setPlugins(BrokerPlugin[] plugins)
          Sets a number of broker plugins to install such as for security authentication or authorization
 void setPopulateJMSXUserID(boolean populateJMSXUserID)
          Sets whether or not the broker should populate the JMSXUserID header.
 void setProxyConnectors(java.util.List proxyConnectors)
          Sets the network connectors which this broker will use to connect to other brokers in a federated network
 void setServices(Service[] services)
          Sets the services associated with this broker such as a MasterConnector
 void setShutdownOnMasterFailure(boolean shutdownOnMasterFailure)
           
 void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
           
 void setTempDataStore(Store tempDataStore)
           
 void setTmpDataDirectory(java.io.File tmpDataDirectory)
           
 void setTransportConnectors(java.util.List transportConnectors)
          Sets the transport connectors which this broker will listen on for new clients
 void setTransportConnectorURIs(java.lang.String[] transportConnectorURIs)
           
 void setUseJmx(boolean useJmx)
          Sets whether or not the Broker's services should be exposed into JMX or not.
 void setUseLoggingForShutdownErrors(boolean useLoggingForShutdownErrors)
          Sets whether or not we should use commons-logging when reporting errors when shutting down the broker
 void setUseShutdownHook(boolean useShutdownHook)
          Sets whether or not we should use a shutdown handler to close down the broker cleanly if the JVM is terminated.
 void setUseVirtualTopics(boolean useVirtualTopics)
          Sets whether or not Virtual Topics should be supported by default if they have not been explicitly configured.
 void setVmConnectorURI(java.net.URI vmConnectorURI)
           
 void start()
           
protected  void startAllConnectors()
          Start all transport and network connections, proxies and bridges
protected  void startDestinations()
          Starts any configured destinations on startup
protected  void startDestinationsInPersistenceStore(Broker broker)
          Starts all destiantions in persistence store.
protected  TransportConnector startTransportConnector(TransportConnector connector)
           
 void stop()
           
protected  void stopAllConnectors(ServiceStopper stopper)
           
protected  void unregisterConnectorMBean(TransportConnector connector)
           
protected  void unregisterNetworkConnectorMBean(NetworkConnector connector)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final java.lang.String DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

BrokerService

public BrokerService()
Method Detail

addConnector

public TransportConnector addConnector(java.lang.String bindAddress)
                                throws java.lang.Exception
Adds a new transport connector for the given bind address

Returns:
the newly created and added transport connector
Throws:
java.lang.Exception

addConnector

public TransportConnector addConnector(java.net.URI bindAddress)
                                throws java.lang.Exception
Adds a new transport connector for the given bind address

Returns:
the newly created and added transport connector
Throws:
java.lang.Exception

addConnector

public TransportConnector addConnector(TransportServer transport)
                                throws java.lang.Exception
Adds a new transport connector for the given TransportServer transport

Returns:
the newly created and added transport connector
Throws:
java.lang.Exception

addConnector

public TransportConnector addConnector(TransportConnector connector)
                                throws java.lang.Exception
Adds a new transport connector

Returns:
the transport connector
Throws:
java.lang.Exception

removeConnector

public boolean removeConnector(TransportConnector connector)
                        throws java.lang.Exception
Stops and removes a transport connector from the broker.

Parameters:
connector -
Returns:
true if the connector has been previously added to the broker
Throws:
java.lang.Exception

addNetworkConnector

public NetworkConnector addNetworkConnector(java.lang.String discoveryAddress)
                                     throws java.lang.Exception
Adds a new network connector using the given discovery address

Returns:
the newly created and added network connector
Throws:
java.lang.Exception

addProxyConnector

public ProxyConnector addProxyConnector(java.lang.String bindAddress)
                                 throws java.lang.Exception
Adds a new proxy connector using the given bind address

Returns:
the newly created and added network connector
Throws:
java.lang.Exception

addNetworkConnector

public NetworkConnector addNetworkConnector(java.net.URI discoveryAddress)
                                     throws java.lang.Exception
Adds a new network connector using the given discovery address

Returns:
the newly created and added network connector
Throws:
java.lang.Exception

addProxyConnector

public ProxyConnector addProxyConnector(java.net.URI bindAddress)
                                 throws java.lang.Exception
Adds a new proxy connector using the given bind address

Returns:
the newly created and added network connector
Throws:
java.lang.Exception

addNetworkConnector

public NetworkConnector addNetworkConnector(NetworkConnector connector)
                                     throws java.lang.Exception
Adds a new network connector to connect this broker to a federated network

Throws:
java.lang.Exception

removeNetworkConnector

public boolean removeNetworkConnector(NetworkConnector connector)
Removes the given network connector without stopping it. The caller should call ServiceSupport.stop() to close the connector


addProxyConnector

public ProxyConnector addProxyConnector(ProxyConnector connector)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

addJmsConnector

public JmsConnector addJmsConnector(JmsConnector connector)
                             throws java.lang.Exception
Throws:
java.lang.Exception

removeJmsConnector

public JmsConnector removeJmsConnector(JmsConnector connector)

getMasterConnectorURI

public java.lang.String getMasterConnectorURI()
Returns:
Returns the masterConnectorURI.

setMasterConnectorURI

public void setMasterConnectorURI(java.lang.String masterConnectorURI)
Parameters:
masterConnectorURI - The masterConnectorURI to set.

isSlave

public boolean isSlave()
Returns:
true if this Broker is a slave to a Master

masterFailed

public void masterFailed()

isStarted

public boolean isStarted()

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Service
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Service
Throws:
java.lang.Exception

stopAllConnectors

protected void stopAllConnectors(ServiceStopper stopper)

getBroker

public Broker getBroker()
                 throws java.lang.Exception
Returns the message broker

Throws:
java.lang.Exception

getAdminView

public BrokerView getAdminView()
                        throws java.lang.Exception
Returns the administration view of the broker; used to create and destroy resources such as queues and topics. Note this method returns null if JMX is disabled.

Throws:
java.lang.Exception

setAdminView

public void setAdminView(BrokerView adminView)

getBrokerName

public java.lang.String getBrokerName()

setBrokerName

public void setBrokerName(java.lang.String brokerName)
Sets the name of this broker; which must be unique in the network


getPersistenceFactory

public PersistenceAdapterFactory getPersistenceFactory()

getDataDirectory

public java.io.File getDataDirectory()

setDataDirectory

public void setDataDirectory(java.io.File dataDirectory)
Sets the directory in which the data files will be stored by default for the JDBC and Journal persistence adaptors.

Parameters:
dataDirectory - the directory to store data files

getTmpDataDirectory

public java.io.File getTmpDataDirectory()
Returns:
the tmpDataDirectory

setTmpDataDirectory

public void setTmpDataDirectory(java.io.File tmpDataDirectory)
Parameters:
tmpDataDirectory - the tmpDataDirectory to set

setPersistenceFactory

public void setPersistenceFactory(PersistenceAdapterFactory persistenceFactory)

setDestinationFactory

public void setDestinationFactory(DestinationFactory destinationFactory)

isPersistent

public boolean isPersistent()

setPersistent

public void setPersistent(boolean persistent)
Sets whether or not persistence is enabled or disabled.


isPopulateJMSXUserID

public boolean isPopulateJMSXUserID()

setPopulateJMSXUserID

public void setPopulateJMSXUserID(boolean populateJMSXUserID)
Sets whether or not the broker should populate the JMSXUserID header.


getMemoryManager

public UsageManager getMemoryManager()

setMemoryManager

public void setMemoryManager(UsageManager memoryManager)

getPersistenceAdapter

public PersistenceAdapter getPersistenceAdapter()
                                         throws java.io.IOException
Throws:
java.io.IOException

setPersistenceAdapter

public void setPersistenceAdapter(PersistenceAdapter persistenceAdapter)
Sets the persistence adaptor implementation to use for this broker


getTaskRunnerFactory

public TaskRunnerFactory getTaskRunnerFactory()

setTaskRunnerFactory

public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)

getPersistenceTaskRunnerFactory

public TaskRunnerFactory getPersistenceTaskRunnerFactory()

setPersistenceTaskRunnerFactory

public void setPersistenceTaskRunnerFactory(TaskRunnerFactory persistenceTaskRunnerFactory)

isUseJmx

public boolean isUseJmx()

setUseJmx

public void setUseJmx(boolean useJmx)
Sets whether or not the Broker's services should be exposed into JMX or not.


getBrokerObjectName

public javax.management.ObjectName getBrokerObjectName()
                                                throws java.io.IOException
Throws:
java.io.IOException

setBrokerObjectName

public void setBrokerObjectName(javax.management.ObjectName brokerObjectName)
Sets the JMX ObjectName for this broker


getManagementContext

public ManagementContext getManagementContext()

setManagementContext

public void setManagementContext(ManagementContext managementContext)

getNetworkConnectorURIs

public java.lang.String[] getNetworkConnectorURIs()

setNetworkConnectorURIs

public void setNetworkConnectorURIs(java.lang.String[] networkConnectorURIs)

getTransportConnectorURIs

public java.lang.String[] getTransportConnectorURIs()

setTransportConnectorURIs

public void setTransportConnectorURIs(java.lang.String[] transportConnectorURIs)

getJmsBridgeConnectors

public JmsConnector[] getJmsBridgeConnectors()
Returns:
Returns the jmsBridgeConnectors.

setJmsBridgeConnectors

public void setJmsBridgeConnectors(JmsConnector[] jmsConnectors)
Parameters:
jmsConnectors - The jmsBridgeConnectors to set.

getServices

public Service[] getServices()

setServices

public void setServices(Service[] services)
Sets the services associated with this broker such as a MasterConnector


addService

public void addService(Service service)
Adds a new service so that it will be started as part of the broker lifecycle


isUseLoggingForShutdownErrors

public boolean isUseLoggingForShutdownErrors()

setUseLoggingForShutdownErrors

public void setUseLoggingForShutdownErrors(boolean useLoggingForShutdownErrors)
Sets whether or not we should use commons-logging when reporting errors when shutting down the broker


isUseShutdownHook

public boolean isUseShutdownHook()

setUseShutdownHook

public void setUseShutdownHook(boolean useShutdownHook)
Sets whether or not we should use a shutdown handler to close down the broker cleanly if the JVM is terminated. It is recommended you leave this enabled.


isAdvisorySupport

public boolean isAdvisorySupport()

setAdvisorySupport

public void setAdvisorySupport(boolean advisorySupport)
Allows the support of advisory messages to be disabled for performance reasons.


getTransportConnectors

public java.util.List getTransportConnectors()

setTransportConnectors

public void setTransportConnectors(java.util.List transportConnectors)
                            throws java.lang.Exception
Sets the transport connectors which this broker will listen on for new clients

Throws:
java.lang.Exception

getNetworkConnectors

public java.util.List getNetworkConnectors()

getProxyConnectors

public java.util.List getProxyConnectors()

setNetworkConnectors

public void setNetworkConnectors(java.util.List networkConnectors)
                          throws java.lang.Exception
Sets the network connectors which this broker will use to connect to other brokers in a federated network

Throws:
java.lang.Exception

setProxyConnectors

public void setProxyConnectors(java.util.List proxyConnectors)
                        throws java.lang.Exception
Sets the network connectors which this broker will use to connect to other brokers in a federated network

Throws:
java.lang.Exception

getDestinationPolicy

public PolicyMap getDestinationPolicy()

setDestinationPolicy

public void setDestinationPolicy(PolicyMap policyMap)
Sets the destination specific policies available either for exact destinations or for wildcard areas of destinations.


getPlugins

public BrokerPlugin[] getPlugins()

setPlugins

public void setPlugins(BrokerPlugin[] plugins)
Sets a number of broker plugins to install such as for security authentication or authorization


getMessageAuthorizationPolicy

public MessageAuthorizationPolicy getMessageAuthorizationPolicy()

setMessageAuthorizationPolicy

public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy)
Sets the policy used to decide if the current connection is authorized to consume a given message


deleteAllMessages

public void deleteAllMessages()
                       throws java.io.IOException
Delete all messages from the persistent store

Throws:
java.io.IOException

isDeleteAllMessagesOnStartup

public boolean isDeleteAllMessagesOnStartup()

setDeleteAllMessagesOnStartup

public void setDeleteAllMessagesOnStartup(boolean deletePersistentMessagesOnStartup)
Sets whether or not all messages are deleted on startup - mostly only useful for testing.


getVmConnectorURI

public java.net.URI getVmConnectorURI()

setVmConnectorURI

public void setVmConnectorURI(java.net.URI vmConnectorURI)

isShutdownOnMasterFailure

public boolean isShutdownOnMasterFailure()
Returns:
Returns the shutdownOnMasterFailure.

setShutdownOnMasterFailure

public void setShutdownOnMasterFailure(boolean shutdownOnMasterFailure)
Parameters:
shutdownOnMasterFailure - The shutdownOnMasterFailure to set.

isKeepDurableSubsActive

public boolean isKeepDurableSubsActive()

setKeepDurableSubsActive

public void setKeepDurableSubsActive(boolean keepDurableSubsActive)

isUseVirtualTopics

public boolean isUseVirtualTopics()

setUseVirtualTopics

public void setUseVirtualTopics(boolean useVirtualTopics)
Sets whether or not Virtual Topics should be supported by default if they have not been explicitly configured.


getDestinationInterceptors

public DestinationInterceptor[] getDestinationInterceptors()

setDestinationInterceptors

public void setDestinationInterceptors(DestinationInterceptor[] destinationInterceptors)
Sets the destination interceptors to use


getDestinations

public ActiveMQDestination[] getDestinations()

setDestinations

public void setDestinations(ActiveMQDestination[] destinations)
Sets the destinations which should be loaded/created on startup


getTempDataStore

public Store getTempDataStore()
Returns:
the tempDataStore

setTempDataStore

public void setTempDataStore(Store tempDataStore)
Parameters:
tempDataStore - the tempDataStore to set

getPersistenceThreadPriority

public int getPersistenceThreadPriority()

setPersistenceThreadPriority

public void setPersistenceThreadPriority(int persistenceThreadPriority)

getPendingDurableSubscriberPolicy

public PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy()
Returns:
the pendingDurableSubscriberPolicy

setPendingDurableSubscriberPolicy

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

processHelperProperties

protected void processHelperProperties()
                                throws java.lang.Exception
Handles any lazy-creation helper properties which are added to make things easier to configure inside environments such as Spring

Throws:
java.lang.Exception

registerConnectorMBean

protected TransportConnector registerConnectorMBean(TransportConnector connector)
                                             throws java.io.IOException
Throws:
java.io.IOException

unregisterConnectorMBean

protected void unregisterConnectorMBean(TransportConnector connector)
                                 throws java.io.IOException
Throws:
java.io.IOException

registerNetworkConnectorMBean

protected void registerNetworkConnectorMBean(NetworkConnector connector)
                                      throws java.io.IOException
Throws:
java.io.IOException

createNetworkConnectorObjectName

protected javax.management.ObjectName createNetworkConnectorObjectName(NetworkConnector connector)
                                                                throws javax.management.MalformedObjectNameException
Throws:
javax.management.MalformedObjectNameException

unregisterNetworkConnectorMBean

protected void unregisterNetworkConnectorMBean(NetworkConnector connector)

registerProxyConnectorMBean

protected void registerProxyConnectorMBean(ProxyConnector connector)
                                    throws java.io.IOException
Throws:
java.io.IOException

registerFTConnectorMBean

protected void registerFTConnectorMBean(MasterConnector connector)
                                 throws java.io.IOException
Throws:
java.io.IOException

registerJmsConnectorMBean

protected void registerJmsConnectorMBean(JmsConnector connector)
                                  throws java.io.IOException
Throws:
java.io.IOException

createBroker

protected Broker createBroker()
                       throws java.lang.Exception
Factory method to create a new broker

Throws:
java.lang.Exception

createRegionBroker

protected Broker createRegionBroker()
                             throws java.lang.Exception
Factory method to create the core region broker onto which interceptors are added

Throws:
java.lang.Exception

createDefaultDestinationInterceptor

protected DestinationInterceptor createDefaultDestinationInterceptor()
Create the default destination interceptor


addInterceptors

protected Broker addInterceptors(Broker broker)
                          throws java.lang.Exception
Strategy method to add interceptors to the broker

Throws:
java.io.IOException
java.lang.Exception

createPersistenceAdapter

protected PersistenceAdapter createPersistenceAdapter()
                                               throws java.io.IOException
Throws:
java.io.IOException

createPersistenceFactory

protected DefaultPersistenceAdapterFactory createPersistenceFactory()

createBrokerObjectName

protected javax.management.ObjectName createBrokerObjectName()
                                                      throws java.io.IOException
Throws:
java.io.IOException

createTransportConnector

protected TransportConnector createTransportConnector(Broker broker,
                                                      java.net.URI brokerURI)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

getPort

protected java.lang.Object getPort(java.util.Map options)
Extracts the port from the options


addShutdownHook

protected void addShutdownHook()

removeShutdownHook

protected void removeShutdownHook()

containerShutdown

protected void containerShutdown()
Causes a clean shutdown of the container when the VM is being shut down


logError

protected void logError(java.lang.String message,
                        java.lang.Throwable e)

startDestinations

protected void startDestinations()
                          throws java.lang.Exception
Starts any configured destinations on startup

Throws:
java.lang.Exception

getAdminConnectionContext

public ConnectionContext getAdminConnectionContext()
                                            throws java.lang.Exception
Returns the broker's administration connection context used for configuring the broker at startup

Throws:
java.lang.Exception

createAdminConnectionContext

protected ConnectionContext createAdminConnectionContext()
                                                  throws java.lang.Exception
Factory method to create the new administration connection context object. Note this method is here rather than inside a default broker implementation to ensure that the broker reference inside it is the outer most interceptor

Throws:
java.lang.Exception

startAllConnectors

protected void startAllConnectors()
                           throws java.lang.Exception
Start all transport and network connections, proxies and bridges

Throws:
java.lang.Exception

startTransportConnector

protected TransportConnector startTransportConnector(TransportConnector connector)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

configureService

protected void configureService(java.lang.Object service)
Perform any custom dependency injection


startDestinationsInPersistenceStore

protected void startDestinationsInPersistenceStore(Broker broker)
                                            throws java.lang.Exception
Starts all destiantions in persistence store. This includes all inactive destinations

Throws:
java.lang.Exception


Copyright © 2011 Apache Software Foundation. All Rights Reserved.