admin@glassfish.java.net

Re: changing the name of an application

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Fri, 21 Mar 2008 11:16:00 -0700

Kedar,

AFAIK, it *must* have a setter so that the value can be set initially.

On Mar 21, 2008, at 11:08 AM, Kedar Mhaswade wrote:
> Lloyd L Chambers wrote:
>> I think in V2 it was read-only at runtime even though there was a
>> setName().
>> AMX exposes only the getName() method, so it is not possible to
>> change the name through AMX.
>> But if code does call setName() through the config API (or some
>> other generic way that bypasses AMX), then this is a real problem
>> (I think):
>> - MBeans won't have the right names
>> - references will break
>> - things might not match on-disk
>> I don't know the solution, since setName() is required to inject
>> the values into the @Configured object.
>> JEROME, I wonder if we should modify @Attribute to have a flag that
>> says "read only", allowing the field to be set only once? EG the
>> equivalent of 'final'.
>
> Can't this be achieved if the config bean interface does NOT have
> a set method for an attribute?
>
>> Lloyd
>> On Mar 21, 2008, at 9:31 AM, Hong Zhang wrote:
>>> Hi, Lloyd
>>>
>>>> I see that Application.java has a setName() method:
>>>>
>>>> /**
>>>> * Sets the value of the name property.
>>>> *
>>>> * @param value allowed object is
>>>> * {_at_link String }
>>>> */
>>>> public void setName(String value) throws PropertyVetoException;
>>>>
>>>>
>>>> This has some significant ramifications since <application-ref>
>>>> elements refer to it, MBeans use the name, etc.
>>>>
>>>> Is this a mistake, or are we intending to allow dynamic changes
>>>> to the name of an application (and WebModule, etc)?
>>>>
>>> I added this mainly because I noticed the config beans for the
>>> other similar elements (such as WebModule) all have this method.
>>> If the set method here means to expose the attribute as an
>>> writable attribute, we should remove the method. I don't think we
>>> intend for the user to change the name. BTW: I noticed the setName
>>> method exist in v2 workspace for WebModule etc also.
>>>
>>> Thanks,
>>>
>>> - Hong
>> ---
>> Lloyd L Chambers
>> lloyd.chambers_at_sun.com
>> Sun Microsystems, Inc
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>

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