Example usage for org.aspectj.lang JoinPoint getKind

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

Introduction

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

Prototype

String getKind();

Source Link

Document

This string is guaranteed to be interned.

Usage

From source file:hello.ServiceMonitor.java

License:Apache License

@After("execution(* hello..*Controller.*(..))")
public void logServiceAfter(JoinPoint joinPoint) {
    System.out.println("After: " + joinPoint.toLongString());
    System.out.println("After: " + joinPoint.toShortString());
    System.out.println("After: " + joinPoint.getArgs()[0].toString());
    System.out.println("After: " + joinPoint.getKind());
    System.out.println("After: " + joinPoint.getClass());
    System.out.println("After: " + joinPoint.getSignature());
    System.out.println("After: " + joinPoint.getSourceLocation());
    System.out.println("After: " + joinPoint.getStaticPart());
    System.out.println("After: " + joinPoint.getTarget());
}

From source file:org.apache.shiro.aspectj.AspectjAnnotationsAuthorizingMethodInterceptor.java

License:Apache License

/**
 * Performs the method interception of the before advice at the specified joint point.
 *
 * @param aJoinPoint The joint point to intercept.
 * @throws Throwable If an error occurs berforming the method invocation.
 *//*from ww  w .j ava 2 s  .  co m*/
protected void performBeforeInterception(JoinPoint aJoinPoint) throws Throwable {
    if (log.isTraceEnabled())
        log.trace("#### Invoking a method decorated with a Shiro annotation" + "\n\tkind       : "
                + aJoinPoint.getKind() + "\n\tjoinPoint  : " + aJoinPoint + "\n\tannotations: "
                + Arrays.toString(((MethodSignature) aJoinPoint.getSignature()).getMethod().getAnnotations())
                + "\n\ttarget     : " + aJoinPoint.getTarget());

    // 1. Adapt the join point into a method invocation
    BeforeAdviceMethodInvocationAdapter mi = BeforeAdviceMethodInvocationAdapter.createFrom(aJoinPoint);

    // 2. Delegate the authorization of the method call to the super class
    super.invoke(mi);
}