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/jmx JMXKernel.java
Date Sat, 15 Nov 2003 07:37:38 GMT
djencks     2003/11/14 23:37:37

  Modified:    modules/core/src/java/org/apache/geronimo/connector/deployment
                        ConnectorDeploymentPlanner.java
               modules/core/src/java/org/apache/geronimo/ejb/metadata
                        TransactionDemarcation.java
               modules/kernel/src/java/org/apache/geronimo/kernel/deployment
                        AbstractDeploymentPlanner.java
               modules/kernel/src/java/org/apache/geronimo/kernel/deployment/service
                        MBeanMetadata.java
               modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task
                        DeployGeronimoMBean.java
               modules/kernel/src/java/org/apache/geronimo/kernel/jmx
                        JMXKernel.java
  Added:       modules/core/src/java/org/apache/geronimo/connector/deployment
                        ConnectorDeploymentHelper.java
               modules/kernel/src/java/org/apache/geronimo/kernel/deployment
                        DeploymentHelper.java
  Removed:     modules/core/src/java/org/apache/geronimo/connector/deployment
                        DeploymentHelper.java
  Log:
  Move stuff around to make a generic DeploymentHelper class usable for all package types.
 Also include constructor args for principal target in GeronimoMBean.
  
  Revision  Changes    Path
  1.3       +52 -16    incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/deployment/ConnectorDeploymentPlanner.java
  
  Index: ConnectorDeploymentPlanner.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/deployment/ConnectorDeploymentPlanner.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectorDeploymentPlanner.java	14 Nov 2003 16:27:34 -0000	1.2
  +++ ConnectorDeploymentPlanner.java	15 Nov 2003 07:37:37 -0000	1.3
  @@ -116,6 +116,7 @@
    */
   public class ConnectorDeploymentPlanner
           extends AbstractDeploymentPlanner {
  +
       private static final Log log = LogFactory.getLog(ConnectorDeploymentPlanner.class);
   
       public static GeronimoMBeanInfo getGeronimoMBeanInfo() {
  @@ -141,9 +142,9 @@
       protected boolean addURL(DeployURL goal, Set goals, Set plans)
               throws DeploymentException {
           URL url = goal.getUrl();
  -        DeploymentHelper dHelper =
  -                new DeploymentHelper(url, goal.getType());
  -        URL raURL = dHelper.locateDD();
  +        ConnectorDeploymentHelper dHelper =
  +                new ConnectorDeploymentHelper(url, goal.getType());
  +        URL raURL = dHelper.locateJ2eeDD();
           URL graURL = dHelper.locateGeronimoDD();
           // Is the specific URL deployable?
           if (null == raURL) {
  @@ -201,11 +202,11 @@
           if (gra.getResourceAdapterClass() != null) {
               MBeanMetadata raMD = getMBeanMetadata(raCS.getName(), deploymentUnitName, baseURI);
               raMD.setCode(gra.getResourceAdapterClass());
  -            raMD.setName(dHelper.buildResourceAdapterDeploymentName(gra));
  +            raMD.setName(buildResourceAdapterDeploymentName(gra));
               configureMBeanMetadata(gra.getConfigProperty(), raMD);
               addTasks(raMD, deploymentPlan);
               resourceAdapterName = raMD.getName();
  -            ObjectName bootstrapContextName = dHelper.buildBootstrapContextName(gra);
  +            ObjectName bootstrapContextName = buildBootstrapContextName(gra);
               ResourceAdapterHelperImpl.addMBeanInfo(raMD.getGeronimoMBeanInfo(), bootstrapContextName);
           }
   
  @@ -219,14 +220,14 @@
               assert gcmf != null: "Null GeronimoConnectionManagerFactory";
               MBeanMetadata cmfMD = getMBeanMetadata(raCS.getName(), deploymentUnitName,
baseURI);
               cmfMD.setGeronimoMBeanDescriptor(gcmf.getConnectionManagerFactoryDescriptor());
  -            cmfMD.setName(dHelper.buildConnectionManagerFactoryDeploymentName(gcd));
  +            cmfMD.setName(buildConnectionManagerFactoryDeploymentName(gcd));
               adaptConfigProperties(gcmf.getConfigProperty(), null, cmfMD.getAttributeValues());
               addTasks(cmfMD, deploymentPlan);
   
   
               MBeanMetadata mcfMD = getMBeanMetadata(raCS.getName(), deploymentUnitName,
baseURI);
               mcfMD.setCode(gcd.getManagedConnectionFactoryClass());
  -            mcfMD.setName(dHelper.buildManagedConnectionFactoryDeploymentName(gcd));
  +            mcfMD.setName(buildManagedConnectionFactoryDeploymentName(gcd));
               configureMBeanMetadata(gcd.getConfigProperty(), mcfMD);
               ManagedConnectionFactoryHelper.addMBeanInfo(mcfMD.getGeronimoMBeanInfo(), resourceAdapterName,
cmfMD.getName());
               Map attributes = mcfMD.getAttributeValues();
  @@ -272,14 +273,6 @@
           return false;
       }
   
  -    private MBeanMetadata getMBeanMetadata(ObjectName loader, ObjectName parent, URI baseURI)
{
  -        MBeanMetadata metadata = new MBeanMetadata();
  -        metadata.setLoaderName(loader);
  -        metadata.setParentName(parent);
  -        metadata.setBaseURI(baseURI);
  -        return metadata;
  -    }
  -
       private void configureMBeanMetadata(ConfigProperty[] props, MBeanMetadata metadata)
throws DeploymentException {
           GeronimoMBeanInfo info = new GeronimoMBeanInfo();
           info.setTargetClass(metadata.getCode());
  @@ -336,5 +329,48 @@
           e.initCause(aThrowable);
           throw e;
       }
  +
  +
  +    /**
  +     * Build the name of the Connector deployment related to this URL.
  +     *
  +     * @return Connector deployment name.
  +     */
  +
  +    private ObjectName buildResourceAdapterDeploymentName(GeronimoResourceAdapter gra)
{
  +        return JMXUtil.getObjectName(
  +                "geronimo.management:j2eeType=JCAResourceAdapter,name="
  +                + gra.getName());
  +    }
  +
  +    private ObjectName buildManagedConnectionFactoryDeploymentName(GeronimoConnectionDefinition
gcd) {
  +        return JMXUtil.getObjectName(
  +                "geronimo.management:j2eeType=JCAManagedConnectionFactory,name="
  +                + gcd.getName());
  +    }
  +
  +
  +    private ObjectName buildConnectionManagerFactoryDeploymentName(GeronimoConnectionDefinition
gcd) {
  +        return JMXUtil.getObjectName(
  +                "geronimo.management:j2eeType=ConnectionManager,name="
  +                + gcd.getName());
  +    }
  +
  +
  +    private ObjectName buildMCFHelperDeploymentName(GeronimoConnectionDefinition gcd) {
  +        return JMXUtil.getObjectName(
  +                "geronimo.management:j2eeType=MCFHelper,name="
  +                + gcd.getName());
  +    }
  +
  +    /**
  +     * @param gra
  +     * @return
  +     */
  +    private ObjectName buildBootstrapContextName(GeronimoResourceAdapter gra) {
  +        return JMXUtil.getObjectName(
  +                gra.getBootstrapContext());
  +    }
  +
   
   }
  
  
  
  1.1                  incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/deployment/ConnectorDeploymentHelper.java
  
  Index: ConnectorDeploymentHelper.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment;
  
  import java.net.URL;
  import java.net.MalformedURLException;
  import java.util.List;
  import java.util.Enumeration;
  import java.util.jar.JarFile;
  import java.util.jar.JarEntry;
  import java.io.File;
  import java.io.FileFilter;
  import java.io.IOException;
  
  import org.apache.geronimo.kernel.deployment.DeploymentException;
  import org.apache.geronimo.kernel.deployment.DeploymentHelper;
  import org.apache.geronimo.kernel.deployment.scanner.URLType;
  
  /**
   * Connector deployment helper. It allows to compute various information of
   * a URL to be deployed.
   *
   * @version $Revision: 1.1 $ $Date: 2003/11/15 07:37:37 $
   */
  public class ConnectorDeploymentHelper extends DeploymentHelper {
  
      public ConnectorDeploymentHelper(URL url, URLType urlType) throws DeploymentException
{
          super(url, urlType, "Connector", ".rar", "ra.xml", "geronimo-ra.xml");
      }
  
      protected void findUnpackedArchives(List archives) throws DeploymentException {
          File rootDeploy = new File(url.getFile());
          File[] jarFiles = rootDeploy.listFiles(new FileFilter() {
              public boolean accept(File pathname) {
                  return pathname.getName().endsWith(".jar");
              }
          });
          for (int i = 0; i < jarFiles.length; i++) {
              try {
                  archives.add(jarFiles[i].toURL());
              } catch (MalformedURLException e) {
                  throw new DeploymentException("Should never occurs", e);
              }
          }
          // TODO handle the .so and .dll entries.
      }
  
      protected void findPackedArchives(List archives) throws DeploymentException {
          String rootJar = "jar:" + url.toExternalForm();
          try {
              JarFile jFile = new JarFile(url.getFile());
              Enumeration entries = jFile.entries();
              while (entries.hasMoreElements()) {
                  JarEntry jEntry = (JarEntry) entries.nextElement();
                  if (jEntry.isDirectory()) {
                      continue;
                  }
                  if (jEntry.getName().endsWith(".jar")) {
                      archives.add(
                              new URL(rootJar + "!/" + jEntry.getName()));
                  }
                  // TODO handle the .so and .dll entries.
              }
          } catch (IOException e) {
              throw new DeploymentException("Should never occurs", e);
          }
      }
  
  
  }
  
  
  
  1.4       +2 -1      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/metadata/TransactionDemarcation.java
  
  Index: TransactionDemarcation.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/metadata/TransactionDemarcation.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TransactionDemarcation.java	1 Nov 2003 16:25:11 -0000	1.3
  +++ TransactionDemarcation.java	15 Nov 2003 07:37:37 -0000	1.4
  @@ -93,4 +93,5 @@
           }
       }
   
  +
   }
  
  
  
  1.2       +15 -0     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/AbstractDeploymentPlanner.java
  
  Index: AbstractDeploymentPlanner.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/AbstractDeploymentPlanner.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractDeploymentPlanner.java	14 Nov 2003 16:27:34 -0000	1.1
  +++ AbstractDeploymentPlanner.java	15 Nov 2003 07:37:37 -0000	1.2
  @@ -59,8 +59,10 @@
   import java.util.Set;
   import java.util.HashSet;
   import java.util.Iterator;
  +import java.net.URI;
   
   import javax.management.MBeanServer;
  +import javax.management.ObjectName;
   
   import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
   import org.apache.geronimo.kernel.service.GeronimoOperationInfo;
  @@ -71,6 +73,7 @@
   import org.apache.geronimo.kernel.deployment.goal.DeployURL;
   import org.apache.geronimo.kernel.deployment.goal.RedeployURL;
   import org.apache.geronimo.kernel.deployment.goal.UndeployURL;
  +import org.apache.geronimo.kernel.deployment.service.MBeanMetadata;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -138,6 +141,10 @@
           this.context = context;
       }
   
  +    protected GeronimoMBeanContext getMBeanContext() {
  +        return context;
  +    }
  +
       public boolean canStart() {
           return true;
       }
  @@ -157,6 +164,14 @@
   
       protected MBeanServer getServer() {
           return context.getServer();
  +    }
  +
  +    protected MBeanMetadata getMBeanMetadata(ObjectName loader, ObjectName parent, URI
baseURI) {
  +        MBeanMetadata metadata = new MBeanMetadata();
  +        metadata.setLoaderName(loader);
  +        metadata.setParentName(parent);
  +        metadata.setBaseURI(baseURI);
  +        return metadata;
       }
   
   }
  
  
  
  1.1                  incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/DeploymentHelper.java
  
  Index: DeploymentHelper.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.kernel.deployment;
  
  import java.net.URL;
  import java.net.MalformedURLException;
  import java.util.List;
  import java.util.Enumeration;
  import java.util.jar.JarFile;
  import java.util.jar.JarEntry;
  import java.io.IOException;
  import java.io.File;
  import java.io.FileFilter;
  
  import javax.management.ObjectName;
  
  import org.apache.geronimo.kernel.deployment.service.ClassSpaceMetadata;
  import org.apache.geronimo.kernel.deployment.scanner.URLType;
  import org.apache.geronimo.kernel.service.GeronimoMBeanInfoXMLLoader;
  import org.apache.geronimo.kernel.jmx.JMXUtil;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2003/11/15 07:37:37 $
   *
   * */
  public class DeploymentHelper {
      protected final URL url;
      protected final URLType urlType;
      protected final URL j2eeURL;
      protected final URL geronimoURL;
      private final String objectNameTypeName;
  
      /**
       * Creates an helper related to the specified deployment URL.
       *
       * @param url Deployment URL.
       * @param urlType Type of the URL.
       */
      public DeploymentHelper(URL url, URLType urlType, String objectNameTypeName, String
archiveType, String j2eeDDName, String geronimoDDName) throws DeploymentException {
          this.url = url;
          this.urlType = urlType;
          this.objectNameTypeName = objectNameTypeName;
          try {
              if (URLType.PACKED_ARCHIVE == urlType) {
                  if (!this.url.getPath().endsWith(archiveType)) {
                      j2eeURL = null;
                      geronimoURL = null;
                      return;
                  }
                  j2eeURL = new URL("jar:" + this.url.toExternalForm() + "!/META-INF/" + j2eeDDName);
                  geronimoURL = new URL("jar:" + this.url.toExternalForm() + "!/META-INF/"
+ geronimoDDName);
              } else if (URLType.UNPACKED_ARCHIVE == urlType) {
                  j2eeURL = new URL(this.url, "META-INF/" + j2eeDDName);
                  geronimoURL = new URL(this.url, "META-INF/" + geronimoDDName);
              } else {
                  j2eeURL = null;
                  geronimoURL = null;
                  return;
              }
          } catch (MalformedURLException e1) {
              throw new DeploymentException("Should never occur", e1);
          }
      }
      /**
       * Locates the URL referencing the ra.xml deployment descriptor.
       *
       * @return URL referening ra.xml or null if no deployment descriptor is
       * found.
       *
       * @throws org.apache.geronimo.kernel.deployment.DeploymentException
       */
      public URL locateJ2eeDD() throws DeploymentException {
          return j2eeURL;
      }
  
      public URL locateGeronimoDD() throws DeploymentException {
          return geronimoURL;
      }
  
      /**
       * Build a ClassSpaceMetadata abstracting the connector archives.
       * <P>
       * The connector archives are all the .jar, .so or .dll files contained
       * by the deployment unit.
       *
       * @return ClassSpaceMetadata referencing the connector archives.
       *
       * @throws org.apache.geronimo.kernel.deployment.DeploymentException
       */
      public ClassSpaceMetadata buildClassSpace() throws DeploymentException {
          ClassSpaceMetadata classSpaceMetaData = new ClassSpaceMetadata();
          classSpaceMetaData.setName(buildClassSpaceName());
          classSpaceMetaData.setGeronimoMBeanInfo(GeronimoMBeanInfoXMLLoader.loadMBean(
                  ClassLoader.getSystemResource("org/apache/geronimo/kernel/classspace/classspace-mbean.xml")
          ));
          classSpaceMetaData.setParent(JMXUtil.getObjectName("geronimo.system:role=ClassSpace,name=System"));
  
          List archives = classSpaceMetaData.getUrls();
  
          if (URLType.PACKED_ARCHIVE == urlType) {
              findPackedArchives(archives);
          } else if (URLType.UNPACKED_ARCHIVE == urlType) {
              findUnpackedArchives(archives);
          } else {
              throw new DeploymentException("Should never occurs");
          }
          return classSpaceMetaData;
      }
      /**
       * Intended to be overridden for all but the simplest packages
       * @param archives
       * @throws DeploymentException
       */
      protected void findUnpackedArchives(List archives) throws DeploymentException {
          archives.add(url);
      }
  
      /**
       * Intended to be overridden for all but the simplest packages
       * @param archives
       * @throws DeploymentException
       */
      protected void findPackedArchives(List archives) throws DeploymentException {
          archives.add(url);
      }
  
      /**
       * Build a connector deployment name.
       *
       * @return Connector deployment name.
       */
      public ObjectName buildDeploymentName() {
          return JMXUtil.getObjectName(
                  "geronimo.deployment:role=DeploymentUnit,url="
                  + ObjectName.quote(url.toString())
                  + ",type=" + objectNameTypeName);
      }
  
      /**
       * Build the name of the ClassSpace which is used as the ClassLoader of the
       * URL to be deployed.
       *
       * @return ClassSpace name.
       */
      public ObjectName buildClassSpaceName() {
          return JMXUtil.getObjectName(
                  "geronimo.deployment:role=DeploymentUnitClassSpace,url="
                  + ObjectName.quote(url.toString())
                  + ",type=" + objectNameTypeName);
      }
  
  
  }
  
  
  
  1.4       +24 -5     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/service/MBeanMetadata.java
  
  Index: MBeanMetadata.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/service/MBeanMetadata.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MBeanMetadata.java	11 Nov 2003 16:37:31 -0000	1.3
  +++ MBeanMetadata.java	15 Nov 2003 07:37:37 -0000	1.4
  @@ -80,8 +80,8 @@
       private ObjectName loaderName;
       private ObjectName parentName;
       private URI baseURI;
  -    private final List constructorTypes = new ArrayList();
  -    private final List constructorArgs = new ArrayList();
  +    private String[] constructorTypes;
  +    private Object[] constructorArgs;
       private final Map attributeValues = new HashMap();
       private final Set relationships = new HashSet();
       private final Set dependencies = new HashSet();
  @@ -118,6 +118,25 @@
           this.parentName = parentName;
       }
   
  +    public MBeanMetadata(ObjectName name,
  +                         GeronimoMBeanInfo geronimoMBeanInfo,
  +                         ObjectName loaderName,
  +                         ObjectName parentName,
  +                         Object[] constructorArgs,
  +                         String[] constructorTypes) {
  +        this.name = name;
  +        this.geronimoMBeanInfo = geronimoMBeanInfo;
  +        this.loaderName = loaderName;
  +        this.parentName = parentName;
  +        this.constructorArgs = constructorArgs;
  +        this.constructorTypes = constructorTypes;
  +    }
  +
  +    public void setConstructorArgs(Object[] constructorArgs, String[] constructorTypes)
{
  +        this.constructorArgs = constructorArgs;
  +        this.constructorTypes = constructorTypes;
  +    }
  +
       public String getCode() {
           return code;
       }
  @@ -182,11 +201,11 @@
           return attributeValues;
       }
   
  -    public List getConstructorArgs() {
  +    public Object[] getConstructorArgs() {
           return constructorArgs;
       }
   
  -    public List getConstructorTypes() {
  +    public String[] getConstructorTypes() {
           return constructorTypes;
       }
   
  
  
  
  1.4       +5 -2      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DeployGeronimoMBean.java	14 Nov 2003 16:21:03 -0000	1.3
  +++ DeployGeronimoMBean.java	15 Nov 2003 07:37:37 -0000	1.4
  @@ -123,7 +123,10 @@
                           //ignore
                       }
                   }
  -                GeronimoMBean mbean = (GeronimoMBean) server.instantiate("org.apache.geronimo.kernel.service.GeronimoMBean");
  +                GeronimoMBean mbean = (GeronimoMBean) server.instantiate("org.apache.geronimo.kernel.service.GeronimoMBean",
  +                        metadata.getLoaderName(),
  +                        metadata.getConstructorArgs(),
  +                        metadata.getConstructorTypes());
                   mbean.setClassSpace(metadata.getLoaderName());
                   GeronimoMBeanInfo geronimoMBeanInfo = metadata.getGeronimoMBeanInfo();
                   if (geronimoMBeanInfo == null) {
  
  
  
  1.3       +5 -1      incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXKernel.java
  
  Index: JMXKernel.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXKernel.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JMXKernel.java	13 Nov 2003 04:19:39 -0000	1.2
  +++ JMXKernel.java	15 Nov 2003 07:37:37 -0000	1.3
  @@ -93,6 +93,10 @@
       }
   
       public String getMBeanServerId() {
  +        return getMBeanServerId(server);
  +    }
  +
  +    public static  String getMBeanServerId(MBeanServer server) {
           try {
               return (String)server.getAttribute(ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate"),
"MBeanServerId");
           } catch (MBeanException e) {
  
  
  

Mime
View raw message