use of org.jboss.weld.bean.proxy.DecorationHelper in project core by weld.
the class Decorators method getOuterDelegate.
public static <T> T getOuterDelegate(Bean<T> bean, T instance, CreationalContext<T> creationalContext, Class<T> proxyClass, InjectionPoint originalInjectionPoint, BeanManagerImpl manager, List<Decorator<?>> decorators) {
TargetBeanInstance beanInstance = new TargetBeanInstance(bean, instance);
DecorationHelper<T> decorationHelper = new DecorationHelper<T>(beanInstance, bean, proxyClass, manager, manager.getServices().get(ContextualStore.class), decorators);
DecorationHelper.push(decorationHelper);
try {
final T outerDelegate = decorationHelper.getNextDelegate(originalInjectionPoint, creationalContext);
if (outerDelegate == null) {
throw new WeldException(BeanLogger.LOG.proxyInstantiationFailed(bean));
}
return outerDelegate;
} finally {
DecorationHelper.pop();
}
}
use of org.jboss.weld.bean.proxy.DecorationHelper in project core by weld.
the class AbstractDecoratorApplyingInstantiator method getOuterDelegate.
protected T getOuterDelegate(T instance, CreationalContext<T> creationalContext, InjectionPoint originalInjectionPoint, BeanManagerImpl manager) {
TargetBeanInstance beanInstance = new TargetBeanInstance(bean, instance);
DecorationHelper<T> decorationHelper = new DecorationHelper<T>(beanInstance, bean, proxyClass, manager, manager.getServices().get(ContextualStore.class), decorators);
DecorationHelper.push(decorationHelper);
try {
final T outerDelegate = decorationHelper.getNextDelegate(originalInjectionPoint, creationalContext);
if (outerDelegate == null) {
throw new WeldException(BeanLogger.LOG.proxyInstantiationFailed(this));
}
return outerDelegate;
} finally {
DecorationHelper.pop();
}
}
Aggregations