On Sun, Sep 2, 2018 at 9:56 PM Labhesh Ramchandani <
labhesh.ramchand...@aqr.com> wrote:

> Hi,
>

Hello!


>   @Decorate
>   @TimeIt
>   public static <T> T decorateTimer(Class<T> serviceInterface, T delegate,
>       String serviceId, Logger logger,
>       TimerDecorator decorator) {
>     return decorator.build(serviceInterface, delegate, serviceId, logger);
>   }
>
> Is there a way to annotate just the specific method? I don't want to time
> all methods...just the ones that have the marker on them?
> In the example above; I'd like to decorate (and time) just method A and
> not B; how can I do that? Also how do I get the methodReciever to log the
> name of the specific methodA being timed?
>

Yes. Instead of using methodAdviceReceiver.adviseAllMethods(advice), you
can specify which methods you want to advise by using adviseMethod(Method
method, MethodAdvice advice) instead. Of course, the logic to define which
methods to advise is up to you.

--
Thiago

Reply via email to