[Jboss-cvs] JBossAS SVN: r55410 - trunk/ejb3/src/main/org/jboss/ejb3

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 8 12:39:33 EDT 2006


Author: bdecoste
Date: 2006-08-08 12:39:32 -0400 (Tue, 08 Aug 2006)
New Revision: 55410

Added:
   trunk/ejb3/src/main/org/jboss/ejb3/KernelAbstractionFactory.java
Log:
removed ServiceServer - merged into KernelAbstraction

Added: trunk/ejb3/src/main/org/jboss/ejb3/KernelAbstractionFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/KernelAbstractionFactory.java	2006-08-08 16:30:02 UTC (rev 55409)
+++ trunk/ejb3/src/main/org/jboss/ejb3/KernelAbstractionFactory.java	2006-08-08 16:39:32 UTC (rev 55410)
@@ -0,0 +1,75 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.ejb3;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerConnection;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.logging.Logger;
+
+/**
+ * @version <tt>$Revision: 46471 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class KernelAbstractionFactory
+{
+   private static final Logger log = Logger.getLogger(KernelAbstractionFactory.class);
+   
+   private static KernelAbstraction kernelAbstraction = null;
+   private static Kernel kernel = null;
+  
+   public static KernelAbstraction getInstance() throws Exception
+   {
+      
+      MBeanServer mbeanServer;
+      
+      try
+      {
+         mbeanServer = org.jboss.mx.util.MBeanServerLocator.locateJBoss();
+      }
+      catch (IllegalStateException e)
+      {
+         String adaptorName = System.getProperty("jbosstest.server.name", "jmx/invoker/RMIAdaptor");
+         mbeanServer = (MBeanServer)InitialContextFactory.getInitialContext().lookup(adaptorName);
+      }
+      
+      if (kernelAbstraction == null)
+      {
+         if (kernel != null)
+            kernelAbstraction = new MCKernelAbstraction(kernel, mbeanServer);
+         else
+         {
+            kernelAbstraction = new JmxKernelAbstraction(mbeanServer);
+         }
+      }
+     
+     return kernelAbstraction;
+  }
+  
+  public static void setKernel(Kernel k)
+  {
+     kernel = k;
+  }
+   
+}
+




More information about the jboss-cvs-commits mailing list