Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-01-27 10:26:14 -0500
committerChristopher Frost2012-01-27 10:26:14 -0500
commit628b3d97ca4dbfc55d9dc5862e6c0bec4cee86c2 (patch)
treebf249c966dbe4e5cc17620eb7df0a1327af47b49
parent127b5d9f17cde880fd23f2494f8ea6f5b87d7a36 (diff)
downloadorg.eclipse.virgo.medic-628b3d97ca4dbfc55d9dc5862e6c0bec4cee86c2.tar.gz
org.eclipse.virgo.medic-628b3d97ca4dbfc55d9dc5862e6c0bec4cee86c2.tar.xz
org.eclipse.virgo.medic-628b3d97ca4dbfc55d9dc5862e6c0bec4cee86c2.zip
368157 Medic now registers the Platform MBean server in the service registry364571-introduce-nano
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java7
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java2
2 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
index e4a2880..2588294 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
@@ -11,6 +11,10 @@
package org.eclipse.virgo.medic.impl;
+import java.lang.management.ManagementFactory;
+
+import javax.management.MBeanServer;
+
import org.eclipse.equinox.log.ExtendedLogReaderService;
import org.eclipse.virgo.medic.dump.DumpGenerator;
import org.eclipse.virgo.medic.impl.config.ConfigurationAdminConfigurationProvider;
@@ -56,6 +60,9 @@ public final class MedicActivator implements BundleActivator {
logController.eventLogStart();
DumpGenerator dumpGenerator = logController.dumpStart();
+ //Register the platformMBeanServer with
+ MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
+ context.registerService(MBeanServer.class, platformMBeanServer, null);
this.medicMBeanExporter = new MedicMBeanExporter(configurationProvider, dumpGenerator);
this.logReaderReference = context.getServiceReference(ExtendedLogReaderService.class);
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
index 2d75076..b990e75 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
@@ -76,7 +76,7 @@ public class MedicActivatorTests {
assertFalse(this.server.isRegistered(new ObjectName("org.eclipse.virgo.kernel:type=Medic,name=DumpInspector")));
- assertEquals(1, bundleContext.getServiceRegistrations().size());
+ assertEquals(2, bundleContext.getServiceRegistrations().size());
}
@Test

Back to the top