User: d_jencks
Date: 02/04/14 19:48:53
Modified: src/main/org/jboss/system/server ServerImpl.java
ServerInfo.java
Log:
Changed to use UnifiedLoaderRepository and UnifiedClassLoader from jbossmx. Removed
ServiceLibraries, UnifiedClassLoader, and MBeanClassLoader from jboss-system
Revision Changes Path
1.16 +26 -35 jboss-system/src/main/org/jboss/system/server/ServerImpl.java
Index: ServerImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerImpl.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ServerImpl.java 12 Apr 2002 05:01:39 -0000 1.15
+++ ServerImpl.java 15 Apr 2002 02:48:53 -0000 1.16
@@ -30,11 +30,14 @@
import org.jboss.logging.Logger;
-import org.jboss.system.ServiceLibraries;
-import org.jboss.system.UnifiedClassLoader;
-import org.jboss.system.MBeanClassLoader;
+//import org.jboss.system.ServiceLibraries;
+//import org.jboss.system.UnifiedClassLoader;
+//import org.jboss.system.UnifiedLoaderRepositoryClassLoader;
+import org.jboss.mx.loading.UnifiedClassLoader;
+import org.jboss.mx.server.ServerConstants;
import org.jboss.util.jmx.JMXExceptionDecoder;
+import org.jboss.util.jmx.ObjectNameFactory;
import org.jboss.util.file.FileSuffixFilter;
/**
@@ -47,11 +50,13 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class ServerImpl
implements Server, ServerImplMBean
{
+
+ private final static ObjectName DEFAULT_LOADER_NAME =
ObjectNameFactory.create(ServerConstants.DEFAULT_LOADER_NAME);
/**
* Class logger. We masqurade as Server for looks, but we log our
* impl type too.
@@ -247,39 +252,30 @@
server.registerMBean(this, ServerImplMBean.OBJECT_NAME);
server.registerMBean(config, ServerConfigImplMBean.OBJECT_NAME);
- // Initialize the MBean libraries repository
- server.registerMBean(ServiceLibraries.getLibraries(), null);
// Initialize spine boot libraries
- initBootLibraries();
+ UnifiedClassLoader ucl = initBootLibraries();
+
- // Create MBeanClassLoader for the base system
- ObjectName loaderName =
- new ObjectName("jboss.system", "service", "ServiceClassLoader");
-
- MBeanClassLoader mcl = new MBeanClassLoader(loaderName);
- server.registerMBean(mcl, loaderName);
- log.debug("Registered service classloader: " + loaderName);
-
- // Set ServiceClassLoader as classloader for the construction of
- // the basic system
- Thread.currentThread().setContextClassLoader(mcl);
+ //Set ServiceClassLoader as classloader for the construction of
+ //the basic system
+ Thread.currentThread().setContextClassLoader(ucl);
// Setup logging
- server.createMBean("org.jboss.logging.Log4jService", null, loaderName);
+ server.createMBean("org.jboss.logging.Log4jService", null);
log.debug("Logging has been initialized");
// General Purpose Architecture information
- server.createMBean("org.jboss.system.server.ServerInfo", null, loaderName);
+ server.createMBean("org.jboss.system.server.ServerInfo", null);
// Service Controller
ObjectName controllerName =
- server.createMBean("org.jboss.system.ServiceController", null,
loaderName).getObjectName();
+ server.createMBean("org.jboss.system.ServiceController",
null).getObjectName();
log.debug("Registered service controller: " + controllerName);
// Main Deployer
mainDeployer =
- server.createMBean("org.jboss.deployment.MainDeployer", null,
loaderName).getObjectName();
+ server.createMBean("org.jboss.deployment.MainDeployer",
null).getObjectName();
// Initialize the MainDeployer
server.invoke(controllerName,
@@ -307,11 +303,11 @@
ObjectName objectName;
// Jar Deployer
- objectName = server.createMBean("org.jboss.deployment.JARDeployer", null,
loaderName).getObjectName();
+ objectName = server.createMBean("org.jboss.deployment.JARDeployer",
null).getObjectName();
initService(controllerName, objectName);
// SAR Deployer
- objectName = server.createMBean("org.jboss.deployment.SARDeployer", null,
loaderName).getObjectName();
+ objectName = server.createMBean("org.jboss.deployment.SARDeployer",
null).getObjectName();
initService(controllerName, objectName);
log.info("Core system initialized");
@@ -357,7 +353,7 @@
/**
* Initialize the boot libraries.
*/
- private void initBootLibraries() throws Exception
+ private UnifiedClassLoader initBootLibraries() throws Exception
{
boolean debug = log.isDebugEnabled();
@@ -402,14 +398,11 @@
// URL libraryURL = config.getLibraryURL();
// list.add(new URL(libraryURL, "jboss-spine.jar"));
- if (debug)
- {
- log.debug("Boot url list: " + list);
- }
+ log.debug("Boot url list: " + list);
// Create loaders for each URL
- Iterator iter = list.iterator();
- while (iter.hasNext())
+ UnifiedClassLoader loader = null;
+ for (Iterator iter = list.iterator(); iter.hasNext();)
{
URL url = (URL)iter.next();
if (debug)
@@ -417,12 +410,10 @@
log.debug("Creating loader for URL: " + url);
}
- // Construction of URLClassLoader also registers with ServiceLibraries
- // Should probably remove this "side-effect" and make this more explicit
-
// This is a boot URL, so key it on itself.
- UnifiedClassLoader loader = new UnifiedClassLoader(url);
+ loader = new UnifiedClassLoader(url, server, DEFAULT_LOADER_NAME);
}
+ return loader;
}
/**
1.5 +17 -5 jboss-system/src/main/org/jboss/system/server/ServerInfo.java
Index: ServerInfo.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerInfo.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ServerInfo.java 4 Apr 2002 04:33:59 -0000 1.4
+++ ServerInfo.java 15 Apr 2002 02:48:53 -0000 1.5
@@ -19,8 +19,9 @@
import javax.management.MBeanRegistration;
import org.jboss.logging.Logger;
+import org.jboss.util.jmx.ObjectNameFactory;
+import org.jboss.mx.server.ServerConstants;
-import org.jboss.system.ServiceLibraries;
/**
* An MBean that provides a rich view of system information for the JBoss
@@ -33,11 +34,14 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Hiram Chirino</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class ServerInfo
implements ServerInfoMBean, MBeanRegistration
{
+ public static final ObjectName DEFAULT_LOADER_REPOSITORY =
ObjectNameFactory.create(ServerConstants.DEFAULT_LOADER_NAME);
+ //public static final ObjectName DEFAULT_LOADER_REPOSITORY =
ServiceController.DEFAULT_LOADER_REPOSITORY;
+
/** Class logger. */
private static final Logger log = Logger.getLogger(ServerInfo.class);
@@ -46,6 +50,8 @@
/** The cached host address for the server. */
private String hostAddress;
+
+ private MBeanServer server;
///////////////////////////////////////////////////////////////////////////
@@ -55,6 +61,7 @@
public ObjectName preRegister(MBeanServer server, ObjectName name)
throws Exception
{
+ this.server = server;
// Dump out basic JVM & OS info as INFO priority msgs
log.info("Java version: " +
System.getProperty("java.version") + "," +
@@ -252,10 +259,12 @@
*
* @jmx:managed-operation
*/
- public String displayInfoForClass(String className)
+ public String displayInfoForClass(String className) throws Exception
{
- ServiceLibraries libraries = ServiceLibraries.getLibraries();
- Class clazz = libraries.findClass(className);
+ Class clazz = (Class)server.invoke(DEFAULT_LOADER_REPOSITORY,
+ "findClass",
+ new Object[] {className},
+ new String[] {String.class.getName()});
if( clazz == null )
return "<h2>Class:"+className+" Not Found!</h2>";
Package pkg = clazz.getPackage();
@@ -279,6 +288,8 @@
*/
public String displayAllPackageInfo()
{
+ return "Broken right now";
+ /*
ClassLoader entryCL = Thread.currentThread().getContextClassLoader();
ServiceLibraries libraries = ServiceLibraries.getLibraries();
ClassLoader[] classLoaders = libraries.getClassLoaders();
@@ -304,6 +315,7 @@
}
Thread.currentThread().setContextClassLoader(entryCL);
return info.toString();
+ */
}
private void displayPackageInfo(Package pkg, StringBuffer info)
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development