package com.profile; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import com.profile.Profiler.ProfilerID; @Aspect public class ProfilerAspect { @Around("@annotation(com.profile.Profile)") public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable { Signature sig = pjp.getSignature(); ProfilerID id = Profiler.start(sig.getDeclaringTypeName(), sig.getName()); Object retVal = pjp.proceed(); Profiler.end(id); return retVal; } }