geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task CreateMBeanInstance.java
Date Tue, 11 Nov 2003 04:39:37 GMT
dain        2003/11/10 20:39:37

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task
                        CreateMBeanInstance.java
  Log:
  GeronimoMBean deployment code has been moved to DeployGeronimoMBean.
  
  Revision  Changes    Path
  1.3       +14 -28    incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task/CreateMBeanInstance.java
  
  Index: CreateMBeanInstance.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task/CreateMBeanInstance.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CreateMBeanInstance.java	27 Oct 2003 21:32:20 -0000	1.2
  +++ CreateMBeanInstance.java	11 Nov 2003 04:39:37 -0000	1.3
  @@ -68,21 +68,19 @@
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
   import javax.management.ReflectionException;
  -import javax.management.JMException;
   import javax.management.relation.RelationServiceMBean;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.apache.geronimo.kernel.classspace.ClassSpaceException;
  +import org.apache.geronimo.kernel.classspace.ClassSpaceUtil;
   import org.apache.geronimo.kernel.deployment.DependencyServiceMBean;
   import org.apache.geronimo.kernel.deployment.DeploymentException;
   import org.apache.geronimo.kernel.deployment.service.MBeanDependencyMetadata;
   import org.apache.geronimo.kernel.deployment.service.MBeanMetadata;
   import org.apache.geronimo.kernel.deployment.service.MBeanRelationshipMetadata;
   import org.apache.geronimo.kernel.jmx.JMXUtil;
  -import org.apache.geronimo.kernel.service.GeronimoMBean;
   import org.apache.geronimo.kernel.service.ParserUtil;
  -import org.apache.geronimo.kernel.classspace.ClassSpaceUtil;
  -import org.apache.geronimo.kernel.classspace.ClassSpaceException;
   
   /**
    * Creates an new MBean instance and intializes it according to the specified MBeanMetadata
metadata
  @@ -169,28 +167,17 @@
                       }
                   }
   
  -                if (metadata.getGeronimoMBeanInfo() != null) {
  -                    if (log.isTraceEnabled()) {
  -                        log.trace("Creating GeronimoMBean name=" + metadata.getName());
  -                    }
  -                    GeronimoMBean mbean = (GeronimoMBean) server.instantiate("org.apache.geronimo.kernel.service.GeronimoMBean");
  -                    mbean.setClassSpace(metadata.getLoaderName());
  -                    mbean.setMBeanInfo(metadata.getGeronimoMBeanInfo());
  -                    server.registerMBean(mbean, metadata.getName());
  -                    actualName = metadata.getName();
  -                } else {
  -                    // Create the mbean
  -                    if (log.isTraceEnabled()) {
  -                        log.trace("Creating MBean name=" + metadata.getName() + " class="
+ metadata.getCode());
  -                    }
  +                // Create the mbean
  +                if (log.isTraceEnabled()) {
  +                    log.trace("Creating MBean name=" + metadata.getName() + " class=" +
metadata.getCode());
  +                }
   
  -                    Class mbeanClass = newCL.loadClass(metadata.getCode());
  -                    Constructor mbeanConstructor = mbeanClass.getConstructor((Class[])
constructorTypes.toArray(new Class[constructorTypes.size()]));
  -                    Object mbean = mbeanConstructor.newInstance(constructorValues.toArray());
  -                    actualName = server.registerMBean(mbean, metadata.getName()).getObjectName();
  -                    if (log.isTraceEnabled() && !actualName.equals(metadata.getName()))
{
  -                        log.trace("Actual MBean name is " + actualName);
  -                    }
  +                Class mbeanClass = newCL.loadClass(metadata.getCode());
  +                Constructor mbeanConstructor = mbeanClass.getConstructor((Class[]) constructorTypes.toArray(new
Class[constructorTypes.size()]));
  +                Object mbean = mbeanConstructor.newInstance(constructorValues.toArray());
  +                actualName = server.registerMBean(mbean, metadata.getName()).getObjectName();
  +                if (log.isTraceEnabled() && !actualName.equals(metadata.getName()))
{
  +                    log.trace("Actual MBean name is " + actualName);
                   }
                   metadata.setName(actualName);
   
  @@ -227,11 +214,10 @@
           }
   
           ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
  -        ClassLoader newCL;
           try {
               // Set the class loader
               try {
  -                newCL = ClassSpaceUtil.setContextClassLoader(server, metadata.getLoaderName());
  +                ClassSpaceUtil.setContextClassLoader(server, metadata.getLoaderName());
               } catch (ClassSpaceException e) {
                   log.warn("Could not set context class loader", e);
                   return;
  
  
  

Mime
View raw message