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/web/src/java/org/apache/geronimo/web/deployment WebDeployer.java
Date Sat, 17 Jan 2004 01:32:38 GMT
djencks     2004/01/16 17:32:38

  Modified:    modules/deployment/src/java/org/apache/geronimo/deployment/service
                        ServiceDeployer.java
               modules/deployment/src/java/org/apache/geronimo/deployment/util
                        DeploymentHelper.java
               modules/web/src/java/org/apache/geronimo/web/deployment
                        WebDeployer.java
  Log:
  use deployment helper in ServiceDeployer
  
  Revision  Changes    Path
  1.3       +9 -30     incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceDeployer.java
  
  Index: ServiceDeployer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceDeployer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceDeployer.java	16 Jan 2004 22:19:51 -0000	1.2
  +++ ServiceDeployer.java	17 Jan 2004 01:32:38 -0000	1.3
  @@ -55,27 +55,25 @@
    */
   package org.apache.geronimo.deployment.service;
   
  -import java.net.MalformedURLException;
   import java.net.URI;
   import java.net.URISyntaxException;
  -import java.net.URL;
   import java.util.ArrayList;
   import java.util.HashMap;
  +import java.util.HashSet;
   import java.util.LinkedHashSet;
   import java.util.List;
   import java.util.Map;
   import java.util.Set;
  -import java.util.HashSet;
   
  -import javax.xml.parsers.DocumentBuilder;
  -import javax.management.ObjectName;
   import javax.management.MalformedObjectNameException;
  +import javax.management.ObjectName;
  +import javax.xml.parsers.DocumentBuilder;
   
  -import org.apache.geronimo.deployment.ModuleFactory;
   import org.apache.geronimo.deployment.DeploymentModule;
  +import org.apache.geronimo.deployment.ModuleFactory;
  +import org.apache.geronimo.deployment.util.DeploymentHelper;
   import org.apache.geronimo.kernel.deployment.DeploymentException;
   import org.apache.geronimo.kernel.deployment.scanner.URLInfo;
  -import org.apache.geronimo.kernel.deployment.scanner.URLType;
   import org.apache.geronimo.kernel.deployment.service.XMLUtil;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
  @@ -96,28 +94,9 @@
       }
   
       public DeploymentModule getModule(URLInfo urlInfo, URI moduleID) throws DeploymentException
{
  -        URL baseURL = urlInfo.getUrl();
  -        URL metaDataURL;
  -        try {
  -            if (urlInfo.getType() == URLType.RESOURCE) {
  -                metaDataURL = baseURL;
  -            } else if (urlInfo.getType() == URLType.PACKED_ARCHIVE) {
  -                baseURL = new URL("jar:" + baseURL.toString() + "!/");
  -                metaDataURL = new URL(baseURL, "META-INF/geronimo-service.xml");
  -            } else if (urlInfo.getType() == URLType.UNPACKED_ARCHIVE) {
  -                metaDataURL = new URL(baseURL, "META-INF/geronimo-service.xml");
  -            } else {
  -                return null;
  -            }
  -        } catch (MalformedURLException e) {
  -            return null;
  -        }
  -
  -        Document doc = null;
  -        try {
  -            doc = parser.parse(metaDataURL.openStream());
  -        } catch (Exception e) {
  -            // this is not an XML file we can parse - let someone else try
  +        DeploymentHelper deploymentHelper = new DeploymentHelper(urlInfo, null, "geronimo-service.xml");
  +        Document doc = deploymentHelper.getGeronimoDoc(parser);
  +        if (doc == null) {
               return null;
           }
           Element documentElement = doc.getDocumentElement();
  
  
  
  1.2       +4 -7      incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentHelper.java
  
  Index: DeploymentHelper.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeploymentHelper.java	16 Jan 2004 23:39:46 -0000	1.1
  +++ DeploymentHelper.java	17 Jan 2004 01:32:38 -0000	1.2
  @@ -85,7 +85,6 @@
       protected final URLType urlType;
       protected URL j2eeURL;
       protected URL geronimoURL;
  -    private final String objectNameTypeName;
   
       /**
        * Create an helper related to the specified deployment URL with META-INF
  @@ -93,26 +92,24 @@
        *
        * @see #DeploymentHelper(URLInfo, String, String, String, String)
        */
  -    public DeploymentHelper(URLInfo urlInfo, String objectNameTypeName, String j2eeDDName,
  +    public DeploymentHelper(URLInfo urlInfo, String j2eeDDName,
               String geronimoDDName) throws DeploymentException {
  -        this(urlInfo, objectNameTypeName, j2eeDDName, geronimoDDName, "META-INF");
  +        this(urlInfo, j2eeDDName, geronimoDDName, "META-INF");
       }
   
       /**
        * Creates an helper related to the specified deployment URL.
        *
        * @param urlInfo Deployment URLInfo.
  -     * @param objectNameTypeName type's name of the ObjectName
        * @param j2eeDDName name of the J2EE deployment descriptor file
        * @param geronimoDDName name of the Geronimo deployment descriptor file
        * @param infDir the directory where deployment descriptors are to be looked up
        * @throws DeploymentException when the deployment doesn't exist
        */
  -    public DeploymentHelper(URLInfo urlInfo, String objectNameTypeName, String j2eeDDName,
  +    public DeploymentHelper(URLInfo urlInfo, String j2eeDDName,
               String geronimoDDName, String infDir) throws DeploymentException {
           this.url = urlInfo.getUrl();
           this.urlType = urlInfo.getType();
  -        this.objectNameTypeName = objectNameTypeName;
           try {
               if (URLType.RESOURCE == urlType) {
                   j2eeURL = null;
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/deployment/WebDeployer.java
  
  Index: WebDeployer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/deployment/WebDeployer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebDeployer.java	16 Jan 2004 23:42:54 -0000	1.1
  +++ WebDeployer.java	17 Jan 2004 01:32:38 -0000	1.2
  @@ -116,7 +116,7 @@
   
       public DeploymentModule getModule(URLInfo urlInfo, URI moduleID) throws DeploymentException
{
   
  -        DeploymentHelper deploymentHelper = new DeploymentHelper(urlInfo, null, "web.xml",
"geronimo-web.xml", "WEB-INF");
  +        DeploymentHelper deploymentHelper = new DeploymentHelper(urlInfo, "web.xml", "geronimo-web.xml",
"WEB-INF");
           //we require the Geronimo dd.
           if (deploymentHelper.locateGeronimoDD() == null || deploymentHelper.locateJ2EEDD()
== null) {
               return null;
  
  
  

Mime
View raw message