dev@glassfish.java.net

Re: Config events convey raw values, not translated

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Thu, 08 Oct 2009 16:18:04 -0700

Tim Quinn wrote:
> If the user changes a config value (I tried using the admin console)
> that contains a token (such as ${com.sun.aas.instanceRoot}) then the
> event delivered to the "change" method returns the untranslated old and
> new values, still containing the tokens.
>
> Maybe this has been discussed before and I've forgotten... Is there
> something the "change" method can do to translate the values? It seems
> that the injected configuration object has already been updated with the
> translated new value. Is that expected and reliable?
> Thanks.

Tim,

Incidentally, I had some conversation with Jerome on this just yesterday
and I think it is an issue.

IMO, The config layer should already resolve (expand) the variable in
the configuration object given to the changed method in ConfigListener
so that the runtime code does not have to do anything there.

Alternatively, the variable expansion is just doing a replacement from
system properties. So in the changed method, if a particular attribute
contains {xxx} you could replace it with System.property(xxx). I have
tried it and it seems to work.

I am going to spend some time on making the injected configuration
object have the variable-expanded values though.

Let me know if the above work-around works for you ...

Regards,
Kedar

>
> - Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>