User: d_jencks
Date: 02/04/14 19:48:52
Modified: src/main/org/jboss/system ServiceController.java
ServiceCreator.java
Removed: src/main/org/jboss/system UnifiedClassLoader.java
ServiceLibraries.java MBeanClassLoader.java
Log:
Changed to use UnifiedLoaderRepository and UnifiedClassLoader from jbossmx. Removed
ServiceLibraries, UnifiedClassLoader, and MBeanClassLoader from jboss-system
Revision Changes Path
1.11 +34 -11 jboss-system/src/main/org/jboss/system/ServiceController.java
Index: ServiceController.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/ServiceController.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ServiceController.java 13 Apr 2002 16:10:11 -0000 1.10
+++ ServiceController.java 15 Apr 2002 02:48:51 -0000 1.11
@@ -39,8 +39,11 @@
import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
import org.jboss.util.jmx.JMXExceptionDecoder;
+import org.jboss.util.jmx.ObjectNameFactory;
import org.w3c.dom.Element;
+import org.jboss.mx.server.ServerConstants;
+
/**
* This is the main Service Controller. A controller can deploy a service to a
* jboss.system It installs by delegating, it configures by delegating
@@ -49,7 +52,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
- * @version $Revision: 1.10 $ <p>
+ * @version $Revision: 1.11 $ <p>
*
* <b>Revisions:</b> <p>
*
@@ -73,6 +76,7 @@
public class ServiceController
implements ServiceControllerMBean, MBeanRegistration, NotificationListener
{
+ public static final ObjectName DEFAULT_LOADER_REPOSITORY =
ObjectNameFactory.create(ServerConstants.DEFAULT_LOADER_NAME);
// Attributes ----------------------------------------------------
/** Class logger. */
@@ -106,6 +110,11 @@
*
*/
private Map waitingConfigs = new HashMap();
+
+ //notification handling
+ private final Object CLASSLOADER_ADDED_OBJECT = new Object();
+ private final Object CLASS_REMOVED_OBJECT = new Object();
+
// Constructors --------------------------------------------------
@@ -565,13 +574,21 @@
creator = new ServiceCreator(server);
configurator = new ServiceConfigurator(server, this, creator);
- NotificationFilterSupport filter = new NotificationFilterSupport();
- filter.enableType(ServiceLibraries.CLASS_REMOVED_NOTIFICATION);
+ NotificationFilterSupport removeFilter = new NotificationFilterSupport();
+ removeFilter.enableType(ServerConstants.CLASS_REMOVED);
+
+ server.addNotificationListener(DEFAULT_LOADER_REPOSITORY,
+ this,
+ removeFilter,
+ CLASS_REMOVED_OBJECT);
+
+ NotificationFilterSupport addFilter = new NotificationFilterSupport();
+ addFilter.enableType(ServerConstants.CLASSLOADER_ADDED);
- server.addNotificationListener(ServiceLibrariesMBean.OBJECT_NAME,
+ server.addNotificationListener(DEFAULT_LOADER_REPOSITORY,
this,
- filter,
- null);
+ addFilter,
+ CLASSLOADER_ADDED_OBJECT);
log.info("Controller MBean online");
return name == null ? OBJECT_NAME : name;
@@ -588,7 +605,7 @@
public void preDeregister()
throws Exception
{
- server.removeNotificationListener(ServiceLibrariesMBean.OBJECT_NAME, this);
+ server.removeNotificationListener(DEFAULT_LOADER_REPOSITORY, this);
}
public void postDeregister()
@@ -667,8 +684,15 @@
public void handleNotification(Notification notification, Object handback)
{
- String className = notification.getMessage();
- unregisterClassName(className);
+ if (handback == CLASSLOADER_ADDED_OBJECT)
+ {
+ newClassLoaderNotification();
+ } // end of if ()
+ else if (handback == CLASS_REMOVED_OBJECT)
+ {
+ String className = notification.getMessage();
+ unregisterClassName(className);
+ } // end of if ()
}
void unregisterClassName(String className)
@@ -703,9 +727,8 @@
/**
* Describe <code>newClassLoaderNotification</code> method here.
- * @jmx:managed-operation
*/
- public void newClassLoaderNotification()
+ private void newClassLoaderNotification()
{
log.trace("Scanning for newly supplied classes for waiting mbeans");
Map waiting = null;
1.4 +6 -5 jboss-system/src/main/org/jboss/system/ServiceCreator.java
Index: ServiceCreator.java
===================================================================
RCS file: /cvsroot/jboss/jboss-system/src/main/org/jboss/system/ServiceCreator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ServiceCreator.java 4 Apr 2002 17:49:18 -0000 1.3
+++ ServiceCreator.java 15 Apr 2002 02:48:51 -0000 1.4
@@ -30,7 +30,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*
* <p><b>Revisions:</b>
* <p><b>2001/08/03 marcf </b>
@@ -69,7 +69,7 @@
{
throw new DeploymentException("Trying to install an already registered mbean:
" + mbeanName);
}
-
+ /*
// marcf fixme add and remove the classloader from the controller
ObjectName loader = new ObjectName("jboss.system.classloader:id=" +
@@ -79,7 +79,7 @@
if (!server.isRegistered(loader))
server.registerMBean(cl, loader);
-
+ */
// If class is given, instantiate it
String code = mbeanElement.getAttribute("code");
if (code == null)
@@ -103,7 +103,7 @@
}
ObjectInstance instance = server.createMBean(code,
mbeanName,
- loader,
+ //loader,
constructor.params,
constructor.signature);
if (debug)
@@ -142,7 +142,7 @@
// Remove the MBean from the MBeanServer
server.unregisterMBean(name);
-
+ /*
// Remove the MBeanClassLoader used by the MBean
ObjectName loader = new ObjectName("jboss.system.classloader:id=" + hcode);
if (server.isRegistered(loader))
@@ -151,6 +151,7 @@
if (log.isDebugEnabled())
log.debug("unregistered caossloader for: " + name);
}
+ */
}
/**
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development