【发布时间】:2013-11-26 10:48:57
【问题描述】:
我正在阅读一些关于 java ee 中Interceptors 的教程,但是有些主题没有得到广泛的介绍。因此,如果有人回答了以下问题,我将不胜感激:
1) 如果目标类包含@AroundInvoke 方法,拦截器的执行顺序如下:
@Interceptors({PrimaryInterceptor.class, SecondaryInterceptor.class})
@Stateful
public class OrderBean {
...
@AroundInvoke
private void last(InvocationContext ctx) { ... }
...
}
我的印象是先执行了taget类Interceptor,也就是上面例子中的last方法,然后按照注解里面指定的顺序执行了两个类级别的Interceptor。我对吗?
2) 什么是Timeout Interceptors(包含带有注解@AroundTimeout的方法),什么时候执行?
【问题讨论】:
标签: jakarta-ee ejb interceptor