|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.broker.BrokerService
public class BrokerService
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.
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 |
---|
public static final java.lang.String DEFAULT_PORT
Constructor Detail |
---|
public BrokerService()
Method Detail |
---|
public TransportConnector addConnector(java.lang.String bindAddress) throws java.lang.Exception
java.lang.Exception
public TransportConnector addConnector(java.net.URI bindAddress) throws java.lang.Exception
java.lang.Exception
public TransportConnector addConnector(TransportServer transport) throws java.lang.Exception
java.lang.Exception
public TransportConnector addConnector(TransportConnector connector) throws java.lang.Exception
java.lang.Exception
public boolean removeConnector(TransportConnector connector) throws java.lang.Exception
connector
-
java.lang.Exception
public NetworkConnector addNetworkConnector(java.lang.String discoveryAddress) throws java.lang.Exception
java.lang.Exception
public ProxyConnector addProxyConnector(java.lang.String bindAddress) throws java.lang.Exception
java.lang.Exception
public NetworkConnector addNetworkConnector(java.net.URI discoveryAddress) throws java.lang.Exception
java.lang.Exception
public ProxyConnector addProxyConnector(java.net.URI bindAddress) throws java.lang.Exception
java.lang.Exception
public NetworkConnector addNetworkConnector(NetworkConnector connector) throws java.lang.Exception
java.lang.Exception
public boolean removeNetworkConnector(NetworkConnector connector)
ServiceSupport.stop()
to close the connector
public ProxyConnector addProxyConnector(ProxyConnector connector) throws java.lang.Exception
java.lang.Exception
public JmsConnector addJmsConnector(JmsConnector connector) throws java.lang.Exception
java.lang.Exception
public JmsConnector removeJmsConnector(JmsConnector connector)
public java.lang.String getMasterConnectorURI()
public void setMasterConnectorURI(java.lang.String masterConnectorURI)
masterConnectorURI
- The masterConnectorURI to set.public boolean isSlave()
public void masterFailed()
public boolean isStarted()
public void start() throws java.lang.Exception
start
in interface Service
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface Service
java.lang.Exception
protected void stopAllConnectors(ServiceStopper stopper)
public Broker getBroker() throws java.lang.Exception
java.lang.Exception
public BrokerView getAdminView() throws java.lang.Exception
java.lang.Exception
public void setAdminView(BrokerView adminView)
public java.lang.String getBrokerName()
public void setBrokerName(java.lang.String brokerName)
public PersistenceAdapterFactory getPersistenceFactory()
public java.io.File getDataDirectory()
public void setDataDirectory(java.io.File dataDirectory)
dataDirectory
- the directory to store data filespublic java.io.File getTmpDataDirectory()
public void setTmpDataDirectory(java.io.File tmpDataDirectory)
tmpDataDirectory
- the tmpDataDirectory to setpublic void setPersistenceFactory(PersistenceAdapterFactory persistenceFactory)
public void setDestinationFactory(DestinationFactory destinationFactory)
public boolean isPersistent()
public void setPersistent(boolean persistent)
public boolean isPopulateJMSXUserID()
public void setPopulateJMSXUserID(boolean populateJMSXUserID)
public UsageManager getMemoryManager()
public void setMemoryManager(UsageManager memoryManager)
public PersistenceAdapter getPersistenceAdapter() throws java.io.IOException
java.io.IOException
public void setPersistenceAdapter(PersistenceAdapter persistenceAdapter)
public TaskRunnerFactory getTaskRunnerFactory()
public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
public TaskRunnerFactory getPersistenceTaskRunnerFactory()
public void setPersistenceTaskRunnerFactory(TaskRunnerFactory persistenceTaskRunnerFactory)
public boolean isUseJmx()
public void setUseJmx(boolean useJmx)
public javax.management.ObjectName getBrokerObjectName() throws java.io.IOException
java.io.IOException
public void setBrokerObjectName(javax.management.ObjectName brokerObjectName)
public ManagementContext getManagementContext()
public void setManagementContext(ManagementContext managementContext)
public java.lang.String[] getNetworkConnectorURIs()
public void setNetworkConnectorURIs(java.lang.String[] networkConnectorURIs)
public java.lang.String[] getTransportConnectorURIs()
public void setTransportConnectorURIs(java.lang.String[] transportConnectorURIs)
public JmsConnector[] getJmsBridgeConnectors()
public void setJmsBridgeConnectors(JmsConnector[] jmsConnectors)
jmsConnectors
- The jmsBridgeConnectors to set.public Service[] getServices()
public void setServices(Service[] services)
MasterConnector
public void addService(Service service)
public boolean isUseLoggingForShutdownErrors()
public void setUseLoggingForShutdownErrors(boolean useLoggingForShutdownErrors)
public boolean isUseShutdownHook()
public void setUseShutdownHook(boolean useShutdownHook)
public boolean isAdvisorySupport()
public void setAdvisorySupport(boolean advisorySupport)
public java.util.List getTransportConnectors()
public void setTransportConnectors(java.util.List transportConnectors) throws java.lang.Exception
java.lang.Exception
public java.util.List getNetworkConnectors()
public java.util.List getProxyConnectors()
public void setNetworkConnectors(java.util.List networkConnectors) throws java.lang.Exception
java.lang.Exception
public void setProxyConnectors(java.util.List proxyConnectors) throws java.lang.Exception
java.lang.Exception
public PolicyMap getDestinationPolicy()
public void setDestinationPolicy(PolicyMap policyMap)
public BrokerPlugin[] getPlugins()
public void setPlugins(BrokerPlugin[] plugins)
public MessageAuthorizationPolicy getMessageAuthorizationPolicy()
public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy)
public void deleteAllMessages() throws java.io.IOException
java.io.IOException
public boolean isDeleteAllMessagesOnStartup()
public void setDeleteAllMessagesOnStartup(boolean deletePersistentMessagesOnStartup)
public java.net.URI getVmConnectorURI()
public void setVmConnectorURI(java.net.URI vmConnectorURI)
public boolean isShutdownOnMasterFailure()
public void setShutdownOnMasterFailure(boolean shutdownOnMasterFailure)
shutdownOnMasterFailure
- The shutdownOnMasterFailure to set.public boolean isKeepDurableSubsActive()
public void setKeepDurableSubsActive(boolean keepDurableSubsActive)
public boolean isUseVirtualTopics()
public void setUseVirtualTopics(boolean useVirtualTopics)
public DestinationInterceptor[] getDestinationInterceptors()
public void setDestinationInterceptors(DestinationInterceptor[] destinationInterceptors)
public ActiveMQDestination[] getDestinations()
public void setDestinations(ActiveMQDestination[] destinations)
public Store getTempDataStore()
public void setTempDataStore(Store tempDataStore)
tempDataStore
- the tempDataStore to setpublic int getPersistenceThreadPriority()
public void setPersistenceThreadPriority(int persistenceThreadPriority)
public PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy()
public void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy)
pendingDurableSubscriberPolicy
- the pendingDurableSubscriberPolicy to setprotected void processHelperProperties() throws java.lang.Exception
java.lang.Exception
protected TransportConnector registerConnectorMBean(TransportConnector connector) throws java.io.IOException
java.io.IOException
protected void unregisterConnectorMBean(TransportConnector connector) throws java.io.IOException
java.io.IOException
protected void registerNetworkConnectorMBean(NetworkConnector connector) throws java.io.IOException
java.io.IOException
protected javax.management.ObjectName createNetworkConnectorObjectName(NetworkConnector connector) throws javax.management.MalformedObjectNameException
javax.management.MalformedObjectNameException
protected void unregisterNetworkConnectorMBean(NetworkConnector connector)
protected void registerProxyConnectorMBean(ProxyConnector connector) throws java.io.IOException
java.io.IOException
protected void registerFTConnectorMBean(MasterConnector connector) throws java.io.IOException
java.io.IOException
protected void registerJmsConnectorMBean(JmsConnector connector) throws java.io.IOException
java.io.IOException
protected Broker createBroker() throws java.lang.Exception
java.lang.Exception
protected Broker createRegionBroker() throws java.lang.Exception
java.lang.Exception
protected DestinationInterceptor createDefaultDestinationInterceptor()
protected Broker addInterceptors(Broker broker) throws java.lang.Exception
java.io.IOException
java.lang.Exception
protected PersistenceAdapter createPersistenceAdapter() throws java.io.IOException
java.io.IOException
protected DefaultPersistenceAdapterFactory createPersistenceFactory()
protected javax.management.ObjectName createBrokerObjectName() throws java.io.IOException
java.io.IOException
protected TransportConnector createTransportConnector(Broker broker, java.net.URI brokerURI) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object getPort(java.util.Map options)
protected void addShutdownHook()
protected void removeShutdownHook()
protected void containerShutdown()
protected void logError(java.lang.String message, java.lang.Throwable e)
protected void startDestinations() throws java.lang.Exception
java.lang.Exception
public ConnectionContext getAdminConnectionContext() throws java.lang.Exception
java.lang.Exception
protected ConnectionContext createAdminConnectionContext() throws java.lang.Exception
java.lang.Exception
protected void startAllConnectors() throws java.lang.Exception
java.lang.Exception
protected TransportConnector startTransportConnector(TransportConnector connector) throws java.lang.Exception
java.lang.Exception
protected void configureService(java.lang.Object service)
protected void startDestinationsInPersistenceStore(Broker broker) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |