List of usage examples for javax.interceptor InvocationContext getMethod
public Method getMethod();
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(); }