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

            Public project attachment banner

              context keys: [headless, issue, helper, isAsynchronousRequest, project, action, user]
              current Project key: FORGE

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: