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 DeployGeronimoMBean.java
Date Sun, 16 Nov 2003 00:48:37 GMT
djencks     2003/11/15 16:48:37

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task
                        DeployGeronimoMBean.java
  Log:
  Fix problems constructing mbeans, allow constructor args for default target.
  
  Revision  Changes    Path
  1.6       +13 -5     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task/DeployGeronimoMBean.java
  
  Index: DeployGeronimoMBean.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task/DeployGeronimoMBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DeployGeronimoMBean.java	15 Nov 2003 19:42:02 -0000	1.5
  +++ DeployGeronimoMBean.java	16 Nov 2003 00:48:37 -0000	1.6
  @@ -77,6 +77,7 @@
   import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
   import org.apache.geronimo.kernel.service.GeronimoMBeanInfoXMLLoader;
   import org.apache.geronimo.kernel.service.GeronimoAttributeInfo;
  +import org.apache.geronimo.kernel.service.ParserUtil;
   
   /**
    *
  @@ -128,10 +129,7 @@
                           //ignore
                       }
                   }
  -                GeronimoMBean mbean = (GeronimoMBean) server.instantiate("org.apache.geronimo.kernel.service.GeronimoMBean",
  -                        metadata.getLoaderName(),
  -                        metadata.getConstructorArgs(),
  -                        metadata.getConstructorTypes());
  +                GeronimoMBean mbean = new GeronimoMBean();
                   mbean.setClassSpace(metadata.getLoaderName());
                   GeronimoMBeanInfo geronimoMBeanInfo = metadata.getGeronimoMBeanInfo();
                   if (geronimoMBeanInfo == null) {
  @@ -149,6 +147,16 @@
                       attributeInfo.setInitialValue(metadataAttributes.get(attributeInfo.getName()));
                   }
                   mbean.setMBeanInfo(geronimoMBeanInfo);
  +                //If there are constructor args, build the default target ourselves.
  +                if (metadata.getConstructorArgs() != null) {
  +                    Object target = ParserUtil.instantiate(geronimoMBeanInfo.getTargetClass(),
  +                        metadata.getConstructorArgs(),
  +                        metadata.getConstructorTypes(),
  +                        metadata.getBaseURI(),
  +                        newCL);
  +
  +                    geronimoMBeanInfo.setTarget(target);
  +                }
                   server.registerMBean(mbean, metadata.getName());
                   registered = true;
   
  
  
  

Mime
View raw message