Adding EJB interceptors with custom annotations

I have a number of EJB3.0 interceptors that require additional configuration. So far I have been simply adding the interceptors via @Interceptors( { MyInterceptor.class } ) and then added a second, custom annotation like @MyInterceptorConfiguration(value=something) .

This is rather tedious though. Is it possible to annotate a custom annotation so that it will trigger the addition of an Interceptor? Ideally I would like to just add @DoMyInterception(config=foo) to a class and have that add my interceptor.


这仅适用于EE 6(EJB 3.1)中的CDI构造型注释(请参阅拦截器绑定页面中的示例)。

链接地址: http://www.djcxy.com/p/68256.html

上一篇: Java注释可以帮助我吗?

下一篇: 使用自定义注释添加EJB拦截器