List of usage examples for org.aspectj.lang ProceedingJoinPoint getKind
String getKind();
From source file:org.opennms.core.profiler.ProfilerAspect.java
License:Open Source License
@Around("@within(profile) || @annotation(profile)") public Object logAroundByMethod(ProceedingJoinPoint joinPoint, Profile profile) throws Throwable { Timer timer = new Timer(); try {//ww w . j av a2 s . c om timer.start(); return joinPoint.proceed(); } finally { log(joinPoint.getKind(), joinPoint.getSignature().toShortString(), timer.stop()); } }
From source file:org.slc.sli.dashboard.util.ExecutionTimeLogger.java
License:Apache License
@Around(value = "@annotation(annotation)") public Object log(final ProceedingJoinPoint proceedingJoinPoint, final LogExecutionTime annotation) throws Throwable { final long startTime = System.nanoTime(); try {//from ww w . j a v a 2 s .c o m return proceedingJoinPoint.proceed(); } finally { if (ProceedingJoinPoint.METHOD_CALL.equals(proceedingJoinPoint.getKind())) { LOGGER.info(">>>>>" + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime) + " ms " + proceedingJoinPoint.toShortString() + "," + Arrays.asList(proceedingJoinPoint.getArgs())); } } }