<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">&lt;john.d.ament@gmail.com&gt;</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">&lt;tangyong@cn.fujitsu.com&gt;</a>; Pete Muir
                  <a class="moz-txt-link-rfc2396E" href="mailto:pete.muir@gmail.com">&lt;pete.muir@gmail.com&gt;</a>; Bill Shannon
                  <a class="moz-txt-link-rfc2396E" href="mailto:bill.shannon@oracle.com">&lt;bill.shannon@oracle.com&gt;</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 &lt;<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>&gt;
                  wrote:<br clear="none">
                  &gt; Hi Tang,<br clear="none">
                  &gt;<br clear="none">
                  &gt; I'm afraid I don't quite understand your question
                  :-(<br clear="none">
                  &gt;<br clear="none">
                  &gt; Perhaps you could provide a concrete example of
                  what you would prefer?<br clear="none">
                  &gt;<br clear="none">
                  &gt; Pete<br clear="none">
                  &gt;<br clear="none">
                  &gt; On 17 Oct 2013, at 09:03, Tang Yong &lt;<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>&gt;
                  wrote:<br clear="none">
                  &gt;<br clear="none">
                  &gt;&gt; Pete<br clear="none">
                  &gt;&gt; CC: Bill<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; I have a question about Interceptors's
                  enabling.<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; The story should come from [1] and [2], and
                  from "5.3 Ordering<br clear="none">
                  &gt;&gt; Interceptors using the Priority Annotation"
                  of JSR 318.<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; "An interceptor bound to a component, a
                  component method, or constructor<br clear="none">
                  &gt;&gt; using interceptor binding may be enabled for
                  the entire application by<br clear="none">
                  &gt;&gt; applying the Priority annotation, along with
                  a priority value, on the<br clear="none">
                  &gt;&gt; interceptor class."<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; From another fact, Interceptors are
                  deployment-specific and are disabled<br clear="none">
                  &gt;&gt; by default. Like alternatives, interceptors
                  have to be<br clear="none">
                  &gt;&gt; enabled by using the CDI deployment
                  descriptor beans.xml of the jar.<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; Well, if I uses interceptors binding, I will
                  meet two cases,<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; 1) I must enable interceptors in beans.xml
                  explicitly if I am not ready<br clear="none">
                  &gt;&gt; to use @Priority.<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; 2) Once I uses @Priority, I need to take care
                  of whether to need to<br clear="none">
                  &gt;&gt; declare interceptors in beans.xml becase this
                  may break/override<br clear="none">
                  &gt;&gt; invocation order of interceptors.<br
                    clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; Based on such facts, enable interceptors in
                  beans.xml explicitly has<br clear="none">
                  &gt;&gt; brought two different resposibilities for
                  interceptors binding, so, for<br clear="none">
                  &gt;&gt; an user, this has caused some puzzles just as
                  I made a mistake in [2].<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; My question is that why we can not make
                  "enable interceptors in<br clear="none">
                  &gt;&gt; beans.xml explicitly" bring *only one*
                  resposibility?<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; Thanks<br clear="none">
                  &gt;&gt; Tang<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; [1]:<br clear="none">
                  &gt;&gt; <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">
                  &gt;&gt; [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">
                  &gt;&gt;<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; --<br clear="none">
                  &gt;&gt; ----------------------<br clear="none">
                  &gt;&gt; Tang Yong<br clear="none">
                  &gt;&gt; Senior Engineer<br clear="none">
                  &gt;&gt; GlassFish Committer (OSGi &amp; OSGi-JavaEE)<br
                    clear="none">
                  &gt;&gt; OSGi Alliance Supporter<br clear="none">
                  &gt;&gt; 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">
                  &gt;&gt;<br clear="none">
                  &gt;&gt; Nanjing Fujitsu NanDa Software Tec CO.,LTD<br
                    clear="none">
                  &gt;&gt; <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">
                  &gt;&gt; Tel: +86-25-86630566-8310<br clear="none">
                  &gt;&gt; Fax: +86-25-83317685<br clear="none">
                  &gt;&gt; ----------------------<br clear="none">
                  &gt;&gt;<br clear="none">
                  &gt;</div>
                <br>
                <br>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>