Annotation Type Metered


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Metered
    An annotation for marking a method of an annotated object as metered.

    Given a method like this:

    
         @Metered(name = "fancyName")
         public String fancyName(String name) {
             return "Sir Captain " + name;
         }
     

    A meter for the defining class with the name fancyName will be created and each time the #fancyName(String) method is invoked, the meter will be marked.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean absolute
      If true, use the given name as an absolute name.
      java.lang.String name
      The name of the meter.
    • Element Detail

      • name

        java.lang.String name
        The name of the meter.
        Default:
        ""
      • absolute

        boolean absolute
        If true, use the given name as an absolute name. If false, use the given name relative to the annotated class.
        Default:
        false