List of usage examples for javax.interceptor InvocationContext getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:EmployeeBean.java
@AroundInvoke public Object TimerLog(InvocationContext ctx) throws Exception { String beanClassName = ctx.getClass().getName(); String businessMethodName = ctx.getMethod().getName(); String target = beanClassName + "." + businessMethodName; long startTime = System.currentTimeMillis(); System.out.println("Invoking " + target); try {/*from w ww .j a v a2 s. co m*/ return ctx.proceed(); } finally { System.out.println("Exiting " + target); long totalTime = System.currentTimeMillis() - startTime; System.out.println("Business method " + businessMethodName + "in " + beanClassName + "takes " + totalTime + "ms to execute"); } }