users@javaee-spec.java.net

[javaee-spec users] [jsr342-experts] Re: _at_Priority

From: Pete Muir <pmuir_at_bleepbleep.org.uk>
Date: Tue, 11 Dec 2012 09:02:50 +0100

On 11 Dec 2012, at 00:10, Bill Shannon wrote:

> Pete Muir wrote on 12/10/12 02:41:
>> Bill, as discussed I think we should sort out the priority ranges to be
>> blocks of 1000 each - as multiple people pointed out to me, we aren't running
>> out of integers any time soon!
>
> Yes, I accidentally sent out an older version of the proposal, before I
> made that change.
>
>> Also, as Emmanuel has proposed, it's worth discussing whether we should have
>> an enum or group of statics on a class somewhere that define the values used
>> by Java EE specs, so you can do Interceptors.Validation + 100 (or something
>> like that) as your priority.
>
> That's an interesting idea.
>
> Let's look at the new transactional interceptor as an example...
>
> We will define a new javax.transaction.Transactional interceptor binding
> annotation, but we won't define the name of the interceptor class that
> handles this annotation. We could define a static int
> javax.transaction.Transactional.PRIORITY = 123. Would it be weird for
> that static int to be on the annotation class?
>
> Otherwise, there doesn't really seem to be any obvious place to put it.

That's a good place to put it IMO. Emmanuel and I had struggled with the same problem.

>
> I *definitely* don't want to have a central class that has priorities for
> lots of interceptors in other specs.