Hello group,I have been coordinating with the platform spec to give CDI interceptors for method validation a late priority. We had to build both the notion of priority and the notion of constructor interceptors.Quickly read through this email which capture the result of the priority discussions. IMO the agreed proposal is good.Emmanuel
Begin forwarded message:From: Linda DeMichiel <linda.demichiel@oracle.com>
Date: 5 février 2013 03:48:30 UTC+01:00
To: Emmanuel Bernard <emmanuel.bernard@jboss.com>
Cc: Bill Shannon <bill.shannon@oracle.com>, Marina Vatkina <marina.vatkina@oracle.com>
Subject: Fwd: [jsr342-experts] Re: Priority of interceptorsHi Emmanuel,
Setting the priority for Bean Validation to PLATFORM_AFTER+800 is
fine with me as well. This belongs in the Bean Validation spec, so
please proceed with that.
thanks,
-Linda
-------- Original Message --------
Subject: [jsr342-experts] Re: Priority of interceptors
Date: Mon, 04 Feb 2013 14:26:15 -0800
From: Bill Shannon <bill.shannon@oracle.com>
Reply-To: jsr342-experts@javaee-spec.java.net
To: jsr342-experts@javaee-spec.java.net
CC: Emmanuel Bernard <ebernard@redhat.com>, Paul Parkinson <paul.parkinson@oracle.com>, Marina Vatkina <marina.vatkina@oracle.com>
Linda DeMichiel wrote on 02/04/13 11:53:Feedback and questions regarding interceptor priority fromthe Bean Validation spec lead. Please weigh in as appropriate
thanks,-Linda
On 2/4/2013 11:10 AM, Emmanuel Bernard wrote:(Linda, can you forward to the jsr342 list, I don't think I have write
access).Thanks for this work.## QuestionThe spec claims:An interceptor bound to a component using interceptor binding, may be enabledfor the entire applica- tion by applying the Priority annotation, along witha priority value, on the interceptor class.Does that mean that without @Priority, the interceptor is not enabledfor the entire application?
Unless you enable it in beans.xml.And to clarify my doubts, you still enforcethat the binding annotation must be present for the interceptor to beapplied on a given method or class, correct?
I believe that's still a requirement.## ProposalHave you guys considered adding a END_OF_PLATFORM_AFTER = 5000 so thatif for some reasons, people want to go after Java EE platform elements,they can do so.
I suppose we could consider it.BTW, I think the spec should clarify that negative priority are accepted
and that signed number ordering happen.
We already decided to reserve negative numbers for a future use.
## Bean Validation priorityIf we go with that route (allocating 1000 to the platform_aftersection), I'm tempted to place Bean Validation priority to
PLATFORM_AFTER+800.Why? Well:1. it makes for a beautiful symmetry with JTA :)2. and it reflects our opinion that BV should happen relatively late
just like JTA should happen relatively early, but still offer an opendoor to override these propositions.
Seems fine to me.EmmanuelOn Thu 2013-01-31 11:22, Linda DeMichiel wrote:The revisions to the Interceptor spec to accommodate the improved
managed bean alignment are nearly complete. You can download thecurrent draft of the spec from the interceptor-spec.java.net projectat http://java.net/projects/interceptors-spec/downloads
One of the issues that we still need to resolve, however, is theassignment of priorities to the new transactional interceptors being
defined by JTA and the Bean Validation interceptors that handlemethod validation.
Section 5.5 of the Interceptors spec defines the following Priorityvalues (see the spec for the details):Interceptor.Priority.PLATFORM_BEFORE = 0Interceptor.Priority.LIBRARY_BEFORE = 1000Interceptor.Priority.APPLICATION = 2000Interceptor.Priority.LIBRARY_AFTER = 3000
Interceptor.Priority.PLATFORM_AFTER = 4000In our earlier discussions, we concluded that transactional
interceptors needed to come relatively early in the interceptor chain.To put a stake in the ground, we propose that we define these to havea priority of Interceptor.Priority.PLATFORM_BEFORE+200.Validation interceptors, however, should come relatively late,since they will ensure that the parameters that reach the method(which might have been modified by other interceptors) are valid.Again, to put a stake in the ground, we'll propose a priority ofInterceptor.Priority.PLATFORM_AFTER+1000.
Comments please!Emmanuel, Paul, could you please consult with your expert groupsfor further input as well...thanks,-Linda
_______________________________________________
beanvalidation-dev mailing list
beanvalidation-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/beanvalidation-dev