I have an annotation named Metric
@Target({ElementType.FIELD, ElementType.METHOD})
public @interface Metric {
String name() default "";
}
I want to weave some logic when some methods with the @Metric
annotation, like:
public class MethodWithMetricDemo{
@Metric
public void targetMethod(){
// do some thing
}
}
But how to match the class MethodWithMetricDemo
in new AgentBuilder.Default().type(xxxxxxxxxxxxxxxx)
?