rsitze      2002/06/04 15:58:32

  Modified:    java/src/org/apache/axis/transport/http AxisServlet.java
                        HTTPSender.java
               java/src/org/apache/axis/configuration FileProvider.java
                        DefaultEngineConfigurationFactory.java
               java/src/org/apache/axis/client Call.java
               java/src/org/apache/axis MessageContext.java AxisEngine.java
               java/src/org/apache/axis/server
                        DefaultAxisServerFactory.java AxisServer.java
  Log:
  New guides lines for using 'system properties'.  Briefly, use
  AxisEngine.getGlobalProperties() to get these, so we can
  establish a central point of access.  In the near future I
  expect to update this method to introduce other ways of
  setting these properties (as alternatives to the system properties).
  
  The only exception to this (for now) is for the command line utilities,
  which are left using System.getProperty().
  
  Revision  Changes    Path
  1.107     +1 -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.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- AxisServlet.java  4 Jun 2002 20:35:42 -0000       1.106
  +++ AxisServlet.java  4 Jun 2002 22:58:32 -0000       1.107
  @@ -747,7 +747,7 @@
                                String param,
                                String dephault)
       {
  -        String value = System.getProperty(param);
  +        String value = AxisEngine.getGlobalProperty(param);
   
           if (value == null)
               value = getInitParameter(param);
  
  
  
  1.65      +15 -14    xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java
  
  Index: HTTPSender.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- HTTPSender.java   3 Jun 2002 12:24:55 -0000       1.64
  +++ HTTPSender.java   4 Jun 2002 22:58:32 -0000       1.65
  @@ -54,6 +54,7 @@
    */
   package org.apache.axis.transport.http;
   
  +import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  @@ -187,15 +188,15 @@
           }
   
           // Get https.proxyXXX settings
  -        String tunnelHost = System.getProperty("https.proxyHost");
  -        String tunnelPortStr = System.getProperty("https.proxyPort");
  +        String tunnelHost = AxisEngine.getGlobalProperty("https.proxyHost");
  +        String tunnelPortStr = AxisEngine.getGlobalProperty("https.proxyPort");
   
           // Use http.proxyXXX settings if https.proxyXXX is not set
           if (tunnelHost == null) {
  -            tunnelHost = System.getProperty("http.proxyHost");
  +            tunnelHost = AxisEngine.getGlobalProperty("http.proxyHost");
           }
           if (tunnelPortStr == null) {
  -            tunnelPortStr = System.getProperty("http.proxyPort");
  +            tunnelPortStr = AxisEngine.getGlobalProperty("http.proxyPort");
           }
           try {
   
  @@ -214,7 +215,7 @@
               Object factory = null;
   
               // Hook in a different SSL socket factory
  -            String socketFactoryClass = System.getProperty("axis.socketFactory");
  +            String socketFactoryClass = 
AxisEngine.getGlobalProperty("axis.socketFactory");
               if (socketFactoryClass != null) {
                   try {
                       Class c1 = Class.forName(socketFactoryClass);
  @@ -262,14 +263,14 @@
                   PrintWriter out = new PrintWriter(
                           new BufferedWriter(
                                   new OutputStreamWriter(tunnelOutputStream)));
  -                String tunnelUser = System.getProperty("https.proxyUser");
  -                String tunnelPassword = System.getProperty("https.proxyPassword");
  +                String tunnelUser = AxisEngine.getGlobalProperty("https.proxyUser");
  +                String tunnelPassword = 
AxisEngine.getGlobalProperty("https.proxyPassword");
   
                   if (tunnelUser == null) {
  -                    tunnelUser = System.getProperty("http.proxyUser");
  +                    tunnelUser = AxisEngine.getGlobalProperty("http.proxyUser");
                   }
                   if (tunnelPassword == null) {
  -                    tunnelPassword = System.getProperty("http.proxyPassword");
  +                    tunnelPassword = 
AxisEngine.getGlobalProperty("http.proxyPassword");
                   }
   
                   // More secure version... engage later?
  @@ -392,12 +393,12 @@
               String host, int port, StringBuffer otherHeaders, BooleanHolder 
useFullURL)
               throws IOException {
           Socket sock = null;
  -        String proxyHost = System.getProperty("http.proxyHost");
  -        String proxyPort = System.getProperty("http.proxyPort");
  -        String nonProxyHosts = System.getProperty("http.nonProxyHosts");
  +        String proxyHost = AxisEngine.getGlobalProperty("http.proxyHost");
  +        String proxyPort = AxisEngine.getGlobalProperty("http.proxyPort");
  +        String nonProxyHosts = AxisEngine.getGlobalProperty("http.nonProxyHosts");
           boolean hostInNonProxyList = isHostInNonProxyList(host, nonProxyHosts);
  -        String proxyUsername = System.getProperty("http.proxyUser");
  -        String proxyPassword = System.getProperty("http.proxyPassword");
  +        String proxyUsername = AxisEngine.getGlobalProperty("http.proxyUser");
  +        String proxyPassword = AxisEngine.getGlobalProperty("http.proxyPassword");
   
           if (proxyUsername != null) {
               StringBuffer tmpBuf = new StringBuffer();
  
  
  
  1.28      +0 -2      
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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- FileProvider.java 21 May 2002 14:50:50 -0000      1.27
  +++ FileProvider.java 4 Jun 2002 22:58:32 -0000       1.28
  @@ -95,8 +95,6 @@
       protected static Log log =
           LogFactory.getLog(FileProvider.class.getName());
   
  -    protected String sep = System.getProperty("file.separator");
  -
       protected WSDDDeployment deployment = null;
   
       private static final String CURRENT_DIR = ".";
  
  
  
  1.11      +4 -3      
xml-axis/java/src/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java
  
  Index: DefaultEngineConfigurationFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultEngineConfigurationFactory.java    30 May 2002 23:46:00 -0000      1.10
  +++ DefaultEngineConfigurationFactory.java    4 Jun 2002 22:58:32 -0000       1.11
  @@ -55,6 +55,7 @@
   
   package org.apache.axis.configuration;
   
  +import org.apache.axis.AxisEngine;
   import org.apache.axis.EngineConfigurationFactory;
   import org.apache.axis.EngineConfiguration;
   import org.apache.axis.utils.JavaUtils;
  @@ -95,7 +96,7 @@
        */
       public DefaultEngineConfigurationFactory() {
           String fClassName =
  -            System.getProperty(EngineConfigurationFactory.SYSTEM_PROPERTY_NAME);
  +            
AxisEngine.getGlobalProperty(EngineConfigurationFactory.SYSTEM_PROPERTY_NAME);
   
           if (fClassName != null) {
               try {
  @@ -107,12 +108,12 @@
               }
           }
   
  -        clientConfigFile = System.getProperty("axis.ClientConfigFile");
  +        clientConfigFile = AxisEngine.getGlobalProperty("axis.ClientConfigFile");
           if (clientConfigFile == null) {
               clientConfigFile = CLIENT_CONFIG_FILE;
           }
   
  -        serverConfigFile = System.getProperty("axis.ServerConfigFile");
  +        serverConfigFile = AxisEngine.getGlobalProperty("axis.ServerConfigFile");
           if (serverConfigFile == null) {
               serverConfigFile = SERVER_CONFIG_FILE;
           }
  
  
  
  1.129     +2 -1      xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.128
  retrieving revision 1.129
  diff -u -r1.128 -r1.129
  --- Call.java 4 Jun 2002 20:34:02 -0000       1.128
  +++ Call.java 4 Jun 2002 22:58:32 -0000       1.129
  @@ -55,6 +55,7 @@
   
   package org.apache.axis.client ;
   
  +import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
   import org.apache.axis.Handler;
  @@ -1293,7 +1294,7 @@
       public static synchronized void addTransportPackage(String packageName) {
           if (transportPackages == null) {
               transportPackages = new ArrayList();
  -            String currentPackages = System.getProperty(TRANSPORT_PROPERTY);
  +            String currentPackages = 
AxisEngine.getGlobalProperty(TRANSPORT_PROPERTY);
               if (currentPackages != null) {
                   StringTokenizer tok = new StringTokenizer(currentPackages,
                                                             "|");
  
  
  
  1.97      +1 -1      xml-axis/java/src/org/apache/axis/MessageContext.java
  
  Index: MessageContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- MessageContext.java       4 Jun 2002 20:34:02 -0000       1.96
  +++ MessageContext.java       4 Jun 2002 22:58:32 -0000       1.97
  @@ -259,7 +259,7 @@
       protected static String systemTempDir= null;
       static {
           try {
  -            systemTempDir=System.getProperty(AxisEngine.ENV_ATTACHMENT_DIR);
  +            
systemTempDir=AxisEngine.getGlobalProperty(AxisEngine.ENV_ATTACHMENT_DIR);
           } catch(Throwable t) {
               systemTempDir= null;
           }
  
  
  
  1.78      +9 -1      xml-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- AxisEngine.java   9 May 2002 18:13:01 -0000       1.77
  +++ AxisEngine.java   4 Jun 2002 22:58:32 -0000       1.78
  @@ -184,7 +184,7 @@
   
           /*Set the default attachment implementation */
           setOptionDefault(PROP_ATTACHMENT_IMPLEMENTATION,
  -                         System.getProperty("axis." + 
PROP_ATTACHMENT_IMPLEMENTATION  ));
  +                         AxisEngine.getGlobalProperty("axis." + 
PROP_ATTACHMENT_IMPLEMENTATION  ));
   
           setOptionDefault(PROP_ATTACHMENT_IMPLEMENTATION, DEFAULT_ATTACHMENT_IMPL);
   
  @@ -397,5 +397,13 @@
   
       public ClassCache getClassCache() {
           return classCache;
  +    }
  +    
  +    /**
  +     * Central access point for AXIS to obtain "global" configuration properties.
  +     * To be extended in the future... or replaced with non-global properties.
  +     */
  +    public static String getGlobalProperty(String property) {
  +        return System.getProperty(property);
       }
   };
  
  
  
  1.8       +1 -1      
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultAxisServerFactory.java     9 May 2002 18:35:11 -0000       1.7
  +++ DefaultAxisServerFactory.java     4 Jun 2002 22:58:32 -0000       1.8
  @@ -175,7 +175,7 @@
           if (config == null) {
               // A default engine configuration class may be set in a system
               // property. If so, try creating an engine configuration.
  -            String configClass = System.getProperty(AxisEngine.PROP_CONFIG_CLASS);
  +            String configClass = 
AxisEngine.getGlobalProperty(AxisEngine.PROP_CONFIG_CLASS);
               if (configClass != null) {
                   try {
                       // Got one - so try to make it (which means it had better have
  
  
  
  1.67      +1 -1      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.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- AxisServer.java   9 May 2002 18:33:15 -0000       1.66
  +++ AxisServer.java   4 Jun 2002 22:58:32 -0000       1.67
  @@ -84,7 +84,7 @@
       public static AxisServer getServer(Map environment) throws AxisFault
       {
           if (factory == null) {
  -            String factoryClassName = System.getProperty("axis.ServerFactory");
  +            String factoryClassName = getGlobalProperty("axis.ServerFactory");
               if (factoryClassName != null) {
                   try {
                       Class factoryClass = Class.forName(factoryClassName);
  
  
  


Reply via email to