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...@us.ibm.com on 2002/08/05 01:34:41 UTC

Re: System properties and suchlike

The current AxisProperties allows me to:

1.  Load AXIS properties during system initialization
      (appServer classloader is current thread context class loader)
1.a.  Specify which are 'set' (cannot be overriden) and which are 
'default' (can be overriden)

2.  Load AXIS AXIS properties during web-app setup
      (webApp classloader is a) current thread context class loader, and
      b) decendant of appServer class loader)

3.  During AXIS execution, getProperty() retrieves the value from the
      highest class loader (appServer) which 'set' the value,
      or from lower class loader if higher set 'default'.

This allow secure control in the managed environ (webapp can override 
appserver only if appserver allows..), with overrides of EVERYTHING if you 
actually set the System property.

The only two exception are currently the TRANSPORT_PROPERTY and 
MimeUtils...  those still use system properties until I can figure out a 
proper alternative.
a.  TRANSPORT_PROPERTY can be handled with this same scheme, I think, but 
then it's not clear to me WHY we need to use setProperty at all with this 
one.  Note that in our managed environ, if we do an initial 
setProperty(TRANSPORT_PROPERTY) at that appServer level, and in the webapp 
we do our get/set sequence, the write-back will occur at a lower class 
loader, and will NOT override the value set at the higher.... but again, 
why would we even want to?
b.  MimeUtils should come along as soon as I/someone implements 
'getProperties()' method for AxisProperties.


BTW, thanks for fixing the javadoc!
<ras>

*******************************************
Richard A. Sitze
IBM WebSphere WebServices Development




Glen Daniels <gd...@macromedia.com>
08/04/2002 08:06 AM
Please respond to axis-dev
 
        To:     "Axis-Dev (E-mail)" <ax...@xml.apache.org>
        cc: 
        Subject:        ATTN Richard : System properties and suchlike

 



Here's my suggestion.

Why not have a "managedEnvironment" flag, which allows/disallows setting 
system properties (and perhaps other things later)?  Take the few places 
where we call System.setProperty() and replace them with 
AxisProperties.setSystemProperty(), which looks something like this:

    if (managedEnvironment) {
         throw new Exception("Can't set system properties in a managed 
environment");
    }
    System.setProperty(prop, value);

Then you put a static initializer in AxisProperties which sets 
managedEnvironment based on the value of a system property:

    static {
        String val = System.getProperty(MANAGED_ENV_PROPERTY);
        managedEnvironment = (val == null) || 
(val.compareToIgnoreCase("true") == 0);
    }

Now you just need to make sure that when you embed Axis in a container, 
you a) somehow arrange for your deployment stuff to set the appropriate 
properties for transport packages, MIME stuff, etc. and b) set the 
MANAGED_ENV_PROPERTY ("axis.managedEnvironment" or something) to "true".

What do you think?

--Glen