geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/config Configuration.java
Date Tue, 06 Jul 2004 17:11:30 GMT
djencks     2004/07/06 10:11:30

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/config
                        Configuration.java
  Log:
  Use kernel, not mbean server, to load and unload gbeans
  
  Revision  Changes    Path
  1.26      +3 -6      incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
  
  Index: Configuration.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Configuration.java	10 Jun 2004 02:26:30 -0000	1.25
  +++ Configuration.java	6 Jul 2004 17:11:29 -0000	1.26
  @@ -37,7 +37,6 @@
   import java.util.Set;
   import javax.management.AttributeNotFoundException;
   import javax.management.JMRuntimeException;
  -import javax.management.MBeanServer;
   import javax.management.ObjectName;
   import javax.management.ReflectionException;
   
  @@ -168,14 +167,13 @@
               gbeans = loadGBeans(gbeanState, classLoader);
   
               // register all the GBeans
  -            MBeanServer mbServer = kernel.getMBeanServer();
               for (Iterator i = gbeans.entrySet().iterator(); i.hasNext();) {
                   Map.Entry entry = (Map.Entry) i.next();
                   ObjectName name = (ObjectName) entry.getKey();
                   GBeanMBean gbean = (GBeanMBean) entry.getValue();
                   log.trace("Registering GBean " + name);
                   try {
  -                    mbServer.registerMBean(gbean, name);
  +                    kernel.loadGBean(name, gbean);
                   } catch (JMRuntimeException e) {
                       Throwable cause = e.getCause();
                       if (cause instanceof Exception) {
  @@ -201,13 +199,12 @@
           }
   
           // unregister all GBeans
  -        MBeanServer mbServer = kernel.getMBeanServer();
           for (Iterator i = gbeans.keySet().iterator(); i.hasNext();) {
               ObjectName name = (ObjectName) i.next();
               kernel.getDependencyManager().removeDependency(name, objectName);
               try {
                   log.trace("Unregistering GBean " + name);
  -                mbServer.unregisterMBean(name);
  +                kernel.unloadGBean(name);
               } catch (Exception e) {
                   // ignore
                   log.warn("Could not unregister child " + name, e);
  
  
  

Mime
View raw message