users@javaee-spec.java.net

[javaee-spec users] [jsr342-experts] Re: Clarifying Interceptor usage in the EE Spec ?

From: Antonio Goncalves <antonio.goncalves_at_gmail.com>
Date: Tue, 12 Feb 2013 10:21:14 +0100

As you say Linda, we once thought of extracting @Shedule from EJB and
moving it to Manabed Beans. So around-timeout today is only restrcited to
EJBs but, hopefully, will change in the future.

Antonio

On Mon, Feb 11, 2013 at 8:23 PM, Linda DeMichiel <linda.demichiel_at_oracle.com
> wrote:

> Hi Antonio,
>
> This item was addressed back in December. See the thread that begins
> http://java.net/projects/**javaee-spec/lists/jsr342-**
> experts/archive/2012-12/**message/1<http://java.net/projects/javaee-spec/lists/jsr342-experts/archive/2012-12/message/1>
> (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.
>
> Linda
>
>
>
> On 2/11/2013 4:51 AM, Antonio Goncalves wrote:
>
>> Hi all,
>>
>> 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 |
>> Ordering
>> ----------+---------------+---**-------------+----------------**
>> --+------------+--------------**-------+---------------------+**---------
>> 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 ?
>>
>> Antonio
>>
>


-- 
Antonio Goncalves
Software architect and Java Champion
Web site <http://www.antoniogoncalves.org> |
Twitter<http://twitter.com/agoncal>|
LinkedIn <http://www.linkedin.com/in/agoncal> | Paris
JUG<http://www.parisjug.org> |
Devoxx France <http://www.devoxx.fr>