Package org.apache.activemq.broker
Class BrokerService
- java.lang.Object
-
- org.apache.activemq.broker.BrokerService
-
- All Implemented Interfaces:
Service
- Direct Known Subclasses:
SslBrokerService,XBeanBrokerService
public class BrokerService extends Object implements Service
Manages the life-cycle 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
Fields Modifier and Type Field Description static StringBROKER_VERSIONstatic StringDEFAULT_BROKER_NAMEstatic intDEFAULT_MAX_FILE_LENGTHstatic StringDEFAULT_PORTstatic longDEFAULT_START_TIMEOUTprotected DestinationFactorydestinationFactorystatic StringLOCAL_HOST_NAMEstatic intMAX_SCHEDULER_REPEAT_ALLOWED
-
Constructor Summary
Constructors Constructor Description BrokerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransportConnectoraddConnector(String bindAddress)Adds a new transport connector for the given bind addressTransportConnectoraddConnector(URI bindAddress)Adds a new transport connector for the given bind addressTransportConnectoraddConnector(TransportConnector connector)Adds a new transport connectorTransportConnectoraddConnector(TransportServer transport)Adds a new transport connector for the given TransportServer transportprotected BrokeraddInterceptors(Broker broker)Strategy method to add interceptors to the brokerJmsConnectoraddJmsConnector(JmsConnector connector)NetworkConnectoraddNetworkConnector(String discoveryAddress)Adds a new network connector using the given discovery addressNetworkConnectoraddNetworkConnector(URI discoveryAddress)Adds a new network connector using the given discovery addressNetworkConnectoraddNetworkConnector(NetworkConnector connector)Adds a new network connector to connect this broker to a federated networkvoidaddPreShutdownHook(Runnable hook)Adds aRunnablehook that will be invoked before the broker is stopped.ProxyConnectoraddProxyConnector(String bindAddress)Adds a new proxy connector using the given bind addressProxyConnectoraddProxyConnector(URI bindAddress)Adds a new proxy connector using the given bind addressProxyConnectoraddProxyConnector(ProxyConnector connector)voidaddService(Service service)Adds a new service so that it will be started as part of the broker lifecycleprotected voidaddShutdownHook()voidaddShutdownHook(Runnable hook)voidautoStart()protected voidcheckMemorySystemUsageLimits()booleancheckQueueSize(String queueName)protected voidcheckStoreSystemUsageLimits()protected voidcheckStoreUsageLimits()Check that the store usage limit is not greater than max usable space and adjust if it isprotected voidcheckTmpStoreUsageLimits()Check that temporary usage limit is not greater than max usable space and adjust if it isprotected voidcheckUsageLimit(File dir, PercentLimitUsage<?> storeUsage, int percentLimit)protected voidconfigureService(Object service)Perform any custom dependency injectionprotected voidconfigureServices(Object[] services)Perform any custom dependency injectionprotected voidcontainerShutdown()Causes a clean shutdown of the container when the VM is being shut downprotected BrokercreateBroker()Factory method to create a new brokerprotected ObjectNamecreateBrokerObjectName()protected DestinationInterceptor[]createDefaultDestinationInterceptor()Create the default destination interceptorObjectNamecreateDuplexNetworkConnectorObjectName(String transport)ObjectNamecreateNetworkConnectorObjectName(NetworkConnector connector)protected PersistenceAdaptercreatePersistenceAdapter()protected BrokercreateRegionBroker()Factory method to create the core region broker onto which interceptors are addedprotected BrokercreateRegionBroker(DestinationInterceptor destinationInterceptor)protected TransportConnectorcreateTransportConnector(URI brokerURI)voiddecrementCurrentConnections()voiddeleteAllMessages()Delete all messages from the persistent storeConnectionContextgetAdminConnectionContext()Returns the broker's administration connection context used for configuring the broker at startupBrokerViewgetAdminView()Returns the administration view of the broker; used to create and destroy resources such as queues and topics.BrokergetBroker()Returns the message brokerBrokerContextgetBrokerContext()FilegetBrokerDataDirectory()StringgetBrokerName()ObjectNamegetBrokerObjectName()TransportConnectorgetConnectorByName(String connectorName)SystemUsagegetConsumerSystemUsage()intgetConsumerSystemUsagePortion()intgetCurrentConnections()FilegetDataDirectoryFile()StringgetDefaultSocketURIString()DestinationgetDestination(ActiveMQDestination destination)Looks up and lazily creates if necessary the destination for the given JMS nameDestinationInterceptor[]getDestinationInterceptors()PolicyMapgetDestinationPolicy()ActiveMQDestination[]getDestinations()intgetDiskUsageCheckRegrowThreshold()protected ThreadPoolExecutorgetExecutor()IOExceptionHandlergetIoExceptionHandler()JmsConnector[]getJmsBridgeConnectors()JobSchedulerStoregetJobSchedulerStore()ManagementContextgetManagementContext()intgetMaxPurgedDestinationsPerSweep()intgetMaxSchedulerRepeatAllowed()longgetMbeanInvocationTimeout()Gets the time in Milliseconds that an invocation of an MBean method will wait before failing.MessageAuthorizationPolicygetMessageAuthorizationPolicy()NetworkConnectorgetNetworkConnectorByName(String connectorName)List<NetworkConnector>getNetworkConnectors()String[]getNetworkConnectorURIs()longgetOfflineDurableSubscriberTaskSchedule()longgetOfflineDurableSubscriberTimeout()PersistenceAdaptergetPersistenceAdapter()PersistenceAdapterFactorygetPersistenceFactory()TaskRunnerFactorygetPersistenceTaskRunnerFactory()intgetPersistenceThreadPriority()BrokerPlugin[]getPlugins()protected ObjectgetPort(Map<?,?> options)Extracts the port from the optionsProducerBrokerExchangegetProducerBrokerExchange(ProducerInfo producerInfo)SystemUsagegetProducerSystemUsage()intgetProducerSystemUsagePortion()List<ProxyConnector>getProxyConnectors()BrokergetRegionBroker()intgetSchedulePeriodForDestinationPurge()SchedulergetScheduler()FilegetSchedulerDirectoryFile()Service[]getServices()SslContextgetSslContext()ThrowablegetStartException()intgetStoreOpenWireVersion()intgetSystemExitOnShutdownExitCode()SystemUsagegetSystemUsage()TaskRunnerFactorygetTaskRunnerFactory()intgetTaskRunnerPriority()PListStoregetTempDataStore()intgetTimeBeforePurgeTempDestinations()FilegetTmpDataDirectory()longgetTotalConnections()TransportConnectorgetTransportConnectorByName(String name)TransportConnectorgetTransportConnectorByScheme(String scheme)List<TransportConnector>getTransportConnectors()String[]getTransportConnectorURIs()Map<String,String>getTransportConnectorURIsAsMap()StringgetUptime()longgetUptimeMillis()URIgetVmConnectorURI()longgetWaitForSlaveTimeout()voidhandleIOException(IOException exception)voidincrementCurrentConnections()voidincrementTotalConnections()booleanisAdjustUsageLimits()booleanisAdvisorySupport()booleanisAllowTempAutoCreationOnSend()booleanisAnonymousProducerAdvisorySupport()booleanisCacheTempDestinations()booleanisDedicatedTaskRunner()booleanisDeleteAllMessagesOnStartup()booleanisEnableMessageExpirationOnActiveDurableSubs()booleanisEnableStatistics()booleanisKeepDurableSubsActive()booleanisMonitorConnectionSplits()booleanisNetworkConnectorStartAsync()booleanisPassiveSlave()Get the passiveSlavebooleanisPersistent()booleanisPopulateJMSXUserID()booleanisPopulateUserNameInMBeans()Should MBeans that support showing the Authenticated User Name information have this value filled in or not.booleanisRejectDurableConsumers()booleanisRestartAllowed()booleanisRestartRequested()A lifecycle manager of the BrokerService should inspect this property after a broker shutdown has occurred to find out if the broker needs to be re-created and started again.booleanisRollbackOnlyOnAsyncException()booleanisSchedulerSupport()booleanisShutdownOnMasterFailure()booleanisShutdownOnSlaveFailure()booleanisSlave()booleanisSplitSystemUsageForProducersConsumers()booleanisStartAsync()booleanisStarted()booleanisStopped()booleanisStopping()booleanisSystemExitOnShutdown()booleanisUseAuthenticatedPrincipalForJMSXUserID()booleanisUseJmx()booleanisUseLocalHostBrokerName()booleanisUseLoggingForShutdownErrors()booleanisUseMirroredQueues()booleanisUseShutdownHook()booleanisUseTempMirroredQueues()booleanisUseVirtualDestSubs()booleanisUseVirtualDestSubsOnCreation()booleanisUseVirtualTopics()booleanisWaitForSlave()protected voidlogError(String message, Throwable e)voidmasterFailed()protected voidprocessHelperProperties()Handles any lazy-creation helper properties which are added to make things easier to configure inside environments such as Springprotected TransportConnectorregisterConnectorMBean(TransportConnector connector)protected voidregisterJmsConnectorMBean(JmsConnector connector)voidregisterNetworkConnectorMBean(NetworkConnector connector)protected PersistenceAdapterregisterPersistenceAdapterMBean(PersistenceAdapter adaptor)protected voidregisterProxyConnectorMBean(ProxyConnector connector)booleanremoveConnector(TransportConnector connector)Stops and removes a transport connector from the broker.voidremoveDestination(ActiveMQDestination destination)JmsConnectorremoveJmsConnector(JmsConnector connector)booleanremoveNetworkConnector(NetworkConnector connector)Removes the given network connector without stopping it.voidremovePreShutdownHook(Runnable hook)voidremoveService(Service service)protected voidremoveShutdownHook()voidremoveShutdownHook(Runnable hook)voidrequestRestart()protected voidscheduleDiskUsageLimitsCheck()Schedules a periodic task based on schedulePeriodForDiskLimitCheck to update store and temporary store limits if the amount of available space plus current store size is less than the existing configured limitvoidsetAdjustUsageLimits(boolean adjustUsageLimits)voidsetAdminView(BrokerView adminView)voidsetAdvisorySupport(boolean advisorySupport)Allows the support of advisory messages to be disabled for performance reasons.voidsetAllowTempAutoCreationOnSend(boolean allowTempAutoCreationOnSend)enable if temp destinations need to be propagated through a network when advisorySupport==false.voidsetAnonymousProducerAdvisorySupport(boolean anonymousProducerAdvisorySupport)voidsetBrokerContext(BrokerContext brokerContext)voidsetBrokerId(String brokerId)voidsetBrokerName(String brokerName)Sets the name of this broker; which must be unique in the network.voidsetBrokerObjectName(ObjectName brokerObjectName)Sets the JMX ObjectName for this brokervoidsetCacheTempDestinations(boolean cacheTempDestinations)voidsetConsumerSystemUsage(SystemUsage consumerSystemUsage)voidsetConsumerSystemUsagePortion(int consumerSystemUsagePortion)voidsetDataDirectory(String dataDirectory)Sets the directory in which the data files will be stored by default for the JDBC and Journal persistence adaptors.voidsetDataDirectoryFile(File dataDirectoryFile)Sets the directory in which the data files will be stored by default for the JDBC and Journal persistence adaptors.voidsetDedicatedTaskRunner(boolean dedicatedTaskRunner)voidsetDeleteAllMessagesOnStartup(boolean deletePersistentMessagesOnStartup)Sets whether or not all messages are deleted on startup - mostly only useful for testing.voidsetDestinationFactory(DestinationFactory destinationFactory)voidsetDestinationInterceptors(DestinationInterceptor[] destinationInterceptors)Sets the destination interceptors to usevoidsetDestinationPolicy(PolicyMap policyMap)Sets the destination specific policies available either for exact destinations or for wildcard areas of destinations.voidsetDestinations(ActiveMQDestination[] destinations)Sets the destinations which should be loaded/created on startupvoidsetDiskUsageCheckRegrowThreshold(int diskUsageCheckRegrowThreshold)voidsetEnableMessageExpirationOnActiveDurableSubs(boolean enableMessageExpirationOnActiveDurableSubs)voidsetEnableStatistics(boolean enableStatistics)Sets whether or not the Broker's services enable statistics or not.voidsetIoExceptionHandler(IOExceptionHandler ioExceptionHandler)override the Default IOException handler, called when persistence adapter has experiences File or JDBC I/O ExceptionsvoidsetJmsBridgeConnectors(JmsConnector[] jmsConnectors)voidsetJobSchedulerStore(JobSchedulerStore jobSchedulerStore)voidsetKeepDurableSubsActive(boolean keepDurableSubsActive)voidsetManagementContext(ManagementContext managementContext)voidsetMaxPurgedDestinationsPerSweep(int maxPurgedDestinationsPerSweep)voidsetMaxSchedulerRepeatAllowed(int maxSchedulerRepeatAllowed)voidsetMbeanInvocationTimeout(long mbeanInvocationTimeout)Gets the time in Milliseconds that an invocation of an MBean method will wait before failing.voidsetMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy)Sets the policy used to decide if the current connection is authorized to consume a given messagevoidsetMonitorConnectionSplits(boolean monitorConnectionSplits)voidsetNetworkConnectors(List<?> networkConnectors)Sets the network connectors which this broker will use to connect to other brokers in a federated networkvoidsetNetworkConnectorStartAsync(boolean networkConnectorStartAsync)voidsetNetworkConnectorURIs(String[] networkConnectorURIs)voidsetOfflineDurableSubscriberTaskSchedule(long offlineDurableSubscriberTaskSchedule)voidsetOfflineDurableSubscriberTimeout(long offlineDurableSubscriberTimeout)voidsetPassiveSlave(boolean passiveSlave)Set the passiveSlavevoidsetPersistenceAdapter(PersistenceAdapter persistenceAdapter)Sets the persistence adaptor implementation to use for this brokervoidsetPersistenceFactory(PersistenceAdapterFactory persistenceFactory)voidsetPersistenceTaskRunnerFactory(TaskRunnerFactory persistenceTaskRunnerFactory)voidsetPersistenceThreadPriority(int persistenceThreadPriority)voidsetPersistent(boolean persistent)Sets whether or not persistence is enabled or disabled.voidsetPlugins(BrokerPlugin[] plugins)Sets a number of broker plugins to install such as for security authentication or authorizationvoidsetPopulateJMSXUserID(boolean populateJMSXUserID)Sets whether or not the broker should populate the JMSXUserID header.voidsetPopulateUserNameInMBeans(boolean value)Sets whether Authenticated User Name information is shown in MBeans that support this field.voidsetProducerSystemUsage(SystemUsage producerUsageManager)voidsetProducerSystemUsagePortion(int producerSystemUsagePortion)voidsetProxyConnectors(List<?> proxyConnectors)Sets the network connectors which this broker will use to connect to other brokers in a federated networkvoidsetRegionBroker(Broker regionBroker)voidsetRejectDurableConsumers(boolean rejectDurableConsumers)voidsetRestartAllowed(boolean restartAllowed)Sets if the broker allowed to restart on shutdown.voidsetRollbackOnlyOnAsyncException(boolean rollbackOnlyOnAsyncException)voidsetSchedulePeriodForDestinationPurge(int schedulePeriodForDestinationPurge)voidsetSchedulePeriodForDiskUsageCheck(int schedulePeriodForDiskUsageCheck)voidsetSchedulerDirectory(String schedulerDirectory)voidsetSchedulerDirectoryFile(File schedulerDirectory)voidsetSchedulerSupport(boolean schedulerSupport)voidsetServices(Service[] services)Sets the services associated with this broker.voidsetShutdownHooks(List<Runnable> hooks)Sets hooks to be executed when broker shut downvoidsetShutdownOnMasterFailure(boolean shutdownOnMasterFailure)voidsetShutdownOnSlaveFailure(boolean shutdownOnSlaveFailure)voidsetSplitSystemUsageForProducersConsumers(boolean splitSystemUsageForProducersConsumers)voidsetSslContext(SslContext sslContext)voidsetStartAsync(boolean startAsync)voidsetStoreOpenWireVersion(int storeOpenWireVersion)voidsetSystemExitOnShutdown(boolean systemExitOnShutdown)voidsetSystemExitOnShutdownExitCode(int systemExitOnShutdownExitCode)voidsetSystemUsage(SystemUsage memoryManager)voidsetTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)voidsetTaskRunnerPriority(int taskRunnerPriority)voidsetTempDataStore(PListStore tempDataStore)voidsetTimeBeforePurgeTempDestinations(int timeBeforePurgeTempDestinations)voidsetTmpDataDirectory(File tmpDataDirectory)voidsetTransportConnectors(List<TransportConnector> transportConnectors)Sets the transport connectors which this broker will listen on for new clientsvoidsetTransportConnectorURIs(String[] transportConnectorURIs)voidsetUseAuthenticatedPrincipalForJMSXUserID(boolean useAuthenticatedPrincipalForJMSXUserID)voidsetUseJmx(boolean useJmx)Sets whether or not the Broker's services should be exposed into JMX or not.voidsetUseLocalHostBrokerName(boolean useLocalHostBrokerName)voidsetUseLoggingForShutdownErrors(boolean useLoggingForShutdownErrors)Sets whether or not we should use commons-logging when reporting errors when shutting down the brokervoidsetUseMirroredQueues(boolean useMirroredQueues)Sets whether or not Mirrored Queues should be supported by default if they have not been explicitly configured.voidsetUseShutdownHook(boolean useShutdownHook)Sets whether or not we should use a shutdown handler to close down the broker cleanly if the JVM is terminated.voidsetUseTempMirroredQueues(boolean useTempMirroredQueues)voidsetUseVirtualDestSubs(boolean useVirtualDestSubs)voidsetUseVirtualDestSubsOnCreation(boolean useVirtualDestSubsOnCreation)voidsetUseVirtualTopics(boolean useVirtualTopics)Sets whether or not Virtual Topics should be supported by default if they have not been explicitly configured.voidsetVmConnectorURI(URI vmConnectorURI)voidsetWaitForSlave(boolean waitForSlave)voidsetWaitForSlaveTimeout(long waitForSlaveTimeout)protected booleanshouldAutostart()booleanshouldRecordVirtualDestination(ActiveMQDestination destination)voidstart()voidstart(boolean force)Forces a start of the broker.voidstartAllConnectors()Start all transport and network connections, proxies and bridgesprotected voidstartDestinations()Starts any configured destinations on startupprotected voidstartManagementContext()voidstartNetworkConnector(NetworkConnector connector, ThreadPoolExecutor networkConnectorStartExecutor)voidstartNetworkConnector(NetworkConnector connector, Set<ActiveMQDestination> durableDestinations, ThreadPoolExecutor networkConnectorStartExecutor)TransportConnectorstartTransportConnector(TransportConnector connector)protected voidstartVirtualConsumerDestinations()voidstop()voidstopAllConnectors(ServiceStopper stopper)voidstopGracefully(String connectorName, String queueName, long timeout, long pollInterval)This method (both connectorName and queueName are using regex to match) 1.StringtoString()protected voidunregisterConnectorMBean(TransportConnector connector)protected voidunregisterNetworkConnectorMBean(NetworkConnector connector)protected voidunregisterPersistenceAdapterMBean(PersistenceAdapter adaptor)booleanwaitUntilStarted()A helper method to block the caller thread until the broker has fully startedbooleanwaitUntilStarted(long timeout)A helper method to block the caller thread until the broker has fully startedvoidwaitUntilStopped()A helper method to block the caller thread until the broker has been stopped
-
-
-
Field Detail
-
DEFAULT_PORT
public static final String DEFAULT_PORT
- See Also:
- Constant Field Values
-
LOCAL_HOST_NAME
public static final String LOCAL_HOST_NAME
-
BROKER_VERSION
public static final String BROKER_VERSION
-
DEFAULT_BROKER_NAME
public static final String DEFAULT_BROKER_NAME
- See Also:
- Constant Field Values
-
DEFAULT_MAX_FILE_LENGTH
public static final int DEFAULT_MAX_FILE_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_START_TIMEOUT
public static final long DEFAULT_START_TIMEOUT
- See Also:
- Constant Field Values
-
MAX_SCHEDULER_REPEAT_ALLOWED
public static final int MAX_SCHEDULER_REPEAT_ALLOWED
- See Also:
- Constant Field Values
-
destinationFactory
protected DestinationFactory destinationFactory
-
-
Method Detail
-
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.- 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 callNetworkConnector.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
-
addPreShutdownHook
public final void addPreShutdownHook(Runnable hook)
Adds aRunnablehook that will be invoked before the broker is stopped. This allows performing cleanup actions before the broker is stopped. The hook should not throw exceptions or block.
-
removeJmsConnector
public JmsConnector removeJmsConnector(JmsConnector connector)
-
masterFailed
public void masterFailed()
-
getUptime
public String getUptime()
-
getUptimeMillis
public long getUptimeMillis()
-
isStarted
public boolean isStarted()
-
start
public void start(boolean force) throws ExceptionForces a start of the broker. By default a BrokerService instance that was previously stopped using BrokerService.stop() cannot be restarted using BrokerService.start(). This method enforces a restart. It is not recommended to force a restart of the broker and will not work for most but some very trivial broker configurations. For restarting a broker instance we recommend to first call stop() on the old instance and then recreate a new BrokerService instance.- Parameters:
force- - if true enforces a restart.- Throws:
Exception
-
shouldAutostart
protected boolean shouldAutostart()
-
start
public void start() throws Exception
-
checkQueueSize
public boolean checkQueueSize(String queueName)
-
stopGracefully
public void stopGracefully(String connectorName, String queueName, long timeout, long pollInterval) throws Exception
This method (both connectorName and queueName are using regex to match) 1. stop the connector (supposed the user input the connector which the clients connect to) 2. to check whether there is any pending message on the queues defined by queueName 3. supposedly, after stop the connector, client should failover to other broker and pending messages should be forwarded. if no pending messages, the method finally call stop to stop the broker.- Throws:
Exception
-
waitUntilStopped
public void waitUntilStopped()
A helper method to block the caller thread until the broker has been stopped
-
isStopped
public boolean isStopped()
-
waitUntilStarted
public boolean waitUntilStarted()
A helper method to block the caller thread until the broker has fully started- Returns:
- boolean true if wait succeeded false if broker was not started or was stopped
-
waitUntilStarted
public boolean waitUntilStarted(long timeout)
A helper method to block the caller thread until the broker has fully started- Parameters:
timeout- the amount of time to wait before giving up and returning false.- Returns:
- boolean true if wait succeeded false if broker was not started or was stopped
-
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.
-
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()
- Returns:
- the consumerUsageManager
-
setConsumerSystemUsage
public void setConsumerSystemUsage(SystemUsage consumerSystemUsage)
- Parameters:
consumerSystemUsage- the storeSystemUsage to set
-
getProducerSystemUsage
public SystemUsage getProducerSystemUsage()
- Returns:
- the producerUsageManager
-
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 MalformedObjectNameException
- Throws:
MalformedObjectNameException
-
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)
-
getProducerBrokerExchange
public ProducerBrokerExchange getProducerBrokerExchange(ProducerInfo producerInfo)
-
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.
-
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.
-
isAnonymousProducerAdvisorySupport
public boolean isAnonymousProducerAdvisorySupport()
-
setAnonymousProducerAdvisorySupport
public void setAnonymousProducerAdvisorySupport(boolean anonymousProducerAdvisorySupport)
-
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
-
getTransportConnectorByName
public TransportConnector getTransportConnectorByName(String name)
-
getTransportConnectorByScheme
public TransportConnector getTransportConnectorByScheme(String scheme)
-
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 IOExceptionDelete 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)
-
getDefaultSocketURIString
public String getDefaultSocketURIString()
-
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)
-
isEnableMessageExpirationOnActiveDurableSubs
public boolean isEnableMessageExpirationOnActiveDurableSubs()
-
setEnableMessageExpirationOnActiveDurableSubs
public void setEnableMessageExpirationOnActiveDurableSubs(boolean enableMessageExpirationOnActiveDurableSubs)
-
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 PListStore getTempDataStore()
- Returns:
- the tempDataStore
-
setTempDataStore
public void setTempDataStore(PListStore 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
-
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)
-
getJobSchedulerStore
public JobSchedulerStore getJobSchedulerStore()
-
setJobSchedulerStore
public void setJobSchedulerStore(JobSchedulerStore jobSchedulerStore)
-
processHelperProperties
protected void processHelperProperties() throws ExceptionHandles any lazy-creation helper properties which are added to make things easier to configure inside environments such as Spring- Throws:
Exception
-
checkStoreUsageLimits
protected void checkStoreUsageLimits() throws ExceptionCheck that the store usage limit is not greater than max usable space and adjust if it is- Throws:
Exception
-
checkTmpStoreUsageLimits
protected void checkTmpStoreUsageLimits() throws ExceptionCheck that temporary usage limit is not greater than max usable space and adjust if it is- Throws:
Exception
-
checkUsageLimit
protected void checkUsageLimit(File dir, PercentLimitUsage<?> storeUsage, int percentLimit) throws ConfigurationException
- Throws:
ConfigurationException
-
scheduleDiskUsageLimitsCheck
protected void scheduleDiskUsageLimitsCheck() throws IOExceptionSchedules a periodic task based on schedulePeriodForDiskLimitCheck to update store and temporary store limits if the amount of available space plus current store size is less than the existing configured limit- Throws:
IOException
-
checkMemorySystemUsageLimits
protected void checkMemorySystemUsageLimits() throws Exception- Throws:
Exception
-
checkStoreSystemUsageLimits
protected void checkStoreSystemUsageLimits() throws Exception- Throws:
Exception
-
stopAllConnectors
public 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
public void registerNetworkConnectorMBean(NetworkConnector connector) throws IOException
- Throws:
IOException
-
createNetworkConnectorObjectName
public ObjectName createNetworkConnectorObjectName(NetworkConnector connector) throws MalformedObjectNameException
- Throws:
MalformedObjectNameException
-
createDuplexNetworkConnectorObjectName
public ObjectName createDuplexNetworkConnectorObjectName(String transport) throws MalformedObjectNameException
- Throws:
MalformedObjectNameException
-
unregisterNetworkConnectorMBean
protected void unregisterNetworkConnectorMBean(NetworkConnector connector)
-
registerProxyConnectorMBean
protected void registerProxyConnectorMBean(ProxyConnector 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:
IOExceptionException
-
createPersistenceAdapter
protected PersistenceAdapter createPersistenceAdapter() throws IOException
- Throws:
IOException
-
createBrokerObjectName
protected ObjectName createBrokerObjectName() throws MalformedObjectNameException
- Throws:
MalformedObjectNameException
-
createTransportConnector
protected TransportConnector createTransportConnector(URI brokerURI) throws Exception
- Throws:
Exception
-
addShutdownHook
protected void addShutdownHook()
-
removeShutdownHook
protected void removeShutdownHook()
-
setShutdownHooks
public void setShutdownHooks(List<Runnable> hooks) throws Exception
Sets hooks to be executed when broker shut down- Throws:
Exception
-
containerShutdown
protected void containerShutdown()
Causes a clean shutdown of the container when the VM is being shut down
-
startDestinations
protected void startDestinations() throws ExceptionStarts 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
-
startAllConnectors
public void startAllConnectors() throws ExceptionStart all transport and network connections, proxies and bridges- Throws:
Exception
-
startNetworkConnector
public void startNetworkConnector(NetworkConnector connector, ThreadPoolExecutor networkConnectorStartExecutor) throws Exception
- Throws:
Exception
-
startNetworkConnector
public void startNetworkConnector(NetworkConnector connector, Set<ActiveMQDestination> durableDestinations, ThreadPoolExecutor networkConnectorStartExecutor) throws Exception
- Throws:
Exception
-
startTransportConnector
public 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
-
handleIOException
public void handleIOException(IOException exception)
-
startVirtualConsumerDestinations
protected void startVirtualConsumerDestinations() throws Exception- Throws:
Exception
-
getExecutor
protected ThreadPoolExecutor getExecutor()
-
getScheduler
public Scheduler getScheduler()
-
getRegionBroker
public Broker getRegionBroker()
-
setRegionBroker
public void setRegionBroker(Broker regionBroker)
-
removePreShutdownHook
public final void removePreShutdownHook(Runnable hook)
-
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)
-
getWaitForSlaveTimeout
public long getWaitForSlaveTimeout()
-
setWaitForSlaveTimeout
public void setWaitForSlaveTimeout(long waitForSlaveTimeout)
-
isPassiveSlave
public boolean isPassiveSlave()
Get the passiveSlave- Returns:
- the passiveSlave
-
setPassiveSlave
public void setPassiveSlave(boolean passiveSlave)
Set the passiveSlave- Parameters:
passiveSlave- the passiveSlave to set
-
setIoExceptionHandler
public void setIoExceptionHandler(IOExceptionHandler ioExceptionHandler)
override the Default IOException handler, called when persistence adapter has experiences File or JDBC I/O Exceptions- Parameters:
ioExceptionHandler-
-
getIoExceptionHandler
public IOExceptionHandler getIoExceptionHandler()
-
isSchedulerSupport
public boolean isSchedulerSupport()
- Returns:
- the schedulerSupport
-
setSchedulerSupport
public void setSchedulerSupport(boolean schedulerSupport)
- Parameters:
schedulerSupport- the schedulerSupport to set
-
getSchedulerDirectoryFile
public File getSchedulerDirectoryFile()
- Returns:
- the schedulerDirectory
-
setSchedulerDirectoryFile
public void setSchedulerDirectoryFile(File schedulerDirectory)
- Parameters:
schedulerDirectory- the schedulerDirectory to set
-
setSchedulerDirectory
public void setSchedulerDirectory(String schedulerDirectory)
-
getSchedulePeriodForDestinationPurge
public int getSchedulePeriodForDestinationPurge()
-
setSchedulePeriodForDestinationPurge
public void setSchedulePeriodForDestinationPurge(int schedulePeriodForDestinationPurge)
-
setSchedulePeriodForDiskUsageCheck
public void setSchedulePeriodForDiskUsageCheck(int schedulePeriodForDiskUsageCheck)
- Parameters:
schedulePeriodForDiskUsageCheck-
-
getDiskUsageCheckRegrowThreshold
public int getDiskUsageCheckRegrowThreshold()
-
setDiskUsageCheckRegrowThreshold
public void setDiskUsageCheckRegrowThreshold(int diskUsageCheckRegrowThreshold)
- Parameters:
diskUsageCheckRegrowThreshold-
-
getMaxPurgedDestinationsPerSweep
public int getMaxPurgedDestinationsPerSweep()
-
setMaxPurgedDestinationsPerSweep
public void setMaxPurgedDestinationsPerSweep(int maxPurgedDestinationsPerSweep)
-
getBrokerContext
public BrokerContext getBrokerContext()
-
setBrokerContext
public void setBrokerContext(BrokerContext brokerContext)
-
setBrokerId
public void setBrokerId(String brokerId)
-
isUseAuthenticatedPrincipalForJMSXUserID
public boolean isUseAuthenticatedPrincipalForJMSXUserID()
-
setUseAuthenticatedPrincipalForJMSXUserID
public void setUseAuthenticatedPrincipalForJMSXUserID(boolean useAuthenticatedPrincipalForJMSXUserID)
-
isPopulateUserNameInMBeans
public boolean isPopulateUserNameInMBeans()
Should MBeans that support showing the Authenticated User Name information have this value filled in or not.- Returns:
- true if user names should be exposed in MBeans
-
setPopulateUserNameInMBeans
public void setPopulateUserNameInMBeans(boolean value)
Sets whether Authenticated User Name information is shown in MBeans that support this field.- Parameters:
value- if MBeans should expose user name information.
-
getMbeanInvocationTimeout
public long getMbeanInvocationTimeout()
Gets the time in Milliseconds that an invocation of an MBean method will wait before failing. The default value is to wait forever (zero).- Returns:
- timeout in milliseconds before MBean calls fail, (default is 0 or no timeout).
-
setMbeanInvocationTimeout
public void setMbeanInvocationTimeout(long mbeanInvocationTimeout)
Gets the time in Milliseconds that an invocation of an MBean method will wait before failing. The default value is to wait forever (zero).- Parameters:
mbeanInvocationTimeout- timeout in milliseconds before MBean calls fail, (default is 0 or no timeout).
-
isNetworkConnectorStartAsync
public boolean isNetworkConnectorStartAsync()
-
setNetworkConnectorStartAsync
public void setNetworkConnectorStartAsync(boolean networkConnectorStartAsync)
-
isAllowTempAutoCreationOnSend
public boolean isAllowTempAutoCreationOnSend()
-
setAllowTempAutoCreationOnSend
public void setAllowTempAutoCreationOnSend(boolean allowTempAutoCreationOnSend)
enable if temp destinations need to be propagated through a network when advisorySupport==false. This is used in conjunction with the policy gcInactiveDestinations for matching temps so they can get removed when inactive- Parameters:
allowTempAutoCreationOnSend-
-
getOfflineDurableSubscriberTimeout
public long getOfflineDurableSubscriberTimeout()
-
setOfflineDurableSubscriberTimeout
public void setOfflineDurableSubscriberTimeout(long offlineDurableSubscriberTimeout)
-
getOfflineDurableSubscriberTaskSchedule
public long getOfflineDurableSubscriberTaskSchedule()
-
setOfflineDurableSubscriberTaskSchedule
public void setOfflineDurableSubscriberTaskSchedule(long offlineDurableSubscriberTaskSchedule)
-
shouldRecordVirtualDestination
public boolean shouldRecordVirtualDestination(ActiveMQDestination destination)
-
getStartException
public Throwable getStartException()
-
isStartAsync
public boolean isStartAsync()
-
setStartAsync
public void setStartAsync(boolean startAsync)
-
isSlave
public boolean isSlave()
-
isStopping
public boolean isStopping()
-
isRestartAllowed
public boolean isRestartAllowed()
- Returns:
- true if the broker allowed to restart on shutdown.
-
setRestartAllowed
public void setRestartAllowed(boolean restartAllowed)
Sets if the broker allowed to restart on shutdown.
-
isRestartRequested
public boolean isRestartRequested()
A lifecycle manager of the BrokerService should inspect this property after a broker shutdown has occurred to find out if the broker needs to be re-created and started again.- Returns:
- true if the broker wants to be restarted after it shuts down.
-
requestRestart
public void requestRestart()
-
getStoreOpenWireVersion
public int getStoreOpenWireVersion()
-
setStoreOpenWireVersion
public void setStoreOpenWireVersion(int storeOpenWireVersion)
-
getCurrentConnections
public int getCurrentConnections()
- Returns:
- the current number of connections on this Broker.
-
getTotalConnections
public long getTotalConnections()
- Returns:
- the total number of connections this broker has handled since startup.
-
incrementCurrentConnections
public void incrementCurrentConnections()
-
decrementCurrentConnections
public void decrementCurrentConnections()
-
incrementTotalConnections
public void incrementTotalConnections()
-
isRejectDurableConsumers
public boolean isRejectDurableConsumers()
-
setRejectDurableConsumers
public void setRejectDurableConsumers(boolean rejectDurableConsumers)
-
isUseVirtualDestSubs
public boolean isUseVirtualDestSubs()
-
setUseVirtualDestSubs
public void setUseVirtualDestSubs(boolean useVirtualDestSubs)
-
isUseVirtualDestSubsOnCreation
public boolean isUseVirtualDestSubsOnCreation()
-
setUseVirtualDestSubsOnCreation
public void setUseVirtualDestSubsOnCreation(boolean useVirtualDestSubsOnCreation)
-
isAdjustUsageLimits
public boolean isAdjustUsageLimits()
-
setAdjustUsageLimits
public void setAdjustUsageLimits(boolean adjustUsageLimits)
-
setRollbackOnlyOnAsyncException
public void setRollbackOnlyOnAsyncException(boolean rollbackOnlyOnAsyncException)
-
isRollbackOnlyOnAsyncException
public boolean isRollbackOnlyOnAsyncException()
-
getMaxSchedulerRepeatAllowed
public int getMaxSchedulerRepeatAllowed()
-
setMaxSchedulerRepeatAllowed
public void setMaxSchedulerRepeatAllowed(int maxSchedulerRepeatAllowed)
-
-