Example usage for javax.interceptor InvocationContext getMethod

List of usage examples for javax.interceptor InvocationContext getMethod

Introduction

In this page you can find the example usage for javax.interceptor InvocationContext getMethod.

Prototype

public Method getMethod();

Source Link

Document

Returns the method of the target class for which the interceptor was invoked.

Usage

From source file:pl.setblack.airomem.direct.impl.ClassContext.java

public Object performTransaction(InvocationContext ctx) {
    final Method method = ctx.getMethod();
    final OperationType opType = findRegistry().sayTypeOfMethod(method);
    if (opType == OperationType.WRITE) {
        return this.performTransaction(ctx.getTarget(), method, ctx.getParameters());
    } else {//  w  w w  .  ja va2 s.  co  m
        try {

            final SimpleController controller = PrevaylerRegister.getInstance()
                    .getController(elem.getTargetType(), elem.getName());

            inject(ctx.getTarget(), controller.query(immutable -> immutable));
            return Politician.beatAroundTheBush(() -> ctx.proceed());
        } finally {
            clean(ctx.getTarget());

        }
    }

}

From source file:util.EJBLoggerAOPExample.java

@AroundInvoke
public Object logMethodEntry(InvocationContext invocationContext) throws Exception {
    //System.out.println("Entering method:" + invocationContext.getMethod().getName());
    log.info("Entering method:" + invocationContext.getMethod().getName());
    log.info(invocationContext.getParameters());
    return invocationContext.proceed();
}