Example usage for org.aspectj.lang ProceedingJoinPoint getKind

List of usage examples for org.aspectj.lang ProceedingJoinPoint getKind

Introduction

In this page you can find the example usage for org.aspectj.lang ProceedingJoinPoint getKind.

Prototype

String getKind();

Source Link

Document

This string is guaranteed to be interned.

Usage

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()));
        }
    }
}