Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2541

Should @AroundInvoke apply to mdb methods called by container?

XMLWordPrintable

    • Hide

      Please refer to attachment as reproducer.

      Show
      Please refer to attachment as reproducer.

      In Weblogic 12.2.1.3 with Weld 2.4, AroundInvoke interceptor methods doesn't apply to mdb methods called by container, but in Weblogic 12.3.1.0, it intercepts them, the case is like:
      >>>>
      package com.xo.svlt27891072;
      ...
      @MessageDriven(mappedName = "jms/Queue", activationConfig = {
      @ActivationConfigProperty(propertyName = "destinationType",
      propertyValue = "javax.jms.Queue")
      })

      @Intcp
      public class Mdb27891072 implements MessageDrivenBean, MessageListener {
      private MessageDrivenContext mdc;
      public Mdb27891072() {}
      public void setMessageDrivenContext(MessageDrivenContext mdc)

      { System.out.println("*** setMessageDrivenContext() ***"); this.mdc = mdc; }

      ...
      }

      package com.xo.svlt27891072;
      ...
      @Interceptor
      @Intcp
      public class Intcp27891072 implements Serializable {
      @AroundInvoke
      public Object aroundInvoke(InvocationContext ic) throws Exception

      { System.out.println("*** invoke "+ ic.getMethod().getName() + " ***"); return ic.proceed(); }

      }
      <<<<

      Here setMessageDrivenContext() is called by container, in wls12213 (Weld2.4.2), it only prints:
      <<<<

          • setMessageDrivenContext() ***
            <<<<

      But in wls12310 (Weld 3.0.4), in prints:
      >>>>

          • invoke setMessageDrivenContext ***
          • setMessageDrivenContext() ***
            <<<<

      This means setMessageDrivenContext() is intercepted, and relevant stack trace looks like:
      >>>>
      aroundInvoke:15, Intcp27891072

      {com.xo.svlt27891072}
      invoke0:-1, NativeMethodAccessorImpl {sun.reflect}
      invoke:62, NativeMethodAccessorImpl {sun.reflect}
      invoke:43, DelegatingMethodAccessorImpl {sun.reflect}
      invoke:498, Method {java.lang.reflect}
      invoke:73, SimpleInterceptorInvocation$SimpleMethodInvocation {org.jboss.weld.interceptor.reader}
      executeAroundInvoke:84, InterceptorMethodHandler {org.jboss.weld.interceptor.proxy}
      executeInterception:72, InterceptorMethodHandler{org.jboss.weld.interceptor.proxy}
      invoke:56, InterceptorMethodHandler {org.jboss.weld.interceptor.proxy}
      invoke:79, CombinedInterceptorAndDecoratorStackMethodHandler {org.jboss.weld.bean.proxy}
      invoke:68, CombinedInterceptorAndDecoratorStackMethodHandler{org.jboss.weld.bean.proxy}
      setMessageDrivenContext:-1, Mdb27891072$Proxy$_$$_WeldSubclass{com.xo.svlt27891072}

      <<<<

      They are all in weld code and doesn't relate to Weblogic.
      So Is this behavior change a defect or, it references to specification?
      Thanks.

            Unassigned Unassigned
            sunxiaoou sun xiaoou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: