activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject [1/2] git commit: Only register the leveldb store MBeans in JMX if jmx is enabled on the broker.
Date Wed, 30 Oct 2013 19:44:30 GMT
Updated Branches:
  refs/heads/trunk 2a5929490 -> 3ed52ef8a


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/17415cee
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/17415cee
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/17415cee

Branch: refs/heads/trunk
Commit: 17415ceecde675cc925a83c80ba4558b60b81e6a
Parents: 2a59294
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Wed Oct 30 15:34:29 2013 -0400
Committer: Hiram Chirino <hiram@hiramchirino.com>
Committed: Wed Oct 30 15:34:29 2013 -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/17415cee/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/17415cee/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