Skip to content

Commit

Permalink
WELD-1919 Do not inject resources on Jetty-managed instances
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Apr 14, 2015
1 parent bf534c4 commit 0964edd
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -20,6 +20,7 @@
import static org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue;

import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.InjectionTarget;

import org.jboss.weld.manager.api.WeldManager;
Expand All @@ -46,7 +47,11 @@ protected AbstractInjector(final WeldManager manager) {
this.cache = CacheBuilder.newBuilder().weakValues().build(new CacheLoader<Class<?>, InjectionTarget<?>>() {
@Override
public InjectionTarget<?> load(Class<?> key) throws Exception {
return manager.createInjectionTarget(manager.createAnnotatedType(key));
AnnotatedType<?> type = manager.createAnnotatedType(key);
return manager.createInjectionTargetBuilder(type)
.setResourceInjectionEnabled(false)
.setTargetClassLifecycleCallbacksEnabled(false)
.build();
}
});
}
Expand Down

0 comments on commit 0964edd

Please sign in to comment.