activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject activemq git commit: Implements https://issues.apache.org/jira/browse/AMQ-5458 - Lets make sure we register the Test mbean when in slave mode.
Date Wed, 26 Nov 2014 15:57:30 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk f4149c0a4 -> 4e3499e41


Implements https://issues.apache.org/jira/browse/AMQ-5458 - Lets make sure we register the
Test mbean when in slave mode.

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

Branch: refs/heads/trunk
Commit: 4e3499e41bf1158b4b3b9a46cf58263d695cc097
Parents: f4149c0
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Wed Nov 26 10:57:13 2014 -0500
Committer: Hiram Chirino <hiram@hiramchirino.com>
Committed: Wed Nov 26 10:57:13 2014 -0500

----------------------------------------------------------------------
 .../org/apache/activemq/leveldb/LevelDBStore.scala      |  4 ++--
 .../activemq/leveldb/replicated/SlaveLevelDBStore.scala | 12 +++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/4e3499e4/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 b10cd3e..49e8cfa 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
@@ -293,7 +293,7 @@ class LevelDBStore extends LockableServiceSupport with BrokerServiceAware
with P
       try {
         AnnotatedMBean.registerMBean(brokerService.getManagementContext, new LevelDBStoreView(this),
objectName)
         if( java.lang.Boolean.getBoolean("org.apache.activemq.leveldb.test") ) {
-          val name = new ObjectName(objectName.toString + ",test=test")
+          val name = new ObjectName(objectName.toString + ",view=Test")
           AnnotatedMBean.registerMBean(brokerService.getManagementContext, new LevelDBStoreTest(this),
name)
         }
       } catch {
@@ -353,7 +353,7 @@ class LevelDBStore extends LockableServiceSupport with BrokerServiceAware
with P
     if(brokerService!=null && brokerService.isUseJmx){
       brokerService.getManagementContext().unregisterMBean(objectName);
       if( java.lang.Boolean.getBoolean("org.apache.activemq.leveldb.test") )
-        brokerService.getManagementContext().unregisterMBean(new ObjectName(objectName.toString+",test=test"));
+        brokerService.getManagementContext().unregisterMBean(new ObjectName(objectName.toString+",view=Test"));
     }
     info("Stopped "+this)
   }

http://git-wip-us.apache.org/repos/asf/activemq/blob/4e3499e4/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala
index 0eddb0f..cbacc77 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.leveldb.replicated
 
-import org.apache.activemq.leveldb.{LevelDBClient, LevelDBStore}
+import org.apache.activemq.leveldb.{LevelDBStoreTest, LevelDBClient, LevelDBStore}
 import org.apache.activemq.util.ServiceStopper
 import java.util
 import org.fusesource.hawtdispatch._
@@ -30,6 +30,8 @@ import FileSupport._
 import java.io.{IOException, RandomAccessFile, File}
 import scala.beans.BeanProperty
 import java.util.concurrent.{CountDownLatch, TimeUnit}
+import javax.management.ObjectName
+import org.apache.activemq.broker.jmx.AnnotatedMBean
 
 object SlaveLevelDBStore extends Log
 
@@ -79,10 +81,18 @@ class SlaveLevelDBStore extends LevelDBStore with ReplicatedLevelDBStoreTrait
{
     db.client.dirtyIndexFile.recursiveDelete
     db.client.plistIndexFile.recursiveDelete
     start_slave_connections
+
+    if( java.lang.Boolean.getBoolean("org.apache.activemq.leveldb.test") ) {
+      val name = new ObjectName(objectName.toString + ",view=Test")
+      AnnotatedMBean.registerMBean(brokerService.getManagementContext, new LevelDBStoreTest(this),
name)
+    }
   }
 
   var stopped = false
   override def doStop(stopper: ServiceStopper) = {
+    if( java.lang.Boolean.getBoolean("org.apache.activemq.leveldb.test") )
+      brokerService.getManagementContext().unregisterMBean(new ObjectName(objectName.toString+",view=Test"));
+
     val latch = new CountDownLatch(1)
     stop_connections(^{
       latch.countDown


Mime
View raw message