jsr345-experts@ejb-spec.java.net

[jsr345-experts] Re: [JIRA] Created: (EJB_SPEC-30) Extension of @DependsOn annotation with Class[] beans() element

From: Carlo de Wolf <cdewolf_at_redhat.com>
Date: Wed, 09 Nov 2011 10:42:36 +0100

On 11/09/2011 07:08 AM, Adam Bien wrote:
> I would propose the following rules:
>
> 1. If name and class is specified at the same time, the name wins

Name as the primary qualifier, but if the bean doesn't expose said class
then it should still be a deployment error.

Ah crock, now I see the problem. I kind-off assumed it worked similar to
@EJB.

Carlo
> 2. If a class is specified, and multiple deployments of the same EJB exist, you will get an error like "Ambiguous Dependency Error"
> 3. For both cases: the ordering of classes or names specifies the order of startup-dependencies
>
> My main use case is pragmatic: auto-completion in the IDE :-)
>
> On 09.11.2011, at 03:05, Marina Vatkina wrote:
>
>> (moving discussion to the appropriate alias)
>>
>> David,
>>
>> @DependsOn defines the order in addition to the dependency. Annotation on the @EJB doesn't allow that. Also, you might want to depend on a bean and do not need to inject it...
>>
>> Adam,
>>
>> How would you define the rules about the classes vs. the names? Can both be specified at the same time? If yes, will the combination of classes and names be used? How would they be ordered in that case?
>>
>> thanks,
>> -marina
>>