activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [11/20] git commit: Only register the leveldb store MBeans in JMX if jmx is enabled on the broker.
Date Wed, 12 Mar 2014 02:21:37 GMT
Only register the leveldb store MBeans in JMX if jmx is enabled on the broker.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/251b7da5
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/251b7da5
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/251b7da5

Branch: refs/heads/activemq-5.9
Commit: 251b7da5a865137244b321f80622138d2bb548ef
Parents: 7fd082a
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Wed Oct 30 15:34:29 2013 -0400
Committer: Hadrian Zbarcea <hadrian@apache.org>
Committed: Tue Mar 11 21:16:39 2014 -0400

----------------------------------------------------------------------
 .../main/scala/org/apache/activemq/leveldb/LevelDBStore.scala    | 4 ++--
 .../activemq/leveldb/replicated/ElectingLevelDBStore.scala       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/251b7da5/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
index 98aaf6d..7f5b534 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
@@ -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)

http://git-wip-us.apache.org/repos/asf/activemq/blob/251b7da5/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
index 074eb7b..90e80c0 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
@@ -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


Mime
View raw message