1 Reply Latest reply on Aug 20, 2005 11:10 PM by dxbcto

    How do I resolve annotations?

    dxbcto Newbie

      I am re-doing one of the examles in AOP 1.3.1 to use annotations as opposed to meta data. Here is how my annotation is defined:

      public @interface billable
      {
       int amount() default 0;
      }


      I have a BillingInterceptor as in the example. When I do this in the interceptor's invoke method, b is always returns null:

      billable b = (billable)invocation.getAdvisor().resolveAnnotation(billable.class);
      


      Also....the annotations map is always empty. I appreciate any help. Thanks.


        • 1. Re: How do I resolve annotations?
          dxbcto Newbie

          Ok....I forgot to annotate my billable interface with a proper retention policy. The new billable interface (that now works) looks like this:

          @Retention(RetentionPolicy.RUNTIME)
          @Target(ElementType.METHOD)
          public @interface billable
          {
           int amount() default 0;
          }


          Thanks.