admin@glassfish.java.net

Re: V3 configuration data types API change (please read)

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Fri, 01 Feb 2008 10:58:58 -0800

Bill,

Terminology: ${FOO_VAR} is "resolved" to an actual value by looking
at system properties, "resolved" being synonymous with "translated".

System properties can exist in the following elements:
- <config>
- <server>
- <cluster>
- <domain>

So to resolve a system property, one cannot simply look in one global
place; MBeans contained (directly or indirectly) under one <config>
will resolve differently than those contained under another config.

Assume 'amx' is a client-side proxy to an AMX MBean--

I would much rather write:
String value = amx.resolveAttribute( "MyAttribute" );

than:
AttributeResolver resolver = <get it somewhere>;
String target = getTheTargetSomehow( amx ); // AMX has no concept of
'target'
String attrValue = amx.getAttribute( "MyAttribute" );
String value = resolver.resolveAttribute( attrValue, target );

The latter is a truly ugly procedurally-oriented kludge. And it
doesn't wrok at all if we add decide for some reason to add system
properties at additional intermediate scopes lower than server/
cluster/config.

Lloyd

On Jan 31, 2008, at 3:08 PM, Bill Shannon wrote:

> Lloyd L Chambers wrote:
>> Regarding the translation issue, there is (or might be) an object-
>> oriented aspect to it eg the MBean scope (context/containment)
>> indicates where to look for the translated Attribute.
>
> I don't understand this. (I'm also getting confused by the
> terminology.
> translation==resolution==expansion in this context, right? I just
> think
> of this as variable expansion.)
>
> What's an example of an attribute value where the translated value
> depends on which attribute is being used?

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