axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <>
Subject ATTN Richard : System properties and suchlike
Date Sun, 04 Aug 2002 13:06:44 GMT

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?


View raw message