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

Do not fail on duplicate interceptors

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.0.0.CR4
    • 2.0.0.CR2
    • None
    • None

    Description

      According to the Interceptors spec lead this test is legal. Make sure Weld does not fail on duplicate interceptors and performs multiple invocations on the same interceptor instance.

      @Stateless
      @Remote({AroundInvokeIF.class})
      //This bean must use cmt, since it uses setRollbackOnly
      @ExcludeDefaultInterceptors
      @Interceptors({*Interceptor1.class*, Interceptor1.class})
      public class AroundInvokeBean extends AroundInvokeBase implements 
      AroundInvokeIF {
          @Resource(name="ejbContext")
          private SessionContext ejbContext;
      
          public AroundInvokeBean() {
              super();
          }
      
          //============ abstract methods from super ==========================
          protected javax.ejb.EJBContext getEJBContext() {
              return this.ejbContext;
          }
      
          //============= override business methods from super ================
          @Override
          @ExcludeClassInterceptors
          @Interceptors({InterceptorNoat1.class, 
      MethodLevelOnlyNoopInterceptor.class})
          public ArrayList<String> 
      methodLevelInterceptorMixedTest(ArrayList<String> alist)
          throws CalculatorException {
              return super.methodLevelInterceptorMixedTest(alist);
          }
      
          @Override
          @Interceptors({*Interceptor1*.class, 
      MethodLevelOnlyNoopInterceptor.class})
          public ArrayList<String> 
      methodLevelClassLevelInterceptorMixedTest(ArrayList<String> alist)
          throws CalculatorException {
              return super.methodLevelClassLevelInterceptorMixedTest(alist);
          }
      
          @Override
          @ExcludeDefaultInterceptors
          @Interceptors({InterceptorNoat1.class, InterceptorNoat1.class, 
      MethodLevelOnlyNoopInterceptor.class})
          public ArrayList<String> repeatedInterceptors(ArrayList<String> 
      alist)
          throws CalculatorException {
              return super.repeatedInterceptors(alist);
          }
      
          @Override
          @ExcludeDefaultInterceptors
          @Interceptors({*Interceptor1.class*, InterceptorNoat1.class})
          public ArrayList<String> 
      interceptorOrderingOverride(ArrayList<String> alist)
          throws CalculatorException {
              return super.interceptorOrderingOverride(alist);
          }
      }
      

      Attachments

        Activity

          People

            rhn-engineering-jharting Jozef Hartinger
            rhn-engineering-jharting Jozef Hartinger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: