users@ejb-spec.java.net

[ejb-spec users] [jsr345-experts] Re: Meta-Annotations

From: Pete Muir <pmuir_at_bleepbleep.org.uk>
Date: Tue, 7 Feb 2012 14:40:43 +0000

On 7 Feb 2012, at 02:09, Marina Vatkina wrote:

> Returning back to it...
>
>
> Pete Muir wrote:
>> On 16 Dec 2011, at 07:41, Marina Vatkina wrote:
>>
>>
>>> I think we need to sort this all out very slowly...
>>>
>>> Pete Muir wrote:
>>>
>>>> Possibly I misunderstood you. I meant we would need to specify that
>>>> the annotations to which we add the ANNOTATION_TYPE target would need
>>>> to be specified as usable as meta-annotations,
>>>>
>>> Isn't an annotation with an ANNOTATION_TYPE target type, a meta-annotation by default? In David's example @Metatype seems to be a marker for the derived annotations (for easier processing?)
>>>
>>
>> It is, but I think the spec needs to say what annotations can be used like this,
>
> Do you mean not only add ANNOTATION_TYPE target, but spell them out explicitly in the spec?

You could say "any annotation which has ANNOTATION_TYPE as a target is a metaannotation" in the spec, but I think the spec needs *some* mention...

>
>> and also require implementations to process this.
>>
>
> Do you suggest this feature to be available outside CDI?
>
> If not, how will the derived annotations be different from the CDI @Stereotype?

I assumed the proposal was for pure EJB.

Alternatively, it could be that we simply say that any EJB annotation is allowed on a CDI stereotype.

>>
>>>> it's not enough to just
>>>> add the target to them... We would need to specify whether they can be
>>>> applied recursively or not etc.
>>>>
>>> Do you mean their derived annotations (like @Yearly in David's example)?
>>>
>>
>> Yes.
>>
>>
>>> Another question: would we expect CDI to be responsible for processing those derived (@Metatype ?) annotations? Or would all other containers need to process them even if CDI is not enabled?
>>>
>>
>> I guess it depends where they end up. We could tack this onto CDI, but I would prefer it in the platform or a new spec I think.