1 22 package org.jboss.mx.server; 23 24 import javax.management.MBeanServerBuilder ; 25 import javax.management.ObjectName ; 26 27 import org.jboss.mx.standardmbean.StandardMBeanDelegateFactory; 28 import org.jboss.mx.util.ObjectNameFactory; 29 import org.jboss.util.Classes; 30 31 37 public abstract class ServerConfig 38 { 39 41 42 private static ServerConfig instance; 43 44 49 private final static String JMI_DOMAIN = "JMImplementation"; 50 51 52 private final static String DEFAULT_DOMAIN = "DefaultDomain"; 53 54 55 private static final ObjectName mbeanServerDelegateName = ObjectNameFactory.create(JMI_DOMAIN + ":type=MBeanServerDelegate"); 56 57 58 public final static String SERVER_CONFIG_CLASS_PROPERTY = "jbossmx.server.config.class"; 59 60 61 public final static String DEFAULT_SERVER_CONFIG_CLASS = "org.jboss.mx.server.JBossMXServerConfig"; 62 63 64 public final static String MBEAN_SERVER_BUILDER_CLASS_PROPERTY = "javax.management.builder.initial"; 65 66 68 70 public static synchronized ServerConfig getInstance() 71 { 72 if (instance != null) 73 return instance; 74 instance = (ServerConfig) Classes.instantiate(ServerConfig.class, SERVER_CONFIG_CLASS_PROPERTY, DEFAULT_SERVER_CONFIG_CLASS); 75 return instance; 76 } 77 78 80 83 protected ServerConfig() 84 { 85 } 86 87 89 94 public String getDefaultDomain() 95 { 96 return DEFAULT_DOMAIN; 97 } 98 99 104 public String getJMIDomain() 105 { 106 return JMI_DOMAIN; 107 } 108 109 114 public ObjectName getMBeanServerDelegateName() 115 { 116 return mbeanServerDelegateName; 117 } 118 119 124 public MBeanServerBuilder getMBeanServerBuilder() 125 { 126 String defaultMBeanServerBuilder = getDefaultMBeanServerBuilderClassName(); 127 return (MBeanServerBuilder ) Classes.instantiate(MBeanServerBuilder .class, MBEAN_SERVER_BUILDER_CLASS_PROPERTY, defaultMBeanServerBuilder); 128 129 } 130 131 136 public abstract ObjectName getLoaderRepositoryName(); 137 138 143 public abstract StandardMBeanDelegateFactory getStandardMBeanDelegateFactory(); 144 145 147 protected abstract String getDefaultMBeanServerBuilderClassName(); 148 149 151 } 153 | Popular Tags |