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/jetty/src/java/org/apache/geronimo/jetty/deployment WARConfigBuilder.java
Date Sat, 17 Apr 2004 20:34:24 GMT
djencks     2004/04/17 13:34:24

  Modified:    modules/common/src/java/org/apache/geronimo/common/xml
                        XmlBeansUtil.java
               modules/connector/src/java/org/apache/geronimo/connector/deployment
                        AbstractRARConfigBuilder.java
               modules/deployment/src/java/org/apache/geronimo/deployment
                        ConfigurationBuilder.java
               modules/jetty/src/java/org/apache/geronimo/jetty/deployment
                        WARConfigBuilder.java
  Log:
  Not only look for xml validation errors, but complain when they occur
  
  Revision  Changes    Path
  1.3       +11 -9     incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/xml/XmlBeansUtil.java
  
  Index: XmlBeansUtil.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/xml/XmlBeansUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XmlBeansUtil.java	21 Mar 2004 18:11:11 -0000	1.2
  +++ XmlBeansUtil.java	17 Apr 2004 20:34:24 -0000	1.3
  @@ -17,16 +17,16 @@
   
   package org.apache.geronimo.common.xml;
   
  -import java.io.InputStream;
   import java.io.IOException;
  -import java.util.ArrayList;
  +import java.io.InputStream;
   import java.net.URL;
  +import java.util.ArrayList;
   
  -import org.apache.xmlbeans.XmlObject;
   import org.apache.xmlbeans.SchemaType;
  -import org.apache.xmlbeans.XmlException;
   import org.apache.xmlbeans.SchemaTypeLoader;
   import org.apache.xmlbeans.XmlBeans;
  +import org.apache.xmlbeans.XmlException;
  +import org.apache.xmlbeans.XmlObject;
   import org.apache.xmlbeans.XmlOptions;
   
   /**
  @@ -39,7 +39,7 @@
   
       private XmlBeansUtil() {}
   
  -    public static XmlObject getXmlObject(URL url, SchemaType type) {
  +    public static XmlObject getXmlObject(URL url, SchemaType type) throws XmlException
{
           InputStream is;
           try {
               is = url.openStream();
  @@ -50,8 +50,6 @@
               }
           } catch (IOException e) {
               return null;
  -        } catch (XmlException e) {
  -            return null;
           }
       }
   
  @@ -61,7 +59,11 @@
           XmlOptions options = new XmlOptions();
           options.setLoadLineNumbers();
           options.setErrorListener(errors);
  -        return loader.parse(is, type, options);
  +        XmlObject parsed = loader.parse(is, type, options);
  +        if (errors.size() != 0) {
  +            throw new XmlException(errors.toArray().toString());
  +        }
  +        return parsed;
       }
   
   }
  
  
  
  1.14      +2 -2      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java
  
  Index: AbstractRARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AbstractRARConfigBuilder.java	14 Apr 2004 04:01:24 -0000	1.13
  +++ AbstractRARConfigBuilder.java	17 Apr 2004 20:34:24 -0000	1.14
  @@ -118,7 +118,7 @@
   
       protected abstract XmlObject getConnectorDocument(JarInputStream jarInputStream) throws
XmlException, IOException, DeploymentException;
   
  -    public XmlObject getDeploymentPlan(URL module) {
  +    public XmlObject getDeploymentPlan(URL module) throws XmlException {
            try {
               URL moduleBase = new URL("jar:" + module.toString() + "!/");
               XmlObject plan = XmlBeansUtil.getXmlObject(new URL(moduleBase, "META-INF/geronimo-ra.xml"),
GerConnectorDocument.type);
  
  
  
  1.8       +5 -4      incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
  
  Index: ConfigurationBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConfigurationBuilder.java	3 Apr 2004 22:37:57 -0000	1.7
  +++ ConfigurationBuilder.java	17 Apr 2004 20:34:24 -0000	1.8
  @@ -26,10 +26,11 @@
   
   import org.apache.xmlbeans.XmlObject;
   import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlException;
   
   /**
  - * 
  - * 
  + *
  + *
    * @version $Revision$ $Date$
    */
   public interface ConfigurationBuilder {
  @@ -48,7 +49,7 @@
        * @param module the URL of the module to examine
        * @return the deployment plan, or null if this module can not handle it
        */
  -    XmlObject getDeploymentPlan(URL module);
  +    XmlObject getDeploymentPlan(URL module) throws XmlException;
   
       /**
        * Build a configuration from a local file
  
  
  
  1.18      +2 -2      incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigBuilder.java
  
  Index: WARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigBuilder.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- WARConfigBuilder.java	7 Apr 2004 19:22:15 -0000	1.17
  +++ WARConfigBuilder.java	17 Apr 2004 20:34:24 -0000	1.18
  @@ -96,7 +96,7 @@
           return new SchemaTypeLoader[]{XmlBeans.getContextTypeLoader()};
       }
   
  -    public XmlObject getDeploymentPlan(URL module) {
  +    public XmlObject getDeploymentPlan(URL module) throws XmlException {
           try {
               URL moduleBase;
               if (module.toString().endsWith("/")) {
  
  
  

Mime
View raw message