org.apache.activemq.broker
Class BrokerService

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

public class BrokerService
extends Object
implements Service

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 $

Field Summary
static String DEFAULT_BROKER_NAME
           
static String DEFAULT_PORT
           
protected  DestinationFactory destinationFactory
           
static String LOCAL_HOST_NAME
           
protected  CountDownLatch slaveStartSignal
           
 
Constructor Summary
BrokerService()
           
 
Method Summary
 TransportConnector addConnector(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(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(String discoveryAddress)
          Adds a new network connector using the given discovery address
 NetworkConnector addNetworkConnector(URI discoveryAddress)
          Adds a new network connector using the given discovery address
 ProxyConnector addProxyConnector(ProxyConnector connector)
           
 ProxyConnector addProxyConnector(String bindAddress)
          Adds a new proxy connector using the given bind address
 ProxyConnector addProxyConnector(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()
           
 void addShutdownHook(Runnable hook)
           
protected  void configureService(Object service)
          Perform any custom dependency injection
protected  void configureServices(Object[] services)
          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  ObjectName createBrokerObjectName()
           
protected  DestinationInterceptor[] createDefaultDestinationInterceptor()
          Create the default destination interceptor
protected  ObjectName createNetworkConnectorObjectName(NetworkConnector connector)
           
protected  PersistenceAdapter createPersistenceAdapter()
           
protected  AMQPersistenceAdapterFactory createPersistenceFactory()
           
protected  Broker createRegionBroker()
          Factory method to create the core region broker onto which interceptors are added
protected  Broker createRegionBroker(DestinationInterceptor destinationInterceptor)
           
protected  TransportConnector createTransportConnector(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
 File getBrokerDataDirectory()
           
 String getBrokerName()
           
 ObjectName getBrokerObjectName()
           
 TransportConnector getConnectorByName(String connectorName)
           
 SystemUsage getConsumerSystemUsage()
           
 int getConsumerSystemUsagePortion()
           
 File getDataDirectoryFile()
           
 Destination getDestination(ActiveMQDestination destination)
          Looks up and lazily creates if necessary the destination for the given JMS name
 DestinationInterceptor[] getDestinationInterceptors()
           
 PolicyMap getDestinationPolicy()
           
 ActiveMQDestination[] getDestinations()
           
 JmsConnector[] getJmsBridgeConnectors()
           
 ManagementContext getManagementContext()
           
 String getMasterConnectorURI()
           
 MessageAuthorizationPolicy getMessageAuthorizationPolicy()
           
 NetworkConnector getNetworkConnectorByName(String connectorName)
           
 List<NetworkConnector> getNetworkConnectors()
           
 String[] getNetworkConnectorURIs()
           
 PersistenceAdapter getPersistenceAdapter()
           
 PersistenceAdapterFactory getPersistenceFactory()
           
 TaskRunnerFactory getPersistenceTaskRunnerFactory()
           
 int getPersistenceThreadPriority()
           
 BrokerPlugin[] getPlugins()
           
protected  Object getPort(Map options)
          Extracts the port from the options
 SystemUsage getProducerSystemUsage()
           
 int getProducerSystemUsagePortion()
           
 List<ProxyConnector> getProxyConnectors()
           
 Broker getRegionBroker()
           
 Service[] getServices()
           
 CountDownLatch getSlaveStartSignal()
           
 SslContext getSslContext()
           
 int getSystemExitOnShutdownExitCode()
           
 SystemUsage getSystemUsage()
           
 TaskRunnerFactory getTaskRunnerFactory()
           
 int getTaskRunnerPriority()
           
 Store getTempDataStore()
           
 int getTimeBeforePurgeTempDestinations()
           
 File getTmpDataDirectory()
           
 List<TransportConnector> getTransportConnectors()
           
 String[] getTransportConnectorURIs()
           
 URI getVmConnectorURI()
           
 boolean isAdvisorySupport()
           
 boolean isCacheTempDestinations()
           
 boolean isDedicatedTaskRunner()
           
 boolean isDeleteAllMessagesOnStartup()
           
 boolean isEnableStatistics()
           
 boolean isKeepDurableSubsActive()
           
 boolean isMonitorConnectionSplits()
           
 boolean isPersistent()
           
 boolean isPopulateJMSXUserID()
           
 boolean isShutdownOnMasterFailure()
           
 boolean isShutdownOnSlaveFailure()
           
 boolean isSlave()
           
 boolean isSplitSystemUsageForProducersConsumers()
           
 boolean isStarted()
           
 boolean isSupportFailOver()
           
 boolean isSystemExitOnShutdown()
           
 boolean isUseJmx()
           
 boolean isUseLocalHostBrokerName()
           
 boolean isUseLoggingForShutdownErrors()
           
 boolean isUseMirroredQueues()
           
 boolean isUseShutdownHook()
           
 boolean isUseTempMirroredQueues()
           
 boolean isUseVirtualTopics()
           
 boolean isWaitForSlave()
           
protected  void logError(String message, 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  PersistenceAdapter registerPersistenceAdapterMBean(PersistenceAdapter adaptor)
           
protected  void registerProxyConnectorMBean(ProxyConnector connector)
           
 boolean removeConnector(TransportConnector connector)
          Stops and removes a transport connector from the broker.
 void removeDestination(ActiveMQDestination destination)
           
 JmsConnector removeJmsConnector(JmsConnector connector)
           
 boolean removeNetworkConnector(NetworkConnector connector)
          Removes the given network connector without stopping it.
 void removeService(Service service)
           
protected  void removeShutdownHook()
           
 void removeShutdownHook(Runnable hook)
           
 void setAdminView(BrokerView adminView)
           
 void setAdvisorySupport(boolean advisorySupport)
          Allows the support of advisory messages to be disabled for performance reasons.
 void setBrokerName(String brokerName)
          Sets the name of this broker; which must be unique in the network
 void setBrokerObjectName(ObjectName brokerObjectName)
          Sets the JMX ObjectName for this broker
 void setCacheTempDestinations(boolean cacheTempDestinations)
           
 void setConsumerSystemUsage(SystemUsage consumerSystemUsaage)
           
 void setConsumerSystemUsagePortion(int consumerSystemUsagePortion)
           
 void setDataDirectory(String dataDirectory)
          Sets the directory in which the data files will be stored by default for the JDBC and Journal persistence adaptors.
 void setDataDirectoryFile(File dataDirectoryFile)
          Sets the directory in which the data files will be stored by default for the JDBC and Journal persistence adaptors.
 void setDedicatedTaskRunner(boolean dedicatedTaskRunner)
           
 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 setEnableStatistics(boolean enableStatistics)
          Sets whether or not the Broker's services enable statistics or not.
 void setJmsBridgeConnectors(JmsConnector[] jmsConnectors)
           
 void setKeepDurableSubsActive(boolean keepDurableSubsActive)
           
 void setManagementContext(ManagementContext managementContext)
           
 void setMasterConnectorURI(String masterConnectorURI)
           
 void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy)
          Sets the policy used to decide if the current connection is authorized to consume a given message
 void setMonitorConnectionSplits(boolean monitorConnectionSplits)
           
 void setNetworkConnectors(List networkConnectors)
          Sets the network connectors which this broker will use to connect to other brokers in a federated network
 void setNetworkConnectorURIs(String[] networkConnectorURIs)
           
 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 setProducerSystemUsage(SystemUsage producerUsageManager)
           
 void setProducerSystemUsagePortion(int producerSystemUsagePortion)
           
 void setProxyConnectors(List proxyConnectors)
          Sets the network connectors which this broker will use to connect to other brokers in a federated network
 void setRegionBroker(Broker regionBroker)
           
 void setServices(Service[] services)
          Sets the services associated with this broker such as a MasterConnector
 void setShutdownOnMasterFailure(boolean shutdownOnMasterFailure)
           
 void setShutdownOnSlaveFailure(boolean shutdownOnSlaveFailure)
           
 void setSplitSystemUsageForProducersConsumers(boolean splitSystemUsageForProducersConsumers)
           
 void setSslContext(SslContext sslContext)
           
 void setSupportFailOver(boolean supportFailOver)
           
 void setSystemExitOnShutdown(boolean systemExitOnShutdown)
           
 void setSystemExitOnShutdownExitCode(int systemExitOnShutdownExitCode)
           
 void setSystemUsage(SystemUsage memoryManager)
           
 void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
           
 void setTaskRunnerPriority(int taskRunnerPriority)
           
 void setTempDataStore(Store tempDataStore)
           
 void setTimeBeforePurgeTempDestinations(int timeBeforePurgeTempDestinations)
           
 void setTmpDataDirectory(File tmpDataDirectory)
           
 void setTransportConnectors(List<TransportConnector> transportConnectors)
          Sets the transport connectors which this broker will listen on for new clients
 void setTransportConnectorURIs(String[] transportConnectorURIs)
           
 void setUseJmx(boolean useJmx)
          Sets whether or not the Broker's services should be exposed into JMX or not.
 void setUseLocalHostBrokerName(boolean useLocalHostBrokerName)
           
 void setUseLoggingForShutdownErrors(boolean useLoggingForShutdownErrors)
          Sets whether or not we should use commons-logging when reporting errors when shutting down the broker
 void setUseMirroredQueues(boolean useMirroredQueues)
          Sets whether or not Mirrored Queues should be supported by default if they have not been explicitly configured.
 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 setUseTempMirroredQueues(boolean useTempMirroredQueues)
           
 void setUseVirtualTopics(boolean useVirtualTopics)
          Sets whether or not Virtual Topics should be supported by default if they have not been explicitly configured.
 void setVmConnectorURI(URI vmConnectorURI)
           
 void setWaitForSlave(boolean waitForSlave)
           
protected  void slaveConnectionEstablished()
           
 void start()
           
 void start(boolean force)
           
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)
           
 String toString()
           
protected  void unregisterConnectorMBean(TransportConnector connector)
           
protected  void unregisterNetworkConnectorMBean(NetworkConnector connector)
           
protected  void unregisterPersistenceAdapterMBean(PersistenceAdapter adaptor)
           
protected  void waitForSlave()
           
 void waitUntilStarted()
          A helper method to block the caller thread until the broker has been started
 void waitUntilStopped()
          A helper method to block the caller thread until the broker has been stopped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

slaveStartSignal

protected CountDownLatch slaveStartSignal

DEFAULT_PORT

public static final String DEFAULT_PORT
See Also:
Constant Field Values

LOCAL_HOST_NAME

public static final String LOCAL_HOST_NAME

DEFAULT_BROKER_NAME

public static final String DEFAULT_BROKER_NAME
See Also:
Constant Field Values

destinationFactory

protected DestinationFactory destinationFactory
Constructor Detail

BrokerService

public BrokerService()
Method Detail

toString

public String toString()
Overrides:
toString in class Object

addConnector

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

Returns:
the newly created and added transport connector
Throws:
Exception

addConnector

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

Returns:
the newly created and added transport connector
Throws:
Exception

addConnector

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

Returns:
the newly created and added transport connector
Throws:
Exception

addConnector

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

Returns:
the transport connector
Throws:
Exception

removeConnector

public boolean removeConnector(TransportConnector connector)
                        throws 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:
Exception

addNetworkConnector

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

Returns:
the newly created and added network connector
Throws:
Exception

addProxyConnector

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

Returns:
the newly created and added network connector
Throws:
Exception

addNetworkConnector

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

Returns:
the newly created and added network connector
Throws:
Exception

addProxyConnector

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

Returns:
the newly created and added network connector
Throws:
Exception

addNetworkConnector

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

Throws:
Exception

removeNetworkConnector

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


addProxyConnector

public ProxyConnector addProxyConnector(ProxyConnector connector)
                                 throws Exception
Throws:
Exception

addJmsConnector

public JmsConnector addJmsConnector(JmsConnector connector)
                             throws Exception
Throws:
Exception

removeJmsConnector

public JmsConnector removeJmsConnector(JmsConnector connector)

getMasterConnectorURI

public String getMasterConnectorURI()
Returns:
Returns the masterConnectorURI.

setMasterConnectorURI

public void setMasterConnectorURI(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(boolean force)
           throws Exception
Throws:
Exception

start

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

stop

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

waitUntilStopped

public void waitUntilStopped()
A helper method to block the caller thread until the broker has been stopped


waitUntilStarted

public void waitUntilStarted()
A helper method to block the caller thread until the broker has been started


getBroker

public Broker getBroker()
                 throws Exception
Returns the message broker

Throws:
Exception

getAdminView

public BrokerView getAdminView()
                        throws 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:
Exception

setAdminView

public void setAdminView(BrokerView adminView)

getBrokerName

public String getBrokerName()

setBrokerName

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

Parameters:
brokerName -

getPersistenceFactory

public PersistenceAdapterFactory getPersistenceFactory()

getDataDirectoryFile

public File getDataDirectoryFile()

getBrokerDataDirectory

public File getBrokerDataDirectory()

setDataDirectory

public void setDataDirectory(String 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

setDataDirectoryFile

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

Parameters:
dataDirectoryFile - the directory to store data files

getTmpDataDirectory

public File getTmpDataDirectory()
Returns:
the tmpDataDirectory

setTmpDataDirectory

public void setTmpDataDirectory(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.


getSystemUsage

public SystemUsage getSystemUsage()

setSystemUsage

public void setSystemUsage(SystemUsage memoryManager)

getConsumerSystemUsage

public SystemUsage getConsumerSystemUsage()
                                   throws IOException
Returns:
the consumerUsageManager
Throws:
IOException

setConsumerSystemUsage

public void setConsumerSystemUsage(SystemUsage consumerSystemUsaage)
Parameters:
consumerSystemUsaage - the storeSystemUsage to set

getProducerSystemUsage

public SystemUsage getProducerSystemUsage()
                                   throws IOException
Returns:
the producerUsageManager
Throws:
IOException

setProducerSystemUsage

public void setProducerSystemUsage(SystemUsage producerUsageManager)
Parameters:
producerUsageManager - the producerUsageManager to set

getPersistenceAdapter

public PersistenceAdapter getPersistenceAdapter()
                                         throws IOException
Throws:
IOException

setPersistenceAdapter

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

Throws:
IOException

getTaskRunnerFactory

public TaskRunnerFactory getTaskRunnerFactory()

setTaskRunnerFactory

public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)

getPersistenceTaskRunnerFactory

public TaskRunnerFactory getPersistenceTaskRunnerFactory()

setPersistenceTaskRunnerFactory

public void setPersistenceTaskRunnerFactory(TaskRunnerFactory persistenceTaskRunnerFactory)

isUseJmx

public boolean isUseJmx()

isEnableStatistics

public boolean isEnableStatistics()

setEnableStatistics

public void setEnableStatistics(boolean enableStatistics)
Sets whether or not the Broker's services enable statistics or not.


setUseJmx

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


getBrokerObjectName

public ObjectName getBrokerObjectName()
                               throws IOException
Throws:
IOException

setBrokerObjectName

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


getManagementContext

public ManagementContext getManagementContext()

setManagementContext

public void setManagementContext(ManagementContext managementContext)

getNetworkConnectorByName

public NetworkConnector getNetworkConnectorByName(String connectorName)

getNetworkConnectorURIs

public String[] getNetworkConnectorURIs()

setNetworkConnectorURIs

public void setNetworkConnectorURIs(String[] networkConnectorURIs)

getConnectorByName

public TransportConnector getConnectorByName(String connectorName)

getTransportConnectorURIs

public String[] getTransportConnectorURIs()

setTransportConnectorURIs

public void setTransportConnectorURIs(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


removeService

public void removeService(Service service)

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 List<TransportConnector> getTransportConnectors()

setTransportConnectors

public void setTransportConnectors(List<TransportConnector> transportConnectors)
                            throws Exception
Sets the transport connectors which this broker will listen on for new clients

Throws:
Exception

getNetworkConnectors

public List<NetworkConnector> getNetworkConnectors()

getProxyConnectors

public List<ProxyConnector> getProxyConnectors()

setNetworkConnectors

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

Throws:
Exception

setProxyConnectors

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

Throws:
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 IOException
Delete all messages from the persistent store

Throws:
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 URI getVmConnectorURI()

setVmConnectorURI

public void setVmConnectorURI(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()

isUseMirroredQueues

public boolean isUseMirroredQueues()

setUseMirroredQueues

public void setUseMirroredQueues(boolean useMirroredQueues)
Sets whether or not Mirrored Queues should be supported by default if they have not been explicitly configured.


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)

isUseLocalHostBrokerName

public boolean isUseLocalHostBrokerName()
Returns:
the useLocalHostBrokerName

setUseLocalHostBrokerName

public void setUseLocalHostBrokerName(boolean useLocalHostBrokerName)
Parameters:
useLocalHostBrokerName - the useLocalHostBrokerName to set

isSupportFailOver

public boolean isSupportFailOver()
Returns:
the supportFailOver

setSupportFailOver

public void setSupportFailOver(boolean supportFailOver)
Parameters:
supportFailOver - the supportFailOver to set

getDestination

public Destination getDestination(ActiveMQDestination destination)
                           throws Exception
Looks up and lazily creates if necessary the destination for the given JMS name

Throws:
Exception

removeDestination

public void removeDestination(ActiveMQDestination destination)
                       throws Exception
Throws:
Exception

getProducerSystemUsagePortion

public int getProducerSystemUsagePortion()

setProducerSystemUsagePortion

public void setProducerSystemUsagePortion(int producerSystemUsagePortion)

getConsumerSystemUsagePortion

public int getConsumerSystemUsagePortion()

setConsumerSystemUsagePortion

public void setConsumerSystemUsagePortion(int consumerSystemUsagePortion)

isSplitSystemUsageForProducersConsumers

public boolean isSplitSystemUsageForProducersConsumers()

setSplitSystemUsageForProducersConsumers

public void setSplitSystemUsageForProducersConsumers(boolean splitSystemUsageForProducersConsumers)

isMonitorConnectionSplits

public boolean isMonitorConnectionSplits()

setMonitorConnectionSplits

public void setMonitorConnectionSplits(boolean monitorConnectionSplits)

getTaskRunnerPriority

public int getTaskRunnerPriority()

setTaskRunnerPriority

public void setTaskRunnerPriority(int taskRunnerPriority)

isDedicatedTaskRunner

public boolean isDedicatedTaskRunner()

setDedicatedTaskRunner

public void setDedicatedTaskRunner(boolean dedicatedTaskRunner)

isCacheTempDestinations

public boolean isCacheTempDestinations()

setCacheTempDestinations

public void setCacheTempDestinations(boolean cacheTempDestinations)

getTimeBeforePurgeTempDestinations

public int getTimeBeforePurgeTempDestinations()

setTimeBeforePurgeTempDestinations

public void setTimeBeforePurgeTempDestinations(int timeBeforePurgeTempDestinations)

isUseTempMirroredQueues

public boolean isUseTempMirroredQueues()

setUseTempMirroredQueues

public void setUseTempMirroredQueues(boolean useTempMirroredQueues)

processHelperProperties

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

Throws:
Exception

stopAllConnectors

protected void stopAllConnectors(ServiceStopper stopper)

registerConnectorMBean

protected TransportConnector registerConnectorMBean(TransportConnector connector)
                                             throws IOException
Throws:
IOException

unregisterConnectorMBean

protected void unregisterConnectorMBean(TransportConnector connector)
                                 throws IOException
Throws:
IOException

registerPersistenceAdapterMBean

protected PersistenceAdapter registerPersistenceAdapterMBean(PersistenceAdapter adaptor)
                                                      throws IOException
Throws:
IOException

unregisterPersistenceAdapterMBean

protected void unregisterPersistenceAdapterMBean(PersistenceAdapter adaptor)
                                          throws IOException
Throws:
IOException

registerNetworkConnectorMBean

protected void registerNetworkConnectorMBean(NetworkConnector connector)
                                      throws IOException
Throws:
IOException

createNetworkConnectorObjectName

protected ObjectName createNetworkConnectorObjectName(NetworkConnector connector)
                                               throws MalformedObjectNameException
Throws:
MalformedObjectNameException

unregisterNetworkConnectorMBean

protected void unregisterNetworkConnectorMBean(NetworkConnector connector)

registerProxyConnectorMBean

protected void registerProxyConnectorMBean(ProxyConnector connector)
                                    throws IOException
Throws:
IOException

registerFTConnectorMBean

protected void registerFTConnectorMBean(MasterConnector connector)
                                 throws IOException
Throws:
IOException

registerJmsConnectorMBean

protected void registerJmsConnectorMBean(JmsConnector connector)
                                  throws IOException
Throws:
IOException

createBroker

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

Throws:
Exception

createRegionBroker

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

Throws:
Exception

createRegionBroker

protected Broker createRegionBroker(DestinationInterceptor destinationInterceptor)
                             throws IOException
Throws:
IOException

createDefaultDestinationInterceptor

protected DestinationInterceptor[] createDefaultDestinationInterceptor()
Create the default destination interceptor


addInterceptors

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

Throws:
IOException
Exception

createPersistenceAdapter

protected PersistenceAdapter createPersistenceAdapter()
                                               throws IOException
Throws:
IOException

createPersistenceFactory

protected AMQPersistenceAdapterFactory createPersistenceFactory()

createBrokerObjectName

protected ObjectName createBrokerObjectName()
                                     throws IOException
Throws:
IOException

createTransportConnector

protected TransportConnector createTransportConnector(URI brokerURI)
                                               throws Exception
Throws:
Exception

getPort

protected Object getPort(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(String message,
                        Throwable e)

startDestinations

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

Throws:
Exception

getAdminConnectionContext

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

Throws:
Exception

createAdminConnectionContext

protected ConnectionContext createAdminConnectionContext()
                                                  throws 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:
Exception

waitForSlave

protected void waitForSlave()

slaveConnectionEstablished

protected void slaveConnectionEstablished()

startAllConnectors

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

Throws:
Exception

startTransportConnector

protected TransportConnector startTransportConnector(TransportConnector connector)
                                              throws Exception
Throws:
Exception

configureServices

protected void configureServices(Object[] services)
Perform any custom dependency injection


configureService

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


startDestinationsInPersistenceStore

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

Throws:
Exception

getRegionBroker

public Broker getRegionBroker()

setRegionBroker

public void setRegionBroker(Broker regionBroker)

addShutdownHook

public void addShutdownHook(Runnable hook)

removeShutdownHook

public void removeShutdownHook(Runnable hook)

isSystemExitOnShutdown

public boolean isSystemExitOnShutdown()

setSystemExitOnShutdown

public void setSystemExitOnShutdown(boolean systemExitOnShutdown)

getSystemExitOnShutdownExitCode

public int getSystemExitOnShutdownExitCode()

setSystemExitOnShutdownExitCode

public void setSystemExitOnShutdownExitCode(int systemExitOnShutdownExitCode)

getSslContext

public SslContext getSslContext()

setSslContext

public void setSslContext(SslContext sslContext)

isShutdownOnSlaveFailure

public boolean isShutdownOnSlaveFailure()

setShutdownOnSlaveFailure

public void setShutdownOnSlaveFailure(boolean shutdownOnSlaveFailure)

isWaitForSlave

public boolean isWaitForSlave()

setWaitForSlave

public void setWaitForSlave(boolean waitForSlave)

getSlaveStartSignal

public CountDownLatch getSlaveStartSignal()


Copyright © 2009. All Rights Reserved.