[Jboss-cvs] JBossAS SVN: r55158 - branches/MC_VDF_WORK/system/src/main/org/jboss/system

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 4 00:58:34 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-04 00:58:32 -0400 (Fri, 04 Aug 2006)
New Revision: 55158

Modified:
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/ServiceController.java
Log:
Allow inject of both the MBeanServer and Kernel.

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/ServiceController.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/ServiceController.java	2006-08-04 04:50:43 UTC (rev 55157)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/ServiceController.java	2006-08-04 04:58:32 UTC (rev 55158)
@@ -109,7 +109,20 @@
    {
       return server;
    }
-   
+   public void setMBeanServer(final MBeanServer server)
+   {
+      this.server = server;
+   }
+
+   public Kernel getKernel()
+   {
+      return kernel;
+   }
+   public void setKernel(final Kernel kernel)
+   {
+      this.kernel = kernel;
+   }
+
    /**
     * Get the serviceBinding.
     * 
@@ -525,11 +538,13 @@
    {
       this.server = server;
 
-      // Bootstrap the microcontainer. 
-      // REVIEW: Should be an option to pass this to a specialised constructor
-      BasicBootstrap bootstrap = new BasicBootstrap();
-      bootstrap.run();
-      kernel = bootstrap.getKernel();
+      if( kernel == null )
+      {
+         // Bootstrap the microcontainer. 
+         BasicBootstrap bootstrap = new BasicBootstrap();
+         bootstrap.run();
+         kernel = bootstrap.getKernel();
+      }
 
       log.debug("Controller MBean online");
       return name == null ? OBJECT_NAME : name;




More information about the jboss-cvs-commits mailing list