XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 2.12.1.Final
    • 2.12.0.Final
    • Java EE
    • None

      It would be good to have a command to generate a CDI interceptor. A simple command such as :

      cdi-new-interceptor --named LoggingInterceptor ;
      

      Would generate :

      @Interceptor
      public class LoggingInterceptor {
      
          @AroundInvoke
          public Object logMethod(InvocationContext ic) throws Exception {
              try {
                  return ic.proceed();
              } finally {
              }
          }
      }
      

      There could even have another parameter to add an existing interceptor binding

      cdi-new-interceptor --named LoggingInterceptor --binding Loggable ;
      

      Would add the Loggable interceptor binding to the class :

      @Interceptor
      @Loggable
      public class LoggingInterceptor {
      
          @AroundInvoke
          public Object logMethod(InvocationContext ic) throws Exception {
              try {
                  return ic.proceed();
              } finally {
              }
          }
      }
      

              agoncal Antonio Goncalves (Inactive)
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: