admin@glassfish.java.net

Re: admin commands _at_Scoped(PerLookup.class)

From: Jerome Dochez <jerome.dochez_at_oracle.com>
Date: Fri, 4 Jun 2010 09:51:07 -0700

this is actually a missing feature in hk2 IMO

I should add support for annotating the contract and enforce that scope.
The only question remaining would be : what do we do if the scope is overridden on the service implementation with a different scope. Is this a bug in the user code? should it be an intentional possibility that you want particular services implementation to use a specific scope.

I am leaning towards making it a bug as it is not respecting the scope defined by the contract.
wdyt ?

On Jun 3, 2010, at 2:36 PM, 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
>