You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Arjan Tijms (JIRA)" <ji...@apache.org> on 2017/10/13 15:14:00 UTC

[jira] [Comment Edited] (OWB-1217) Store interceptor binding annotations in ContextData

    [ https://issues.apache.org/jira/browse/OWB-1217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16203684#comment-16203684 ] 

Arjan Tijms edited comment on OWB-1217 at 10/13/17 3:13 PM:
------------------------------------------------------------

It’s the responsibility of the code using the factory to pass in an annotation instance that the interceptor can work with. Of course, the using code can pass in an annotation instance that returns null for its attributes, which is normally impossible.

But I wouldn’t worry about that.

The only thing to worry about is getting the annotation instances, and additionally about getting them in 2 groups; the class level ones and the method ones.

The proof is in the pudding though and Weld shows that it’s possible (easiest is to look at the Weld source).


was (Author: arjan.tijms):
It’s the responsibility of the code using the factory to pass in an annotation instance that the interceptor can work with. Of course, the using code can pass in an annotation instance that returns null for its attributes, which is normally impossible.

But it wouldn’t worry about that.

The only thing to worry about is getting the annotation instances, and additionally about getting them in 2 groups; the class level ones and the method ones.

The proof is in the pudding though and Weld shows that it’s possible (easiest is to look at the Weld source).

> Store interceptor binding annotations in ContextData
> ----------------------------------------------------
>
>                 Key: OWB-1217
>                 URL: https://issues.apache.org/jira/browse/OWB-1217
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Interceptor and Decorators
>    Affects Versions: 2.0.1
>            Reporter: Arjan Tijms
>
> Unfortunately CDI doesn't give us an easy way to obtain the interceptor binding annotations from an interceptor call. See https://issues.jboss.org/browse/CDI-468
> Weld has a workaround for this that can be used until there's an actual spec compliant solution:
> {code:java}
> Set<Annotation> bindings = (Set<Annotation>) invocationContext.getContextData().get("org.jboss.weld.interceptor.bindings");
> {code}
> It would be great if OWB could do the same.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)