[
https://issues.jboss.org/browse/CDI-128?page=com.atlassian.jira.plugin.sy...
]
jaikiran pai commented on CDI-128:
----------------------------------
{quote}
In CDI, the meta-data will likely exist in an annotation, but it could exist in an XML
file (Candi, and Seam XML Extension for CDI).
{quote}
The same applies for EJB3, by the way. EJB3 can be completely driven by deployment
descriptor (ejb-jar.xml) or annotations or a combination of both.
{quote}
For example, I am working on creating a standard interceptor for JCache 107. I can read
the annotation from the getMethod of the InvocationContext,
{quote}
Note that the getMethod will return null for lifecycle interceptors. So if the annotation
is on a lifecycle method of the bean, then this won't work either.
{quote}
I propose we have an extension interface that extends InvocationContext called
CDIInvocationContext that has a getAnnotated. This way if someone annotates in an XML
file, then it is available to implementors for interceptors.
{quote}
Sorry, I don't fully understand that last part. Could you please elaborate on what
annotation in a XML file means?
Maybe I am misunderstanding this feature request, but, I am not too sure if we need this
CDI specific invocation context. For example, in EJB3 land too, the intercepted method can
have various spec specified annotations on it and at the same time each of those
annotations has a corresponding deployment descriptor based XML equivalent.
Ability to access CDI enhanced metadata from the
InvocationContext.getMethod()
------------------------------------------------------------------------------
Key: CDI-128
URL:
https://issues.jboss.org/browse/CDI-128
Project: CDI Specification Issues
Issue Type: Feature Request
Affects Versions: 1.0
Reporter: Richard Hightower
Fix For: TBD
The issues with InvocationContext is it was designed before CDI as part of EJB 3. In CDI,
the meta-data will likely exist in an annotation, but it could exist in an XML file
(Candi, and Seam XML Extension for CDI).
For example, I am working on creating a standard interceptor for JCache 107. I can read
the annotation from the getMethod of the InvocationContext, but if someone added the
interception meta-data in an XML file, then it will not be available to
InvocationContext.getMethod().getAnnotation(Cacheable.class).
I propose we have an extension interface that extends InvocationContext called
CDIInvocationContext that has a getAnnotated. This way if someone annotates in an XML
file, then it is available to implementors for interceptors.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira