标签: java ejb interceptor
我有许多需要额外配置的EJB3.0拦截器。到目前为止,我一直只是通过@Interceptors( { MyInterceptor.class } )添加拦截器,然后添加第二个自定义注释,如@MyInterceptorConfiguration(value=something)。
@Interceptors( { MyInterceptor.class } )
@MyInterceptorConfiguration(value=something)
但这很乏味。是否可以注释自定义注释,以便触发添加拦截器?理想情况下,我只想将@DoMyInterception(config=foo)添加到类中,然后添加我的拦截器。
@DoMyInterception(config=foo)
答案 0 :(得分:2)
这仅适用于EE 6(EJB 3.1)中的CDI stereotype注释(请参阅示例的interceptor bindings页面)。