FileDocCategorySizeDatePackage
KernelAbstractionFactory.javaAPI DocJBoss 4.2.12907Fri Jul 13 20:53:58 BST 2007org.jboss.ejb3

KernelAbstractionFactory

public class KernelAbstractionFactory extends Object
version
$Revision: 46471 $
author
William DeCoste

Fields Summary
private static final Logger
log
private static ClientKernelAbstraction
clientKernelAbstraction
private static KernelAbstraction
kernelAbstraction
Constructors Summary
Methods Summary
public static ClientKernelAbstractiongetClientInstance()

      if (clientKernelAbstraction == null)
      {
         MBeanServerConnection mbeanServer = (MBeanServerConnection)getMBeanServer();
         clientKernelAbstraction = new JmxClientKernelAbstraction(mbeanServer);
      }
     
     return clientKernelAbstraction;
   
public static KernelAbstractiongetInstance()

  
        
     
      if (kernelAbstraction == null)
      {
         // TODO always use JmxKernelAbstraction in Branch_4_0
         MBeanServer mbeanServer = (MBeanServer)getMBeanServer();
         kernelAbstraction = new JmxKernelAbstraction(mbeanServer);
      }
     
     return kernelAbstraction;
   
protected static javax.management.MBeanServerConnectiongetMBeanServer()

      MBeanServerConnection mbeanServer;
         
      try
      {
         mbeanServer = org.jboss.mx.util.MBeanServerLocator.locateJBoss();
      }
      catch (IllegalStateException e)
      {
         String adaptorName = System.getProperty("jbosstest.server.name", "jmx/invoker/RMIAdaptor");
         mbeanServer = (MBeanServerConnection)InitialContextFactory.getInitialContext().lookup(adaptorName);
      }
      
      return mbeanServer;