glyn        02/02/05 08:25:39

  Modified:    java/samples/transport/tcp AdminClient.java
               java/src/org/apache/axis/client AxisClient.java
               java/src/org/apache/axis/configuration
                        XMLStringProvider.java
               java/src/org/apache/axis/server AxisServer.java
                        AxisServerFactory.java
                        DefaultAxisServerFactory.java
                        JNDIAxisServerFactory.java
               java/src/org/apache/axis/transport/http AxisServlet.java
                        SimpleAxisServer.java
               java/src/org/apache/axis/transport/local LocalSender.java
               java/src/org/apache/axis/utils Admin.java
               java/test/functional TestTCPTransportSample.java
               java/test/session TestSimpleSession.java
  Added:       java/src/org/apache/axis EngineConfigurationFactory.java
               java/src/org/apache/axis/configuration
                        DefaultEngineConfigurationFactory.java
  Log:
  Introduce an EngineConfigurationFactory interface with a
  DefaultEngineConfigurationFactory implementation which may be overridden via
  a system property. The default engine config. factory produces client
  engine configurations based on a WSDD configuration file with filename
  specifiable in a system property (axis.ClientConfigFile) but with default
  value as today (Constants.CLIENT_CONFIG_FILE) and server side configurations
  similarly configurable via a system property (axis.ServerConfigFile) but
  defaulting to the file with name Constants.SERVER_CONFIG_FILE.
  
  The factory interface and default implementation also have helper methods
  which create an engine configuration based on the appropriate file (as above)
  but with a specific Handler added, which removes some more duplicated code
  from various testcases.
  
  (AxisServlet and AdminServlet should probably be folded into the above
  scheme in the fulness of time.)
  
  Revision  Changes    Path
  1.14      +5 -8      xml-axis/java/samples/transport/tcp/AdminClient.java
  
  Index: AdminClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/tcp/AdminClient.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AdminClient.java  28 Jan 2002 18:22:59 -0000      1.13
  +++ AdminClient.java  5 Feb 2002 16:25:38 -0000       1.14
  @@ -57,9 +57,9 @@
   
   import org.apache.axis.client.Call;
   import org.apache.axis.SimpleTargetedChain;
  -import org.apache.axis.Constants;
  -import org.apache.axis.configuration.SimpleProvider;
  -import org.apache.axis.configuration.FileProvider;
  +import org.apache.axis.configuration.DefaultEngineConfigurationFactory;
  +
  +import javax.xml.rpc.namespace.QName;
   
   /**
    * An admin client object, which will work with the TCP transport.
  @@ -75,13 +75,10 @@
           Call.addTransportPackage("samples.transport");
           Call.setTransportForProtocol("tcp", TCPTransport.class);
   
  -        SimpleProvider provider =
  -                new SimpleProvider(
  -                        new FileProvider(Constants.CLIENT_CONFIG_FILE));
           SimpleTargetedChain c = new SimpleTargetedChain(new TCPSender());
  -        provider.deployTransport("tcp", c);
   
  -        AdminClient.setDefaultConfiguration(provider);
  +        AdminClient.setDefaultConfiguration((new 
DefaultEngineConfigurationFactory())
  +            .getClientEngineConfigWithTransport(new QName(null, "tcp"), c));
   
           try {
               org.apache.axis.client.AdminClient client =
  
  
  
  1.1                  
xml-axis/java/src/org/apache/axis/EngineConfigurationFactory.java
  
  Index: EngineConfigurationFactory.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 [EMAIL PROTECTED]
   *
   * 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 javax.xml.rpc.namespace.QName;
  
  /**
   * EngineConfigurationFactory is an interface used to construct
   * concrete EngineConfiguration instances.
   *
   * @author Glyn Normington ([EMAIL PROTECTED])
   */
  public interface EngineConfigurationFactory {
      /**
       * Property name used for setting an EngineConfiguration to be used
       * in creating engines.
       */
      public static final String SYSTEM_PROPERTY_NAME = "engineConfigFactory";
  
       /**
       * Get a default client engine configuration.
       *
       * @return a client EngineConfiguration
       */
      public EngineConfiguration getClientEngineConfig();
  
      /**
       * Get a default server engine configuration.
       *
       * @return a server EngineConfiguration
       */
      public EngineConfiguration getServerEngineConfig();
     
      /**
       * Get a default client engine configuration plus the specified
       * transport Handler. This method is particularly useful for testcases.
       *
       * @param name a QName that identifies the transport
       * @param transport a Handler for the transport
       * @return a client EngineConfiguration
       */
      public EngineConfiguration getClientEngineConfigWithTransport(QName qname,
                                                                    Handler transport);
     
  
      /**
       * Get a default server engine configuration plus the specified
       * service Handler. This method is particularly useful for testcases.
       *
       * @param name a QName that identifies the service
       * @param service a Handler for the service
       * @return a server EngineConfiguration
       */
      public EngineConfiguration getServerEngineConfigWithService(QName qname,
                                                                  Handler service);
  }
  
  
  
  1.37      +6 -9      xml-axis/java/src/org/apache/axis/client/AxisClient.java
  
  Index: AxisClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/AxisClient.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- AxisClient.java   28 Jan 2002 18:23:00 -0000      1.36
  +++ AxisClient.java   5 Feb 2002 16:25:38 -0000       1.37
  @@ -58,11 +58,10 @@
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
   import org.apache.axis.EngineConfiguration;
  -import org.apache.axis.Constants;
  +import org.apache.axis.configuration.DefaultEngineConfigurationFactory;
   import org.apache.axis.Handler;
   import org.apache.axis.MessageContext;
   import org.apache.axis.SimpleTargetedChain;
  -import org.apache.axis.configuration.FileProvider;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.log4j.Category;
   
  @@ -75,19 +74,17 @@
    * @author Doug Davis ([EMAIL PROTECTED])
    * @author Glen Daniels ([EMAIL PROTECTED])
    */
  -public class AxisClient extends AxisEngine
  -{
  +public class AxisClient extends AxisEngine {
       static Category category =
               Category.getInstance(AxisClient.class.getName());
   
  -    public AxisClient(EngineConfiguration config)
  -    {
  +    public AxisClient(EngineConfiguration config) {
           super(config);
       }
       
  -    public AxisClient()
  -    {
  -        this(new FileProvider(Constants.CLIENT_CONFIG_FILE));
  +    public AxisClient() {
  +        this((new DefaultEngineConfigurationFactory()).
  +             getClientEngineConfig());
       }
   
       /**
  
  
  
  1.6       +10 -0     
xml-axis/java/src/org/apache/axis/configuration/XMLStringProvider.java
  
  Index: XMLStringProvider.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/configuration/XMLStringProvider.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XMLStringProvider.java    28 Jan 2002 18:23:00 -0000      1.5
  +++ XMLStringProvider.java    5 Feb 2002 16:25:38 -0000       1.6
  @@ -72,6 +72,16 @@
    *
    * This provider does not write configuration to persistent storage.
    *
  + * Example of usage:
  + *    new XMLStringProvider("<engineConfig><handlers><handler name=" +
  + *        "\"MsgDispatcher\" class=\"org.apache.axis.providers.java" +
  + *        ".MsgProvider\"/></handlers><services><service name=\"Adm" +
  + *        "inService\" pivot=\"MsgDispatcher\"><option name=\"class" +
  + *        "Name\" value=\"org.apache.axis.utils.Admin\"/><option na" +
  + *        "me=\"allowedMethods\" value=\"AdminService\"/><option na" +
  + *        "me=\"enableRemoteAdmin\" value=\"false\"/></service></se" +
  + *        "rvices></engineConfig>");
  + *
    * @author Glen Daniels ([EMAIL PROTECTED])
    */
   public class XMLStringProvider extends FileProvider
  
  
  
  1.1                  
xml-axis/java/src/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java
  
  Index: DefaultEngineConfigurationFactory.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 [EMAIL PROTECTED]
   *
   * 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.configuration;
  
  import org.apache.axis.EngineConfigurationFactory;
  import org.apache.axis.EngineConfiguration;
  import javax.xml.rpc.namespace.QName;
  import org.apache.axis.Handler;
  import org.apache.axis.handlers.soap.SOAPService;
  import org.apache.axis.Constants;
  
  /**
   * This is a default implementation of EngineConfigurationFactory.
   * It is user-overrideable by a system property without affecting
   * the caller. If you decide to override it, use delegation if
   * you want to inherit the behaviour of this class as using
   * class extension will result in tight loops. That is, your
   * class should implement EngineConfigurationFactory and keep
   * an instance of this class in a member field and delegate
   * methods to that instance when the default behaviour is
   * required.
   *
   * @author Glyn Normington ([EMAIL PROTECTED])
   */
  public class DefaultEngineConfigurationFactory implements EngineConfigurationFactory 
{
  
      private EngineConfigurationFactory userFactory = null;
  
      private String clientConfigFile;
  
      private String serverConfigFile;
  
      /**
       * Create the default engine configuration and detect whether the user
       * has overridden this with their own.
       */
      public DefaultEngineConfigurationFactory() {
          String fClassName = System.getProperty("axis.EngineConfigFactory");
  
          if (fClassName != null) {
              try {
                  userFactory = (EngineConfigurationFactory)Class.
                      forName(fClassName).newInstance();
              } catch (Exception e) {
                  // Report diagnostics but use the default factory.
                  e.printStackTrace(System.err);
              }
          }
  
          clientConfigFile = System.getProperty("axis.ClientConfigFile");
          if (clientConfigFile == null) {
              clientConfigFile = Constants.CLIENT_CONFIG_FILE;
          }
  
          serverConfigFile = System.getProperty("axis.ServerConfigFile");
          if (serverConfigFile == null) {
              serverConfigFile = Constants.SERVER_CONFIG_FILE;
          }
          
      }
  
       /**
       * Get a default client engine configuration.
       *
       * @return a client EngineConfiguration
       */
      public EngineConfiguration getClientEngineConfig() {
          if (userFactory == null) {
              return new FileProvider(clientConfigFile);
          } else {
              return userFactory.getClientEngineConfig();
          }
      }
  
      /**
       * Get a default server engine configuration.
       *
       * @return a server EngineConfiguration
       */
      public EngineConfiguration getServerEngineConfig() {
          if (userFactory == null) {
              return new FileProvider(serverConfigFile);
          } else {
              return userFactory.getServerEngineConfig();
          }
      }
     
      /**
       * Get a default client engine configuration plus the specified
       * transport Handler. This method is particularly useful for testcases.
       *
       * @param name a QName that identifies the transport
       * @param transport a Handler for the transport
       * @return a client EngineConfiguration
       */
      public EngineConfiguration getClientEngineConfigWithTransport(QName qname,
                                                                    Handler transport) 
{
          if (userFactory == null) {
              SimpleProvider config = new SimpleProvider(new 
FileProvider(clientConfigFile));
              config.deployTransport(qname, transport);
              return config;
          } else {
              return userFactory.getClientEngineConfigWithTransport(qname, transport);
          }
      }
  
      /**
       * Get a default server engine configuration plus the specified
       * service Handler. This method is particularly useful for testcases.
       *
       * @param name a QName that identifies the service
       * @param service a Handler for the service
       * @return a server EngineConfiguration
       */
      public EngineConfiguration getServerEngineConfigWithService(QName qname,
                                                                  Handler service) {
          if (userFactory == null) {
              SimpleProvider config = new SimpleProvider(new 
FileProvider(serverConfigFile));
              config.deployService(qname, (SOAPService)service);
              return config;
          } else {
              return userFactory.getServerEngineConfigWithService(qname, service);
          }
      }
  }
  
  
  
  1.56      +4 -4      xml-axis/java/src/org/apache/axis/server/AxisServer.java
  
  Index: AxisServer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/AxisServer.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- AxisServer.java   28 Jan 2002 18:23:02 -0000      1.55
  +++ AxisServer.java   5 Feb 2002 16:25:38 -0000       1.56
  @@ -58,13 +58,12 @@
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
   import org.apache.axis.EngineConfiguration;
  -import org.apache.axis.Constants;
   import org.apache.axis.Handler;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
   import org.apache.axis.SimpleTargetedChain;
   import org.apache.axis.client.AxisClient;
  -import org.apache.axis.configuration.FileProvider;
  +import org.apache.axis.configuration.DefaultEngineConfigurationFactory;
   import org.apache.axis.utils.AxisClassLoader;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.log4j.Category;
  @@ -113,7 +112,8 @@
   
       public AxisServer()
       {
  -        this(new FileProvider(Constants.SERVER_CONFIG_FILE));
  +        this((new DefaultEngineConfigurationFactory()).
  +             getServerEngineConfig());
       }
   
       public AxisServer(EngineConfiguration config)
  @@ -152,7 +152,7 @@
        */
       public synchronized AxisEngine getClientEngine () {
           if (clientEngine == null) {
  -            clientEngine = new AxisClient(new 
FileProvider(Constants.CLIENT_CONFIG_FILE)); // !!!!
  +            clientEngine = new AxisClient(); // !!!!
           }
           return clientEngine;
       }
  
  
  
  1.5       +55 -4     xml-axis/java/src/org/apache/axis/server/AxisServerFactory.java
  
  Index: AxisServerFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/AxisServerFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AxisServerFactory.java    28 Jan 2002 18:23:02 -0000      1.4
  +++ AxisServerFactory.java    5 Feb 2002 16:25:38 -0000       1.5
  @@ -1,11 +1,62 @@
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2001 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 [EMAIL PROTECTED]
  + *
  + * 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.server;
   
   import org.apache.axis.AxisFault;
  -import org.apache.axis.Constants;
  -import org.apache.axis.configuration.FileProvider;
   
  -import javax.naming.InitialContext;
  -import javax.naming.NamingException;
   import java.util.Map;
   
   /**
  
  
  
  1.6       +65 -19    
xml-axis/java/src/org/apache/axis/server/DefaultAxisServerFactory.java
  
  Index: DefaultAxisServerFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/server/DefaultAxisServerFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultAxisServerFactory.java     4 Feb 2002 20:19:06 -0000       1.5
  +++ DefaultAxisServerFactory.java     5 Feb 2002 16:25:38 -0000       1.6
  @@ -1,10 +1,63 @@
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2001 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 [EMAIL PROTECTED]
  + *
  + * 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.server;
   
   import org.apache.axis.EngineConfiguration;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.Constants;
   import org.apache.axis.AxisEngine;
  -import org.apache.axis.configuration.FileProvider;
   
   import javax.naming.InitialContext;
   import javax.naming.NamingException;
  @@ -18,8 +71,6 @@
    */ 
   
   public class DefaultAxisServerFactory implements AxisServerFactory {
  -    private static FileProvider defaultEngineConfig =
  -                           new FileProvider(Constants.SERVER_CONFIG_FILE);
   
       /**
        * Get an AxisServer.  This factory looks for an "engineConfig" in the
  @@ -77,15 +128,13 @@
       static private AxisServer createNewServer(EngineConfiguration config)
       {
           if (config == null) {
  -            // Default configuration steps...
  -            //
  -            // 1. Check for a system property telling us which Configuration
  -            //    Provider to use.  If we find it, try creating one.
  +            // A default engine configuration class may be set in a system
  +            // property. If so, try creating an engine configuration.
               String configClass = System.getProperty("axis.engineConfigClass");
               if (configClass != null) {
                   // Got one - so try to make it (which means it had better have
  -                // a default constructor - may make it possible later to pass in
  -                // some kind of environmental parameters...)
  +                // a default constructor - may make it possible later to pass
  +                // in some kind of environmental parameters...)
                   try {
                       Class cls = Class.forName(configClass);
                       config = (EngineConfiguration)cls.newInstance();
  @@ -97,16 +146,13 @@
                       // Fall through???
                   }
               }
  -
  -            // 2. If we couldn't make one above, use the default one.
  -            // !!! May want to add options here for getting another system
  -            //     property which is the config file name...
  -            if (config == null) {
  -                config = defaultEngineConfig;
  -            }
           }
   
  -        // 3. Create an AxisServer using the appropriate config
  -        return new AxisServer(config);
  +        // Create an AxisServer using the appropriate config
  +        if (config == null) {
  +            return new AxisServer();
  +        } else {
  +            return new AxisServer(config);
  +        }
       }
   }
  
  
  
  1.5       +59 -8     
xml-axis/java/src/org/apache/axis/server/JNDIAxisServerFactory.java
  
  Index: JNDIAxisServerFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/server/JNDIAxisServerFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JNDIAxisServerFactory.java        30 Jan 2002 16:19:11 -0000      1.4
  +++ JNDIAxisServerFactory.java        5 Feb 2002 16:25:38 -0000       1.5
  @@ -1,9 +1,62 @@
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2001 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 [EMAIL PROTECTED]
  + *
  + * 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.server;
   
   import org.apache.axis.EngineConfiguration;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.Constants;
  -import org.apache.axis.configuration.FileProvider;
   
   import javax.naming.InitialContext;
   import javax.naming.NamingException;
  @@ -20,8 +73,6 @@
    */ 
   
   public class JNDIAxisServerFactory implements AxisServerFactory {
  -    private static FileProvider defaultEngineConfig =
  -                           new FileProvider(Constants.SERVER_CONFIG_FILE);
   
       /**
        * Obtain an AxisServer reference, using JNDI if possible, otherwise
  @@ -136,10 +187,10 @@
           // !!! May want to add options here for getting another system
           //     property which is the config file name...
           if (config == null) {
  -            config = defaultEngineConfig;
  +            return new AxisServer();
  +        } else {
  +            // 3. Create an AxisServer using the appropriate config
  +            return new AxisServer(config);
           }
  -
  -        // 3. Create an AxisServer using the appropriate config
  -        return new AxisServer(config);
       }
   }
  
  
  
  1.76      +0 -1      
xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- AxisServlet.java  4 Feb 2002 23:34:09 -0000       1.75
  +++ AxisServlet.java  5 Feb 2002 16:25:39 -0000       1.76
  @@ -66,7 +66,6 @@
   import org.apache.axis.message.SOAPFaultElement;
   import org.apache.axis.security.servlet.ServletSecurityProvider;
   import org.apache.axis.server.AxisServer;
  -import org.apache.axis.server.AxisServerFactory;
   import org.apache.axis.utils.Admin;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
  
  
  
  1.46      +1 -8      
xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java
  
  Index: SimpleAxisServer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- SimpleAxisServer.java     4 Feb 2002 23:34:09 -0000       1.45
  +++ SimpleAxisServer.java     5 Feb 2002 16:25:39 -0000       1.46
  @@ -59,7 +59,6 @@
   import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.configuration.FileProvider;
   import org.apache.axis.encoding.Base64;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPFaultElement;
  @@ -115,17 +114,11 @@
       // (thread safety not considered crucial here)
       public static int sessionIndex = 0;
   
  -    // Configuration provider
  -    private static FileProvider provider = new 
FileProvider(Constants.SERVER_CONFIG_FILE);
  -
  -    // Another example of configuration (AdminService only) might look like this...
  -    //private static XMLStringProvider provider = new 
XMLStringProvider("<engineConfig><handlers><handler name=\"MsgDispatcher\" 
class=\"org.apache.axis.providers.java.MsgProvider\"/></handlers><services><service 
name=\"AdminService\" pivot=\"MsgDispatcher\"><option name=\"className\" 
value=\"org.apache.axis.utils.Admin\"/><option name=\"allowedMethods\" 
value=\"AdminService\"/><option name=\"enableRemoteAdmin\" 
value=\"false\"/></service></services></engineConfig>");
  -
       // Axis server (shared between instances)
       private static AxisServer myAxisServer = null;
       private static synchronized AxisServer getAxisServer() {
           if (myAxisServer == null) {
  -            myAxisServer = new AxisServer(provider);
  +            myAxisServer = new AxisServer();
           }
           return myAxisServer;
       }
  
  
  
  1.24      +1 -2      
xml-axis/java/src/org/apache/axis/transport/local/LocalSender.java
  
  Index: LocalSender.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/transport/local/LocalSender.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- LocalSender.java  10 Jan 2002 20:01:01 -0000      1.23
  +++ LocalSender.java  5 Feb 2002 16:25:39 -0000       1.24
  @@ -84,8 +84,7 @@
        * Allocate an embedded Axis server to process requests and initialize it.
        */
       public synchronized void init() {
  -        AxisServer server = new AxisServer(new 
FileProvider(Constants.SERVER_CONFIG_FILE));
  -        this.server=server;
  +        this.server= new AxisServer();
       }
   
       public void invoke(MessageContext clientContext) throws AxisFault {
  
  
  
  1.95      +2 -2      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.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- Admin.java        28 Jan 2002 18:23:02 -0000      1.94
  +++ Admin.java        5 Feb 2002 16:25:39 -0000       1.95
  @@ -765,9 +765,9 @@
   
           AxisEngine engine;
           if ( args[0].equals("client") )
  -            engine = new AxisClient(new FileProvider(Constants.CLIENT_CONFIG_FILE));
  +            engine = new AxisClient();
           else
  -            engine = new AxisServer(new FileProvider(Constants.SERVER_CONFIG_FILE));
  +            engine = new AxisServer();
           engine.setShouldSaveConfig(true);
           engine.init();
           MessageContext msgContext = new MessageContext(engine);
  
  
  
  1.21      +6 -8      xml-axis/java/test/functional/TestTCPTransportSample.java
  
  Index: TestTCPTransportSample.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/functional/TestTCPTransportSample.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TestTCPTransportSample.java       28 Jan 2002 18:23:03 -0000      1.20
  +++ TestTCPTransportSample.java       5 Feb 2002 16:25:39 -0000       1.21
  @@ -59,12 +59,11 @@
   import junit.framework.TestCase;
   import org.apache.axis.AxisFault;
   import org.apache.axis.SimpleTargetedChain;
  -import org.apache.axis.Constants;
  -import org.apache.axis.configuration.SimpleProvider;
  -import org.apache.axis.configuration.FileProvider;
   import org.apache.axis.client.Call;
   import org.apache.axis.client.Service;
   import org.apache.axis.encoding.XMLType;
  +import org.apache.axis.EngineConfiguration;
  +import org.apache.axis.configuration.DefaultEngineConfigurationFactory;
   import org.apache.log4j.Category;
   import samples.transport.tcp.AdminClient;
   import samples.transport.tcp.GetQuote;
  @@ -102,13 +101,12 @@
               tester.getQuote(new String [] { "-ltcp://localhost:8088", "XXX" });
               String   symbol = "XXX"; // args[0] ;
   
  -            SimpleProvider provider =
  -                    new SimpleProvider(
  -                            new FileProvider(Constants.CLIENT_CONFIG_FILE));
               SimpleTargetedChain c = new SimpleTargetedChain(new TCPSender());
  -            provider.deployTransport("tcp", c);
  +            EngineConfiguration config =
  +                (new DefaultEngineConfigurationFactory()).
  +                getClientEngineConfigWithTransport(new QName(null, "tcp"), c);
  +            Service service = new Service(config);
   
  -            Service  service = new Service(provider);
               Call     call    = (Call) service.createCall();
   
               call.setTargetEndpointAddress( new URL("tcp://localhost:8088") );
  
  
  
  1.10      +10 -8     xml-axis/java/test/session/TestSimpleSession.java
  
  Index: TestSimpleSession.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/session/TestSimpleSession.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TestSimpleSession.java    28 Jan 2002 18:23:03 -0000      1.9
  +++ TestSimpleSession.java    5 Feb 2002 16:25:39 -0000       1.10
  @@ -11,13 +11,15 @@
   import org.apache.axis.transport.local.LocalTransport;
   import org.apache.axis.server.AxisServer;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.Constants;
  +import org.apache.axis.EngineConfiguration;
   import org.apache.axis.configuration.XMLStringProvider;
  -import org.apache.axis.configuration.SimpleProvider;
  -import org.apache.axis.configuration.FileProvider;
  +import org.apache.axis.configuration.DefaultEngineConfigurationFactory;
   import org.apache.axis.deployment.wsdd.WSDDConstants;
   import org.apache.axis.providers.java.RPCProvider;
   
  +import javax.xml.rpc.namespace.QName;
  +
  +
   /** 
    * Test deserialization of SOAP responses
    */
  @@ -87,11 +89,11 @@
           service.setOption("className", "test.session.TestSimpleSession");
           service.setOption("allowedMethods", "counter");
   
  -        SimpleProvider simpleProvider =
  -                new SimpleProvider(
  -                        new FileProvider(Constants.SERVER_CONFIG_FILE));
  -        AxisServer server = new AxisServer(simpleProvider);
  -        simpleProvider.deployService("sessionTest", service);
  +        EngineConfiguration config =
  +            (new DefaultEngineConfigurationFactory()).
  +            getServerEngineConfigWithService(new QName(null, "sessionTest"),
  +                                             service);
  +        AxisServer server = new AxisServer(config);
   
           // Set up the client side (using the WSDD above)
           Service svc = new Service(clientProvider);
  
  
  


Reply via email to