mirror of https://github.com/apache/activemq.git
Only register the leveldb store MBeans in JMX if jmx is enabled on the broker.
This commit is contained in:
parent
2a59294909
commit
17415ceecd
|
@ -217,7 +217,7 @@ class LevelDBStore extends LockableServiceSupport with BrokerServiceAware with P
|
|||
debug("starting")
|
||||
|
||||
// Expose a JMX bean to expose the status of the store.
|
||||
if(brokerService!=null){
|
||||
if(brokerService!=null && brokerService.isUseJmx){
|
||||
try {
|
||||
AnnotatedMBean.registerMBean(brokerService.getManagementContext, new LevelDBStoreView(this), objectName)
|
||||
} catch {
|
||||
|
@ -274,7 +274,7 @@ class LevelDBStore extends LockableServiceSupport with BrokerServiceAware with P
|
|||
|
||||
def doStop(stopper: ServiceStopper): Unit = {
|
||||
db.stop
|
||||
if(brokerService!=null){
|
||||
if(brokerService!=null && brokerService.isUseJmx){
|
||||
brokerService.getManagementContext().unregisterMBean(objectName);
|
||||
}
|
||||
info("Stopped "+this)
|
||||
|
|
|
@ -156,7 +156,7 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
|
|||
|
||||
def init() {
|
||||
|
||||
if(brokerService!=null){
|
||||
if(brokerService!=null && brokerService.isUseJmx){
|
||||
try {
|
||||
AnnotatedMBean.registerMBean(brokerService.getManagementContext, new ReplicatedLevelDBStoreView(this), objectName)
|
||||
} catch {
|
||||
|
@ -269,7 +269,7 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
|
|||
}
|
||||
|
||||
protected def doStop(stopper: ServiceStopper) {
|
||||
if(brokerService!=null){
|
||||
if(brokerService!=null && brokerService.isUseJmx){
|
||||
brokerService.getManagementContext().unregisterMBean(objectName);
|
||||
}
|
||||
zk_group.close
|
||||
|
|
Loading…
Reference in New Issue