admin@glassfish.java.net

Re: admin commands _at_Scoped(PerLookup.class)

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Thu, 03 Jun 2010 16:04:08 -0700

Yow! We documented this? How cool!

Ok, gotta fix a bunch of command classes...

Although I *still* don't understand why you'd ever want a command
class to be anything other than per-lookup.


Paul M Davies (Oracle) wrote on 06/03/2010 02:40 PM:
> Hi,
>
> The official product documentation offers essentially the same advice as
> Bill. See Ensuring That an AdminCommand Implementation Is Stateless
> <http://docs.sun.com/app/docs/doc/820-7727/ghrng?l=en&a=view> in the
> /Add-On Component Development Guide/.
>
> Regards,
> -Paul
>
> On 06/03/10 14:36, Bill Shannon wrote:
>> I just fixed a bug in my admin command that caused it to fail when
>> multiple clients were using the same command. I forgot to add
>> @Scoped(PerLookup.class). Without that, a second client executing
>> the same command that a first client is executing will overwrite
>> the parameters from the first client.
>>
>> Seems to me *all* admin commands should have @Scoped(PerLookup.class),
>> yet I see many others that are missing it as well. (I suppose an
>> exception could be made for commands with no parameters and no
>> writable fields, but is that an important use case? I doubt it.)
>>
>> Anybody disagree?
>>
>> Isn't this a bug just waiting to happen?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>
>
> --
> Paul Davies, Principal Technical Writer, Oracle Corporation.
> http://blogs.sun.com/techscribe/
>