This item was addressed back in December. See the thread that begins
(and associated matrix), and spec sections EE5.2.5 and 5.24. Table 5-1 will be
updated in the next draft of the spec, as WebSocket endpoints now also support
injection and interceptors. (I should note also that we awaiting clarification
from the JAX-RS leads as to the details of JAX-RS support.)
In your table below, around-timeout is the outlier in terms of TimerService support.
However, as we noted, this is a feature we might consider adding in a future version
of the platform. Interceptors with around-timeout methods would not be disallowed
in components other than EJBs. However, they would be non-functional, as use of the
TimerService is not supported in other containers.
On 2/11/2013 4:51 AM, Antonio Goncalves wrote:
As you might know the Interceptor 1.2 specification has made lots of progress lattelly (still some updates in the pipe
though). After reading the document I got a bit confused on which component model were allowed in which type of
interceptors. So I proposed the spec leads to have a table that would look like this :
Component | Around-invoke | Around-timeout | Around-construct | Life cycle | Interceptor binding | Default interceptor |
EJB | Y | Y | Y | Y | | |
CDI Bean | Y | N | Y | Y | | |
Servlet | N | N | N | N | | |
JAX-WS | ... | ... | ... | ... | | |
JAX-RS | ... | ... | ... | ... | | |
... | ... | ... | ... | ... | | |
This is what Pete Muir answered "when we drafted this we tried to not describe how interceptors work in CDI or EJB.
Instead, we tried to describe how interceptors work, along with any extension points where other specs may alter or add
functionality. We then gave examples of how EJB and CDI do extend the spec (partly as that is what we know best, partly
as they are the main users of the spec)." and then Pete added "Antonio, I think your table would be a good fit for the
Java EE spec though!"
Sometimes developpers get confused about what to use when. Can a JAX-WS use interceptors ? Well, no, but if it's treated
like a @Stateless EJB, yes. Do you think that having such a recap table would make sense in the Java EE spec ?
[javaee-spec users] [jsr342-experts] Re: Clarifying Interceptor usage in the EE Spec ?