1 23 package com.sun.enterprise.jbi.serviceengine.install; 24 import com.sun.enterprise.admin.common.MBeanServerFactory; 25 import com.sun.enterprise.jbi.serviceengine.ServiceEngineException; 26 import javax.management.MBeanServer ; 27 import javax.management.MBeanServerConnection ; 28 29 30 31 35 public class ServiceEngineObjectFactoryImpl 36 implements ServiceEngineObjectFactory { 37 38 private static ServiceEngineObjectFactoryImpl factoryObj = null; 39 private MBeanServer mbeanServer; 40 private Installer installer; 41 private MBeanHelper helper; 42 private String defaultDomainName; 43 44 45 private ServiceEngineObjectFactoryImpl() { 46 } 47 48 49 public static ServiceEngineObjectFactoryImpl getInstance() { 50 if(factoryObj == null) 51 factoryObj = new ServiceEngineObjectFactoryImpl(); 52 return factoryObj; 53 } 54 55 public Installer createInstaller() { 56 if (installer == null) 57 installer = new InstallerImpl(createMBeanHelper()); 58 return installer; 59 } 60 61 public MBeanHelper createMBeanHelper() { 62 if(helper == null) { 63 helper = new MBeanHelper(createMBeanServerConnection()); 64 } 65 return helper; 66 } 67 public MBeanServerConnection createMBeanServerConnection() { 68 try { 69 return MBeanServerFactory .getMBeanServer(); 70 } catch(Exception e) { 71 e.printStackTrace(); 72 } 73 return null; 74 } 75 } 76 | Popular Tags |