admin@glassfish.java.net

V3 configuration data types API change (please read) [resend in plain text]

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Fri, 25 Jan 2008 11:54:49 -0800

VARIABLES in GlassFish config

In GlassFish V2, there is a form of variable substitution whereby
any Attribute can be of the form ${VAR_NAME}, with values from
<system-properties> providing the actual value at runtime. This is
very useful in multi-server systems, where different values can be
substituted at runtime (eg for a port). Thus, every Attribute
potentially is of type java.lang.String, and any API exposing that
Attribute must also be of type java.lang.String to support these
variable substitution.

AMX APIs for config

AMX (JMX management API for managing the appserver) use data types
which are largely java.lang.String. However, there is use of 'int',
'boolean', 'long' in some places. For example, HTTPListenerConfig
includes:

        public boolean getEnabled();
        public void setEnabled( boolean value );
(see https://glassfish.dev.java.net/nonav/javaee5/amx/javadoc/com/sun/
appserv/management/config/HTTPListenerConfig.html )

In short, the AMX API is broken should a variable be used for the
'enabled' Attribute. Short of using overloaded getters/setters with
different signatures, there is no other apparent resolution to this
issue.

PROPOSAL for V3

To support variables which are inherently multi-types (String or
'int'/'boolean'/etc), all attributes will become type
java.lang.String in the AMX interfaces. This will be an incompatible
change, and it removes compile-time type safety.

Please convey any concerns or suggestions you might have.

---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc
---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc