admin@glassfish.java.net

Re: V3 configuration data types API change ("views stuff")

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

Bill,

In XML everything is a String of course, so we'll have to map data
types if we choose to allow non-String types (eg 'int').

I suggest these rules for V3:

- A V3 config that uses a type other than 'String' is implicitly
saying that variables may NOT be used eg no ${VAR} is possible.

- A V3 config that uses 'String' might (optionally) have an
annotation that describes its intended types (and possibly even
values). The framework would accept only Strings that are value $
{VAR} constructs or values consistent with the end type. Example:
@Attribute(..., type="int:0..65535")

The danger of auto-resolving values is the following code:
something.setPort( something.getPort() ); <=== the ${VAR} is now
obliterated

...

TODAY in V2, AMX does NOT resolve the value. See below:

jmxcmd> find j2eeType=X-HTTPListenerConfig
amx:j2eeType=X-HTTPListenerConfig,name=admin-listener,X-
ConfigConfig=server-config,X-HTTPServiceConfig=na
amx:j2eeType=X-HTTPListenerConfig,name=http-listener-1,X-
ConfigConfig=default-config,X-HTTPServiceConfig=na
amx:j2eeType=X-HTTPListenerConfig,name=http-listener-1,X-
ConfigConfig=server-config,X-HTTPServiceConfig=na
amx:j2eeType=X-HTTPListenerConfig,name=http-listener-2,X-
ConfigConfig=default-config,X-HTTPServiceConfig=na
amx:j2eeType=X-HTTPListenerConfig,name=http-listener-2,X-
ConfigConfig=server-config,X-HTTPServiceConfig=na

jmxcmd> get Port last-found
---amx:j2eeType=X-HTTPListenerConfig,name=http-listener-2,X-
ConfigConfig=default-config,X-HTTPServiceConfig=na---
Port=${HTTP_SSL_LISTENER_PORT}

---amx:j2eeType=X-HTTPListenerConfig,name=admin-listener,X-
ConfigConfig=server-config,X-HTTPServiceConfig=na---
Port=4848

---amx:j2eeType=X-HTTPListenerConfig,name=http-listener-1,X-
ConfigConfig=server-config,X-HTTPServiceConfig=na---
Port=${HTTP_LISTENER_PORT}

---amx:j2eeType=X-HTTPListenerConfig,name=http-listener-1,X-
ConfigConfig=default-config,X-HTTPServiceConfig=na---
Port=${HTTP_LISTENER_PORT}

---amx:j2eeType=X-HTTPListenerConfig,name=http-listener-2,X-
ConfigConfig=server-config,X-HTTPServiceConfig=na---
Port=8181


Lloyd

On Feb 1, 2008, at 5:29 PM, Bill Shannon wrote:

> So let me see if I understand how this "views" stuff is going to work.
>
> I'm going to define a config object with an "int getPort()" method.
> Code that asks for the "normal" view of that config object will
> use that method and get back a "resolved" integer for the port number.
> Code that asks for the "raw" view of that config object will get an
> object of some other type that has a "String getPort" method, which
> will return the unresolved String value for the port number.
>
> Is that right?
>
> Who defines the type for the "raw" view object? Is it generated
> automatically? Is it a name derived from the original config object?
>
> And the AMX interface will be somehow derived from this "raw" view?
> Or does AMX not depend on these config objects at all, instead
> accessing
> the data at the "mini-DOM" level?
>
> Sorry, I still can't put all the pieces together here...

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