Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-110

Provide support for binding an invocation handler to an interface or abstract class

XMLWordPrintable

      The purpose of this feature is to allow interfaces and abstract classes to be automatically implemented by an invocation handler to which all abstract method invocations are delegated. The invocation handler would get "bound" to the type using the same strategy as is used for interceptor binding.

      Binding type:

      @Target({ METHOD, TYPE })
      @Retention(RetentionPolicy.RUNTIME)
      @ServiceHandlerBindingType
      public @interface EchoService {}
      

      Invocation handler:

      @ServiceHandler
      @EchoService
      public class EchoServiceHandler {
          @AroundInvoke
          public Object invoke(InvocationContext ctx) {
              return ctx.getMethod().getName().toString();
          }
      }
      

      Usage:

      @EchoService
      public interface HelloWorld {
         String helloWorld();
      }
      

            Unassigned Unassigned
            rhn-support-ggastald George Gastaldi
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: