import javax.interceptor.AroundInvoke; import javax.interceptor.InvocationContext; public class MyInterceptor { @AroundInvoke public Object intercept(InvocationContext context) throws Exception { Object result = context.proceed(); return result; } } import javax.interceptor.Interceptors; public class MyService { @Interceptors(MyInterceptor.class) public void doSomething() { } } <interceptors> <class>com.example.MyInterceptor</class> </interceptors>


上一篇:
下一篇:
切换中文