1 Reply Latest reply on Jul 20, 2011 11:41 AM by viniciuscarvalho.viniciusccarvalho.gmail.com

    How to Scan for annotations

    viniciuscarvalho.viniciusccarvalho.gmail.com

      Hi there! I'm implementing a CDI extension, and one thing I need to do is scan for a given annotation, and then get the method its used and register it within one of my services. let's say:



      @Consumes
      public void method(Type x){}




      I know I could easily do that by using interceptors, and aroundinvoke, but It will require enabling it on beans.xml for every module (something I'm trying to avoid).


      On Spring we did this by using a beanpostprocessor and postProcessBeforeInitialization(Object bean, String beanName) we scan the bean for methods with the annotation. How could I achieve the same with Weld and CDI? I had a brief look at Solder but could not find how to do it with it either.


      Cheers