Skip to content

Commit

Permalink
WELD-1963 Resource injection not performed on EJB-style interceptors
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Jun 5, 2015
1 parent 1b00a33 commit a9790bc
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -38,7 +38,16 @@ public class PlainInterceptorFactory<T> implements InterceptorFactory<T> {

public static <T> PlainInterceptorFactory<T> of(Class<T> javaClass, BeanManagerImpl manager) {
AnnotatedType<T> type = manager.createAnnotatedType(javaClass);
InjectionTarget<T> it = manager.getInjectionTargetFactory(type).createInterceptorInjectionTarget();
/*
* For historical reasons WeldInjectionTargetFactory.createInterceptorInjectionTarget() does not add
* resource injection support. Therefore, we intentionally use builder instead.
*/
InjectionTarget<T> it = manager.createInjectionTargetBuilder(type)
.setDecorationEnabled(false)
.setInterceptionEnabled(false)
.setResourceInjectionEnabled(true)
.setTargetClassLifecycleCallbacksEnabled(false)
.build();
return new PlainInterceptorFactory<T>(it);
}

Expand Down

0 comments on commit a9790bc

Please sign in to comment.