User: juhalindfors
Date: 02/01/28 15:33:06
Modified: src/main/javax/management MBeanServerFactory.java
Log:
JBossMX system properties moved to ServerConstants
DefaultLoaderRepository.loaders delegates to LoaderRepository.loaders
LoaderRepository now an abstract class
Revision Changes Path
1.3 +16 -12 jmx/src/main/javax/management/MBeanServerFactory.java
Index: MBeanServerFactory.java
===================================================================
RCS file: /cvsroot/jboss/jmx/src/main/javax/management/MBeanServerFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MBeanServerFactory.java 2001/12/09 00:23:00 1.2
+++ MBeanServerFactory.java 2002/01/28 23:33:06 1.3
@@ -14,21 +14,20 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
+import org.jboss.mx.server.ServerConstants;
+
/**
* MBeanServerFactory is used to create instances of MBean servers.
*
* @see javax.management.MBeanServer
*
* @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>.
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*
*/
public class MBeanServerFactory
{
- // Constants -----------------------------------------------------
- private final static String DEFAULT_DOMAIN = "DefaultDomain";
-
// Attributes ----------------------------------------------------
private static Map serverMap = new HashMap();
@@ -38,8 +37,9 @@
try
{
String agentID = (String)mbeanServer.getAttribute(
- new
ObjectName("JMImplementation:type=MBeanServerDelegate"),
- "MBeanServerId");
+ new ObjectName(ServerConstants.MBEAN_SERVER_DELEGATE),
+ "MBeanServerId"
+ );
Object server = serverMap.remove(agentID);
@@ -58,7 +58,7 @@
public static MBeanServer createMBeanServer()
{
- return createMBeanServer(DEFAULT_DOMAIN);
+ return createMBeanServer(ServerConstants.DEFAULT_DOMAIN);
}
public static MBeanServer createMBeanServer(String domain)
@@ -68,7 +68,7 @@
public static MBeanServer newMBeanServer()
{
- return newMBeanServer(DEFAULT_DOMAIN);
+ return newMBeanServer(ServerConstants.DEFAULT_DOMAIN);
}
public static MBeanServer newMBeanServer(String domain)
@@ -91,7 +91,10 @@
// Private -------------------------------------------------------
private static MBeanServer createMBeanServer(String defaultDomain, boolean
registerServer)
{
- String serverClass = System.getProperty("jbossmx.mbean.server.class",
"org.jboss.mx.server.MBeanServerImpl");
+ String serverClass = System.getProperty(
+ ServerConstants.MBEAN_SERVER_CLASS_PROPERTY,
+ ServerConstants.DEFAULT_MBEAN_SERVER_CLASS
+ );
try
{
@@ -103,9 +106,10 @@
if (registerServer)
{
String agentID = (String)server.getAttribute(
- new
ObjectName("JMImplementation:type=MBeanServerDelegate"),
- "MBeanServerId");
-
+ new ObjectName(ServerConstants.MBEAN_SERVER_DELEGATE),
+ "MBeanServerId"
+ );
+
serverMap.put(agentID, server);
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development