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/deployment/task CreateMBeanInstance.java
Date Sun, 16 Nov 2003 00:49:22 GMT
djencks     2003/11/15 16:49:22

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task
                        CreateMBeanInstance.java
  Log:
  Fix problems constructing standard mbeans, fix constructor args
  
  Revision  Changes    Path
  1.5       +6 -23     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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CreateMBeanInstance.java	15 Nov 2003 19:16:42 -0000	1.4
  +++ CreateMBeanInstance.java	16 Nov 2003 00:49:22 -0000	1.5
  @@ -145,35 +145,18 @@
   
               // Create and register the MBean
               try {
  -                // Get the constructor arguments
  -                String[] constructorTypeStrings = metadata.getConstructorTypes();
  -                Object[] constructorValues = metadata.getConstructorArgs();
  -                for (int i = 0; i < constructorTypeStrings.length; i++) {
  -                    Class type = null;
  -                    try {
  -                        type = ParserUtil.loadClass(constructorTypeStrings[i], newCL);
  -                    } catch (ClassNotFoundException e) {
  -                        throw new DeploymentException(e, metadata);
  -                    }
  -
  -                    Object value = constructorValues[i];
  -                    if (value instanceof String) {
  -                        value = ParserUtil.getValue(type, (String) value, baseURI);
  -                        constructorValues[i] = value;
  -                    }
  -                }
   
                   // 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(constructorTypes);
  -                Object mbean = server.instantiate(metadata.getCode(),
  -                        metadata.getLoaderName(),
  +                Object mbean = ParserUtil.instantiate(metadata.getCode(),
                           metadata.getConstructorArgs(),
  -                        metadata.getConstructorTypes());
  +                        metadata.getConstructorTypes(),
  +                        baseURI,
  +                        newCL);
  +
                   actualName = server.registerMBean(mbean, metadata.getName()).getObjectName();
                   if (log.isTraceEnabled() && !actualName.equals(metadata.getName()))
{
                       log.trace("Actual MBean name is " + actualName);
  
  
  

Mime
View raw message