jsr345-experts@ejb-spec.java.net

[jsr345-experts] Re: [ejb-spec users] Re: Re: Interceptors spec 1.2 draft is available for review

From: Pete Muir <pmuir_at_bleepbleep.org.uk>
Date: Mon, 11 Feb 2013 10:27:09 +0000

To add to Marina's comment, 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).

If you spot bits that aren't doing the above, then let us know, and we'll try to fix it.

On 11 Feb 2013, at 01:55, Marina Vatkina wrote:

> Hi Antonio,
>
> Thanks for reviewing. It's good that you didn't have many issues with the new version of the spec - it means it's in a good shape ;).
>
> We didn't want the Interceptors spec to prescribe how it is used, but let other specs choose their way. As it stands today, the @Interceptors annotation is supported by the EJB and @ManagedBean specs. The Interceptor binding by the CDI spec. So in theory, you can have both types on an EJB (though it's not advisable), that's why the ordering section even tells you the order if both types are present.
>
> Otherwise, only AroundTimeout is special for the EJBs, but just because the Timer Service had not yet expanded into the CDI.
>
> The AroundConstruct is coming on Monday or Tuesday the latest.
>
> The spec is under MR, so it belongs to the same JSR as it was released. It's previous (only) version was 1.1 (even though the EJB spec had 3.1 version under the same JSR), so the updated one is 1.2.
>
> Hope this all makes sense.
>
> Best,
> -marina
> On 2/10/13 8:22 AM, Antonio Goncalves wrote:
>> Hi all,
>>
>> I read the spec, nothing much to say and waiting for the update with around-construct. But one point that bothers me : after reading the document I get confused on which component model allows which kind of interceptors. So I have to re-read the spec. Wouldn't it be easier 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 | ... | ... | ... | ... | | |
>> ... | ... | ... | ... | ... | | |
>>
>> The specification talks mainly about CDI and EJB, but at some point talks about JAX-WS (and the MessageContext), but what about JAX-RS, Servlets, MDB... it would be clearer to have a table that summarizes the spec.
>>
>> My 2 cents
>> Antonio
>>
>> PS : BTW, at the beginning of the document it says "JSR 318 Interceptors 1.2". Strange, still attached to EJB 3.1 ? What about EJB 3.2 ? And what about evolving on its own JSR ?
>>
>>
>> On Sun, Feb 10, 2013 at 2:32 AM, Marina Vatkina <marina.vatkina_at_oracle.com> wrote:
>> The @Priority is defined in the common annotation spec: http://java.net/projects/javaee-spec/pages/CommonAnnotations1_2MR and it's value attribute is of type int. The Interceptors spec uses that value to setup the ranges.
>>
>> We will need to teach people to use 10 or 50 or even 100 as the add-on to the range bottom ;)
>>
>> Best,
>> -marina
>>
>>
>> On 2/8/13 6:09 PM, David Blevins wrote:
>> Like Mark, my vote would be for float or double -- probably double.
>>
>>
>> In the simple case it looks like an int, but has the flexibility if someone does something like @Priority(1), @Priority(2), @Priority(3), @Priority(4) with no forethought that they should leave space or how much space they should leave.
>>
>> If someone does the above it's very much a "rock and hard place" type of issue. With float you could always later sneak an interceptor into any stack, say @Priority(2.5). Or more likely, someone used @Priority(1) and then someone comes along later and wants to slip in an interceptor ahead of it @Priority(0.5)
>>
>> In my mind float/double allows people to still use ints in source yet is future-proof. No possible way they can code themselves into a corner.
>>
>>
>> -David
>>
>> On Feb 6, 2013, at 8:49 AM, Jeremy Bauer <jrbauer_at_us.ibm.com> wrote:
>>
>> Hi Marina,
>>
>> One minor comment/question. Rather than using integer-based priority ranges, did you consider using strict priority types and weight? For example, @Priority(type=APPLICATION, weight=10). An integral value with proposed ranges is simpler and very flexible, but using a specific type would make the intent of the interceptor/interception point more concrete.
>>
>> -Jeremy
>>
>>
>>
>> From: Jeremy Bauer/Rochester/IBM_at_IBMUS
>> To: marina.vatkina_at_oracle.com,
>> Cc: jsr345-experts_at_ejb-spec.java.net
>> Date: 02/04/2013 10:18 AM
>> Subject: [ejb-spec users] [jsr345-experts] Re: Re: Interceptors spec 1.2 draft is available for review
>>
>>
>>
>> Thanks, Marina.
>>
>> It certainly was a lot of work, which is even more evident from the diff! Thank you for posting. It is helpful. I'll post comments soon.
>>
>> -Jeremy
>>
>>
>>
>> From: Marina Vatkina <marina.vatkina_at_oracle.com>
>> To: jsr345-experts_at_ejb-spec.java.net,
>> Date: 02/01/2013 08:31 PM
>> Subject: [ejb-spec users] [jsr345-experts] Re: Interceptors spec 1.2 draft is available for review
>>
>>
>>
>> I uploaded the file with diffs if it's of any help: http://java.net/projects/interceptors-spec/downloads/download/interceptor-1-2-dr1-diff.pdf
>>
>> -marina
>>
>> On 2/1/13 1:31 PM, Marina Vatkina wrote:
>> Hi Jeremy,
>>
>> It was a lot of work ;). I can create a diff from the original+ (i.e. the version that Linda created in the framemaker from 1.1), but it will also show a lot of changes, not the changes for a specific sentence.
>>
>> -marina
>>
>> On 2/1/13 1:16 PM, Jeremy Bauer wrote:
>> Hi Marina,
>>
>> The change bars cover nearly the entire document, making it difficult to target the updated sections. If possible, can you provide a document with more accurate change bars?
>>
>> -Jeremy
>>
>>
>>
>> From: Marina Vatkina <marina.vatkina_at_oracle.com>
>> To: jsr345-experts_at_ejb-spec.java.net, Pete Muir <pmuir_at_redhat.com>,
>> Date: 01/29/2013 04:07 PM
>> Subject: [jsr345-experts] Interceptors spec 1.2 draft is available for review
>>
>>
>>
>> After a lot of work by Linda, me, and Pete, we have the Interceptors
>> spec 1.2 draft for review:
>> http://java.net/projects/interceptors-spec/downloads/download/interceptor-1-2-dr1.pdf
>>
>> What's there:
>> Editorial cleanup and conversion to standard template.
>> Assigned chapter numbers to sections and rearranged various sections and
>> examples for better flow.
>> Clarified statement regarding transaction context of lifecycle callback
>> methods
>> Added a note on a timeout method that is also a business method and
>> around-timeout and around-invoke interceptors
>> Added Chapter 1 (Overview)
>> Added Chapter 3, derived from Chapter 9 of the CDI specification.
>> Removed deployment descriptors definitions (general notes about
>> possibility of DDs are there)
>> Added examples with interceptor bindings to common sections.
>> Added standard Priority ranges
>>
>> What's not there:
>> @AroundConstruct interceptor
>> Notes on "throws Exception" clauses in the around-xxx method signatures
>> Perfect CDI alignment - the text (and fonts) might be not fully aligned.
>>
>> Please review ASAP.
>>
>> Pete, please forward to the CDI EG.
>>
>> thanks,
>> -marina
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> Antonio Goncalves
>> Software architect and Java Champion
>>
>> Web site | Twitter | LinkedIn | Paris JUG | Devoxx France
>