<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hello group,</div><div><br></div><div>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.</div><div><br></div><div>Quickly read through this email which capture the result of the priority discussions. IMO the agreed proposal is good.&nbsp;</div><div><br></div><div>Emmanuel<br><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div><b>From:</b> Linda DeMichiel &lt;<a href="mailto:linda.demichiel@oracle.com">linda.demichiel@oracle.com</a>&gt;<br><b>Date:</b> 5 fĂ©vrier 2013 03:48:30 UTC+01:00<br><b>To:</b> Emmanuel Bernard &lt;<a href="mailto:emmanuel.bernard@jboss.com">emmanuel.bernard@jboss.com</a>&gt;<br><b>Cc:</b> Bill Shannon &lt;<a href="mailto:bill.shannon@oracle.com">bill.shannon@oracle.com</a>&gt;, Marina Vatkina &lt;<a href="mailto:marina.vatkina@oracle.com">marina.vatkina@oracle.com</a>&gt;<br><b>Subject:</b> <b>Fwd: [jsr342-experts] Re: Priority of interceptors</b><br><br></div></blockquote><blockquote type="cite"><div><span>Hi Emmanuel,</span><br><span></span><br><span>Setting the priority for Bean Validation to PLATFORM_AFTER+800 is</span><br><span>fine with me as well. &nbsp;&nbsp;This belongs in the Bean Validation spec, so</span><br><span>please proceed with that.</span><br><span></span><br><span>thanks,</span><br><span></span><br><span>-Linda</span><br><span></span><br><span></span><br><span>-------- Original Message --------</span><br><span>Subject: [jsr342-experts] Re: Priority of interceptors</span><br><span>Date: Mon, 04 Feb 2013 14:26:15 -0800</span><br><span>From: Bill Shannon &lt;<a href="mailto:bill.shannon@oracle.com">bill.shannon@oracle.com</a>&gt;</span><br><span>Reply-To: <a href="mailto:jsr342-experts@javaee-spec.java.net">jsr342-experts@javaee-spec.java.net</a></span><br><span>To: <a href="mailto:jsr342-experts@javaee-spec.java.net">jsr342-experts@javaee-spec.java.net</a></span><br><span>CC: Emmanuel Bernard &lt;<a href="mailto:ebernard@redhat.com">ebernard@redhat.com</a>&gt;, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Paul Parkinson &lt;<a href="mailto:paul.parkinson@oracle.com">paul.parkinson@oracle.com</a>&gt;, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Marina Vatkina &lt;<a href="mailto:marina.vatkina@oracle.com">marina.vatkina@oracle.com</a>&gt;</span><br><span></span><br><span>Linda DeMichiel wrote on 02/04/13 11:53:</span><br><blockquote type="cite"><span>Feedback and questions regarding interceptor priority from</span><br></blockquote><blockquote type="cite"><span>the Bean Validation spec lead. &nbsp;Please weigh in as appropriate</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>thanks,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>-Linda</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>On 2/4/2013 11:10 AM, Emmanuel Bernard wrote:</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>(Linda, can you forward to the jsr342 list, I don't think I have write</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>access).</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Thanks for this work.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>## Question</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>The spec claims:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>An interceptor bound to a component using interceptor binding, may be enabled</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>for the entire applica- tion by applying the Priority annotation, along with</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>a priority value, on the interceptor class.</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Does that mean that without @Priority, the interceptor is not enabled</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>for the entire application?</span><br></blockquote></blockquote><span></span><br><span>Unless you enable it in beans.xml.</span><br><span></span><br><blockquote type="cite"><blockquote type="cite"><span>And to clarify my doubts, you still enforce</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>that the binding annotation must be present for the interceptor to be</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>applied on a given method or class, correct?</span><br></blockquote></blockquote><span></span><br><span>I believe that's still a requirement.</span><br><span></span><br><blockquote type="cite"><blockquote type="cite"><span>## Proposal</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Have you guys considered adding a END_OF_PLATFORM_AFTER = 5000 so that</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>if for some reasons, people want to go after Java EE platform elements,</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>they can do so.</span><br></blockquote></blockquote><span></span><br><span>I suppose we could consider it.</span><br><span></span><br><blockquote type="cite"><blockquote type="cite"><span>BTW, I think the spec should clarify that negative priority are accepted</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>and that signed number ordering happen.</span><br></blockquote></blockquote><span></span><br><span>We already decided to reserve negative numbers for a future use.</span><br><span></span><br><blockquote type="cite"><blockquote type="cite"><span>## Bean Validation priority</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>If we go with that route (allocating 1000 to the platform_after</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>section), I'm tempted to place Bean Validation priority to</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>PLATFORM_AFTER+800.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Why? Well:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>1. it makes for a beautiful symmetry with JTA :)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>2. and it reflects our opinion that BV should happen relatively late</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>just like JTA should happen relatively early, but still offer an open</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>door to override these propositions.</span><br></blockquote></blockquote><span></span><br><span>Seems fine to me.</span><br><span></span><br><blockquote type="cite"><blockquote type="cite"><span>Emmanuel</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>On Thu 2013-01-31 11:22, Linda DeMichiel wrote:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>The revisions to the Interceptor spec to accommodate the improved</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>managed bean alignment are nearly complete. &nbsp;You can download the</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>current draft of the spec from the <a href="http://interceptor-spec.java.net">interceptor-spec.java.net</a> project</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>at <a href="http://java.net/projects/interceptors-spec/downloads">http://java.net/projects/interceptors-spec/downloads</a></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>One of the issues that we still need to resolve, however, is the</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>assignment of priorities to the new transactional interceptors being</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>defined by JTA and the Bean Validation interceptors that handle</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>method validation.</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Section 5.5 of the Interceptors spec defines the following Priority</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>values (see the spec for the details):</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Interceptor.Priority.PLATFORM_BEFORE = 0</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Interceptor.Priority.LIBRARY_BEFORE = 1000</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Interceptor.Priority.APPLICATION = 2000</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Interceptor.Priority.LIBRARY_AFTER = 3000</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Interceptor.Priority.PLATFORM_AFTER = 4000</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>In our earlier discussions, we concluded that transactional</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>interceptors needed to come relatively early in the interceptor chain.</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>To put a stake in the ground, we propose that we define these to have</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>a priority of Interceptor.Priority.PLATFORM_BEFORE+200.</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Validation interceptors, however, should come relatively late,</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>since they will ensure that the parameters that reach the method</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>(which might have been modified by other interceptors) are valid.</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Again, to put a stake in the ground, we'll propose a priority of</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Interceptor.Priority.PLATFORM_AFTER+1000.</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Comments please!</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>Emmanuel, Paul, could you please consult with your expert groups</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>for further input as well...</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>thanks,</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span>-Linda</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><span></span><br></div></blockquote></body></html>