You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by rs...@apache.org on 2002/09/24 20:16:37 UTC

cvs commit: xml-axis/java/src/org/apache/axis/utils Admin.java

rsitze      2002/09/24 11:16:37

  Modified:    java/src/org/apache/axis/deployment/wsdd WSDDDeployment.java
               java/src/org/apache/axis/configuration FileProvider.java
               java     TODO.txt
               java/src/org/apache/axis/utils Admin.java
  Added:       java/src/org/apache/axis WSDDEngineConfiguration.java
  Log:
  Bugzilla 12781
  
  introduced WSDDEngineConfiguration, that extends EngineConfiguration.
  It has the single method 'getDeployment'.  Abstracted code that was
  previously dependent upon FileProvider to check for this interface being
  implemented.
  
  Revision  Changes    Path
  1.48      +16 -14    xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java
  
  Index: WSDDDeployment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- WSDDDeployment.java	18 Sep 2002 20:04:50 -0000	1.47
  +++ WSDDDeployment.java	24 Sep 2002 18:16:37 -0000	1.48
  @@ -54,12 +54,21 @@
    */
   package org.apache.axis.deployment.wsdd;
   
  +import java.io.IOException;
  +import java.util.ArrayList;
  +import java.util.HashMap;
  +import java.util.Hashtable;
  +import java.util.Iterator;
  +import java.util.Vector;
  +
  +import javax.xml.namespace.QName;
  +
   import org.apache.axis.AxisEngine;
   import org.apache.axis.ConfigurationException;
   import org.apache.axis.Constants;
  -import org.apache.axis.EngineConfiguration;
   import org.apache.axis.Handler;
  -import org.apache.axis.utils.Messages;
  +import org.apache.axis.WSDDEngineConfiguration;
  +import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.encoding.DeserializerFactory;
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.SerializerFactory;
  @@ -69,20 +78,10 @@
   import org.apache.axis.encoding.ser.BaseDeserializerFactory;
   import org.apache.axis.encoding.ser.BaseSerializerFactory;
   import org.apache.axis.handlers.soap.SOAPService;
  -
  -import org.apache.axis.components.logger.LogFactory;
  +import org.apache.axis.utils.Messages;
   import org.apache.commons.logging.Log;
  -
   import org.w3c.dom.Element;
   
  -import javax.xml.namespace.QName;
  -import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.HashMap;
  -import java.util.Hashtable;
  -import java.util.Iterator;
  -import java.util.Vector;
  -
   
   /**
    * WSDD deployment element
  @@ -92,7 +91,8 @@
    */
   public class WSDDDeployment
       extends WSDDElement
  -    implements WSDDTypeMappingContainer, EngineConfiguration
  +    implements WSDDTypeMappingContainer,
  +               WSDDEngineConfiguration
   {
       protected static Log log =
           LogFactory.getLog(WSDDDeployment.class.getName());
  @@ -594,4 +594,6 @@
       public AxisEngine getEngine() {
           return engine;
       }
  +
  +    public WSDDDeployment getDeployment() { return this; }
   }
  
  
  
  1.41      +15 -22    xml-axis/java/src/org/apache/axis/configuration/FileProvider.java
  
  Index: FileProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/configuration/FileProvider.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- FileProvider.java	18 Sep 2002 16:10:30 -0000	1.40
  +++ FileProvider.java	24 Sep 2002 18:16:37 -0000	1.41
  @@ -55,40 +55,33 @@
   
   package org.apache.axis.configuration;
   
  +import java.io.File;
  +import java.io.FileInputStream;
  +import java.io.FileOutputStream;
  +import java.io.InputStream;
  +import java.io.StringWriter;
  +import java.util.Hashtable;
  +import java.util.Iterator;
  +
  +import javax.xml.namespace.QName;
  +
   import org.apache.axis.AxisEngine;
   import org.apache.axis.ConfigurationException;
  -import org.apache.axis.EngineConfiguration;
   import org.apache.axis.Handler;
  -import org.apache.axis.handlers.soap.SOAPService;
  +import org.apache.axis.WSDDEngineConfiguration;
  +import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.deployment.wsdd.WSDDDeployment;
   import org.apache.axis.deployment.wsdd.WSDDDocument;
   import org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration;
  -import org.apache.axis.deployment.wsdd.WSDDService;
   import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.utils.Admin;
  +import org.apache.axis.utils.ClassUtils;
   import org.apache.axis.utils.Messages;
   import org.apache.axis.utils.XMLUtils;
  -import org.apache.axis.utils.JavaUtils;
  -import org.apache.axis.utils.ClassUtils;
  -import org.apache.axis.InternalException;
  -
  -import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  -
   import org.w3c.dom.Document;
   
  -import javax.xml.namespace.QName;
  -
  -import java.io.File;
  -import java.io.FileInputStream;
  -import java.io.FileOutputStream;
  -import java.io.InputStream;
  -import java.io.StringWriter;
  -import java.util.Hashtable;
  -import java.util.Enumeration;
  -import java.util.ArrayList;
  -import java.util.Iterator;
  -
   /**
    * A simple ConfigurationProvider that uses the Admin class to read +
    * write XML files.
  @@ -96,7 +89,7 @@
    * @author Glen Daniels (gdaniels@macromedia.com)
    * @author Glyn Normington (glyn@apache.org)
    */
  -public class FileProvider implements EngineConfiguration {
  +public class FileProvider implements WSDDEngineConfiguration {
       protected static Log log =
           LogFactory.getLog(FileProvider.class.getName());
   
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/WSDDEngineConfiguration.java
  
  Index: WSDDEngineConfiguration.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2002 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 "Axis" and "Apache Software Foundation" 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",
   *    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.axis;
  
  import org.apache.axis.deployment.wsdd.WSDDDeployment;
  
  
  /**
   * Extends EngineConfiguration interface to provide hook to
   * internal WSDD deployment info.
   *
   * @author Richard Sitze (rsitze@apache.org)
   * @author Glyn Normington (glyn@apache.org)
   * @author Glen Daniels (gdaniels@macromedia.com)
   */
  public interface WSDDEngineConfiguration extends EngineConfiguration {
      public WSDDDeployment getDeployment();
  }
  
  
  
  1.78      +0 -1      xml-axis/java/TODO.txt
  
  Index: TODO.txt
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/TODO.txt,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- TODO.txt	22 Sep 2002 17:26:28 -0000	1.77
  +++ TODO.txt	24 Sep 2002 18:16:37 -0000	1.78
  @@ -41,7 +41,6 @@
   12246 - Someone should confirm and fix for 1.0 if it's real
   12367 - Confirm, fix if real
   12572 - Glen will take a look (w/Rich)
  -12781 - If this is real, we should fix for 1.0
   
   MESSAGE PARSING / ENCODING
   --------------------------
  
  
  
  1.124     +20 -17    xml-axis/java/src/org/apache/axis/utils/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.123
  retrieving revision 1.124
  diff -u -r1.123 -r1.124
  --- Admin.java	18 Sep 2002 16:10:41 -0000	1.123
  +++ Admin.java	24 Sep 2002 18:16:37 -0000	1.124
  @@ -55,13 +55,23 @@
   
   package org.apache.axis.utils ;
   
  +import java.io.FileInputStream;
  +import java.io.IOException;
  +import java.io.StringReader;
  +import java.io.StringWriter;
  +import java.net.InetAddress;
  +import java.net.UnknownHostException;
  +import java.util.Vector;
  +
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
   import org.apache.axis.EngineConfiguration;
   import org.apache.axis.Handler;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.WSDDEngineConfiguration;
   import org.apache.axis.client.AxisClient;
  +import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.configuration.FileProvider;
   import org.apache.axis.deployment.wsdd.WSDDConstants;
   import org.apache.axis.deployment.wsdd.WSDDDeployment;
  @@ -69,22 +79,11 @@
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.SerializationContextImpl;
   import org.apache.axis.server.AxisServer;
  -
  -import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  -
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   import org.xml.sax.InputSource;
   
  -import java.io.FileInputStream;
  -import java.io.IOException;
  -import java.io.StringReader;
  -import java.io.StringWriter;
  -import java.net.InetAddress;
  -import java.net.UnknownHostException;
  -import java.util.Vector;
  -
   /**
    * Handy static utility functions for turning XML into
    * Axis deployment operations.
  @@ -153,9 +152,9 @@
   
           WSDDDocument wsddDoc = new WSDDDocument(root);
           EngineConfiguration config = engine.getConfig();
  -        if (config instanceof FileProvider) {
  -            FileProvider wsddProvider = (FileProvider)config;
  -            WSDDDeployment deployment = wsddProvider.getDeployment();
  +        if (config instanceof WSDDEngineConfiguration) {
  +            WSDDDeployment deployment =
  +                ((WSDDEngineConfiguration)config).getDeployment();
               wsddDoc.deploy(deployment);
           }
           engine.refreshGlobalOptions();
  @@ -247,9 +246,13 @@
           SerializationContext context = new SerializationContextImpl(writer, null);
           context.setPretty(true);
           try {
  -            FileProvider config = (FileProvider)engine.getConfig();
  -            WSDDDeployment deployment = config.getDeployment();
  -            deployment.writeToContext(context);
  +            EngineConfiguration config = engine.getConfig();
  +            
  +            if (config instanceof WSDDEngineConfiguration) {
  +                WSDDDeployment deployment =
  +                    ((WSDDEngineConfiguration)config).getDeployment();
  +                deployment.writeToContext(context);
  +            }
           } catch (Exception e) {
               // If the engine config isn't a FileProvider, or we have no
               // engine config for some odd reason, we'll end up here.