Object instance = ejbContext.getTarget();
if (bean.getDecoratorStack().size() > 0) {
final CreationalContext<?> context = getCreationalContext();
final ProxyFactory proxyFactory = webBeansContext.getProxyFactory();
Class<?> proxyClass = proxyFactory.getInterceptorProxyClasses().get((InjectionTargetBean<?>) bean);
if (proxyClass == null) {
proxyClass = proxyFactory.createProxyClass(bean);
proxyFactory.getInterceptorProxyClasses().put((InjectionTargetBean<?>) bean, proxyClass);
}
final DelegateHandler delegateHandler = new DelegateHandler(bean, ejbContext);
final Object delegate = proxyFactory.createDecoratorDelegate(bean, delegateHandler);
// Gets component decorator stack
List<Object> decorators = WebBeansDecoratorConfig.getDecoratorStack(bean, instance, delegate, (CreationalContextImpl<?>) context);
//Sets decorator stack of delegate
delegateHandler.setDecorators(decorators);