hellointerceptor.java
来自「这个是学习EJB的好例子,里面有许多关于EJB Bean的」· Java 代码 · 共 22 行
JAVA
22 行
package com.cws.ejb.hello;
import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
public class HelloInterceptor {
@AroundInvoke
public Object log(InvocationContext ctx) throws Exception {
System.out.println("*** HelloInterceptor intercepting");
long start = System.currentTimeMillis();
ctx.proceed();
long time = System.currentTimeMillis() - start;
System.out.println("用时:" + time + "ms");
return null;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?