<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">If an interceptor is enabled by both
@Priority and in beans.xml then:<br>
<br>
1) The priority defines the position of the interceptor in the
interceptor chain<br>
2) The position of the interceptor declaration in beans.xml
defines the position of the interceptor in the interceptor chain
(which is possibly different from (1))<br>
<br>
Unless I am wrong the spec does not define which of these should
take precedence nor forbids this case. As this case is unspecified
I would consider "calling the interceptor twice" a possible
implementation.<br>
<br>
Jozef<br>
<br>
On 10/18/2013 06:13 PM, Mark Struberg wrote:<br>
</div>
<blockquote
cite="mid:1382112783.58621.YahooMailNeo@web28906.mail.ir2.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
Lucida Grande, Sans-Serif;font-size:8pt">I'd say that's an impl
bug. <br>
<br>
beans.xml and @Priority only say IF and in which order the
interceptor is enabled. But it still is there only once.<br>
<br>
LieGrue,<br>
strub<br>
<div><span><br>
</span></div>
<div><br>
</div>
<blockquote style="border-left: 2px solid rgb(16, 16, 255);
margin-left: 5px; margin-top: 5px; padding-left: 5px;">
<div style="font-family: HelveticaNeue, Helvetica Neue,
Helvetica, Arial, Lucida Grande, Sans-Serif; font-size:
8pt;">
<div style="font-family: HelveticaNeue, Helvetica Neue,
Helvetica, Arial, Lucida Grande, Sans-Serif; font-size:
12pt;">
<div dir="ltr">
<hr size="1"> <font face="Arial" size="2"> <b><span
style="font-weight:bold;">From:</span></b> John D.
Ament <a class="moz-txt-link-rfc2396E" href="mailto:john.d.ament@gmail.com"><john.d.ament@gmail.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:users@javaee-spec.java.net">users@javaee-spec.java.net</a> <br>
<b><span style="font-weight: bold;">Cc:</span></b>
Tang Yong <a class="moz-txt-link-rfc2396E" href="mailto:tangyong@cn.fujitsu.com"><tangyong@cn.fujitsu.com></a>; Pete Muir
<a class="moz-txt-link-rfc2396E" href="mailto:pete.muir@gmail.com"><pete.muir@gmail.com></a>; Bill Shannon
<a class="moz-txt-link-rfc2396E" href="mailto:bill.shannon@oracle.com"><bill.shannon@oracle.com></a> <br>
<b><span style="font-weight: bold;">Sent:</span></b>
Thursday, 17 October 2013, 15:24<br>
<b><span style="font-weight: bold;">Subject:</span></b>
[javaee-spec users] Re: About Interceptors's enabling<br>
</font> </div>
<div class="y_msg_container"><br>
I wonder if this is somehow related to an issue I saw
pop up on SO recently.<br clear="none">
<br clear="none">
Basically, there's an issue where if an interceptor is
annotated<br clear="none">
@Priority and listed in beans.xml, it gets invoked
twice.<br clear="none">
<br clear="none">
Is this the expected behavior?<br clear="none">
<br clear="none">
John<br clear="none">
<div class="yqt9137344506" id="yqtfd50118"><br
clear="none">
On Thu, Oct 17, 2013 at 9:12 AM, Pete Muir <<a
moz-do-not-send="true" shape="rect"
ymailto="mailto:pmuir@bleepbleep.org.uk"
href="mailto:pmuir@bleepbleep.org.uk">pmuir@bleepbleep.org.uk</a>>
wrote:<br clear="none">
> Hi Tang,<br clear="none">
><br clear="none">
> I'm afraid I don't quite understand your question
:-(<br clear="none">
><br clear="none">
> Perhaps you could provide a concrete example of
what you would prefer?<br clear="none">
><br clear="none">
> Pete<br clear="none">
><br clear="none">
> On 17 Oct 2013, at 09:03, Tang Yong <<a
moz-do-not-send="true" shape="rect"
ymailto="mailto:tangyong@cn.fujitsu.com"
href="mailto:tangyong@cn.fujitsu.com">tangyong@cn.fujitsu.com</a>>
wrote:<br clear="none">
><br clear="none">
>> Pete<br clear="none">
>> CC: Bill<br clear="none">
>><br clear="none">
>> I have a question about Interceptors's
enabling.<br clear="none">
>><br clear="none">
>> The story should come from [1] and [2], and
from "5.3 Ordering<br clear="none">
>> Interceptors using the Priority Annotation"
of JSR 318.<br clear="none">
>><br clear="none">
>> "An interceptor bound to a component, a
component method, or constructor<br clear="none">
>> using interceptor binding may be enabled for
the entire application by<br clear="none">
>> applying the Priority annotation, along with
a priority value, on the<br clear="none">
>> interceptor class."<br clear="none">
>><br clear="none">
>> From another fact, Interceptors are
deployment-specific and are disabled<br clear="none">
>> by default. Like alternatives, interceptors
have to be<br clear="none">
>> enabled by using the CDI deployment
descriptor beans.xml of the jar.<br clear="none">
>><br clear="none">
>> Well, if I uses interceptors binding, I will
meet two cases,<br clear="none">
>><br clear="none">
>> 1) I must enable interceptors in beans.xml
explicitly if I am not ready<br clear="none">
>> to use @Priority.<br clear="none">
>><br clear="none">
>> 2) Once I uses @Priority, I need to take care
of whether to need to<br clear="none">
>> declare interceptors in beans.xml becase this
may break/override<br clear="none">
>> invocation order of interceptors.<br
clear="none">
>><br clear="none">
>> Based on such facts, enable interceptors in
beans.xml explicitly has<br clear="none">
>> brought two different resposibilities for
interceptors binding, so, for<br clear="none">
>> an user, this has caused some puzzles just as
I made a mistake in [2].<br clear="none">
>><br clear="none">
>> My question is that why we can not make
"enable interceptors in<br clear="none">
>> beans.xml explicitly" bring *only one*
resposibility?<br clear="none">
>><br clear="none">
>> Thanks<br clear="none">
>> Tang<br clear="none">
>><br clear="none">
>> [1]:<br clear="none">
>> <a moz-do-not-send="true" shape="rect"
href="https://java.net/projects/javaee-spec/lists/jsr342-experts/archive/2012-12/message/15"
target="_blank">https://java.net/projects/javaee-spec/lists/jsr342-experts/archive/2012-12/message/15</a><br
clear="none">
>> [2]: <a moz-do-not-send="true" shape="rect"
href="https://issues.jboss.org/browse/WELD-1528"
target="_blank">https://issues.jboss.org/browse/WELD-1528</a><br
clear="none">
>><br clear="none">
>><br clear="none">
>> --<br clear="none">
>> ----------------------<br clear="none">
>> Tang Yong<br clear="none">
>> Senior Engineer<br clear="none">
>> GlassFish Committer (OSGi & OSGi-JavaEE)<br
clear="none">
>> OSGi Alliance Supporter<br clear="none">
>> Blog: <a moz-do-not-send="true" shape="rect"
href="http://osgizone.typepad.com/tangyong/"
target="_blank">http://osgizone.typepad.com/tangyong/</a><br
clear="none">
>><br clear="none">
>> Nanjing Fujitsu NanDa Software Tec CO.,LTD<br
clear="none">
>> <a moz-do-not-send="true" shape="rect"
href="http://www.fujitsu.com/cn/fnst"
target="_blank">http://www.fujitsu.com/cn/fnst</a><br
clear="none">
>> Tel: +86-25-86630566-8310<br clear="none">
>> Fax: +86-25-83317685<br clear="none">
>> ----------------------<br clear="none">
>><br clear="none">
></div>
<br>
<br>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>