XMLWordPrintable

Details

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

    Description

      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 {
              }
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: