public AbstractDecoratorApplyingInstantiator(String contextId, Instantiator<T> delegate, Bean<T> bean, List<Decorator<?>> decorators, Class<? extends T> implementationClass) { super(delegate); this.bean = bean; this.decorators = decorators; ProxyFactory<T> factory = new ProxyFactory<T>(contextId, implementationClass, bean.getTypes(), bean, true); // eagerly generate the proxy class this.proxyClass = factory.getProxyClass(); }
public AbstractDecoratorApplyingInstantiator(String contextId, Instantiator<T> delegate, Bean<T> bean, List<Decorator<?>> decorators, Class<? extends T> implementationClass) { super(delegate); this.bean = bean; this.decorators = decorators; ProxyFactory<T> factory = new ProxyFactory<T>(contextId, implementationClass, bean.getTypes(), bean, true); // eagerly generate the proxy class this.proxyClass = factory.getProxyClass(); }
public AbstractDecoratorApplyingInstantiator(String contextId, Instantiator<T> delegate, Bean<T> bean, List<Decorator<?>> decorators, Class<? extends T> implementationClass) { super(delegate); this.bean = bean; this.decorators = decorators; ProxyFactory<T> factory = new ProxyFactory<T>(contextId, implementationClass, bean.getTypes(), bean, true); // eagerly generate the proxy class this.proxyClass = factory.getProxyClass(); }
public AbstractDecoratorApplyingInstantiator(String contextId, Instantiator<T> delegate, Bean<T> bean, List<Decorator<?>> decorators, Class<? extends T> implementationClass) { super(delegate); this.bean = bean; this.decorators = decorators; ProxyFactory<T> factory = new ProxyFactory<T>(contextId, implementationClass, bean.getTypes(), bean, true); // eagerly generate the proxy class this.proxyClass = factory.getProxyClass(); }
public AbstractDecoratorApplyingInstantiator(String contextId, Instantiator<T> delegate, Bean<T> bean, List<Decorator<?>> decorators, Class<? extends T> implementationClass) { super(delegate); this.bean = bean; this.decorators = decorators; ProxyFactory<T> factory = new ProxyFactory<T>(contextId, implementationClass, bean.getTypes(), bean, true); // eagerly generate the proxy class this.proxyClass = factory.getProxyClass(); }
public AbstractDecoratorApplyingInstantiator(String contextId, Instantiator<T> delegate, Bean<T> bean, List<Decorator<?>> decorators, Class<? extends T> implementationClass) { super(delegate); this.bean = bean; this.decorators = decorators; ProxyFactory<T> factory = new ProxyFactory<T>(contextId, implementationClass, bean.getTypes(), bean, true); // eagerly generate the proxy class this.proxyClass = factory.getProxyClass(); }
@Override public void initializeAfterBeanDiscovery() { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); }
@Override public void initializeAfterBeanDiscovery() { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); }
@Override public void initializeAfterBeanDiscovery() { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); }
@Override public void initializeAfterBeanDiscovery() { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); }
@Override public void initializeAfterBeanDiscovery() { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); }
@Override public void initializeAfterBeanDiscovery() { this.decorators = beanManager.resolveDecorators(getTypes(), getQualifiers()); if (!decorators.isEmpty()) { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); } } }
@Override public void initializeAfterBeanDiscovery() { this.decorators = beanManager.resolveDecorators(getTypes(), getQualifiers()); if (!decorators.isEmpty()) { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); } } }
@Override public void initializeAfterBeanDiscovery() { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); }
@Override public void initializeAfterBeanDiscovery() { this.decorators = beanManager.resolveDecorators(getTypes(), getQualifiers()); if (!decorators.isEmpty()) { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); } } }
@Override public void initializeAfterBeanDiscovery() { this.decorators = beanManager.resolveDecorators(getTypes(), getQualifiers()); if (!decorators.isEmpty()) { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); } } }
@Override public void initializeAfterBeanDiscovery() { this.decorators = beanManager.resolveDecorators(getTypes(), getQualifiers()); if (!decorators.isEmpty()) { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); } } }
@Override public void initializeAfterBeanDiscovery() { this.decorators = beanManager.resolveDecorators(getTypes(), getQualifiers()); if (!decorators.isEmpty()) { this.proxyClass = new ProxyFactory<T>(getBeanManager().getContextId(), getType(), getTypes(), this).getProxyClass(); } } }
@Override public T run() { try { Class<T> proxyClass = getProxyClass(); boolean hasConstrutedField = SecurityActions.hasDeclaredField(proxyClass, CONSTRUCTED_FLAG_NAME); if (hasConstrutedField != useConstructedFlag()) { // The proxy class was created with a different type of ProxyInstantiator ProxyInstantiator newInstantiator = ProxyInstantiator.Factory.create(!hasConstrutedField); BeanLogger.LOG.creatingProxyInstanceUsingDifferentInstantiator(proxyClass, newInstantiator, proxyInstantiator); return newInstantiator.newInstance(proxyClass); } return proxyInstantiator.newInstance(proxyClass); } catch (InstantiationException e) { throw new DefinitionException(BeanLogger.LOG.proxyInstantiationFailed(this), e.getCause()); } catch (IllegalAccessException e) { throw new DefinitionException(BeanLogger.LOG.proxyInstantiationBeanAccessFailed(this), e.getCause()); } }
@Override public T run() { try { Class<T> proxyClass = getProxyClass(); boolean hasConstrutedField = SecurityActions.hasDeclaredField(proxyClass, CONSTRUCTED_FLAG_NAME); if (hasConstrutedField != useConstructedFlag()) { // The proxy class was created with a different type of ProxyInstantiator ProxyInstantiator newInstantiator = ProxyInstantiator.Factory.create(!hasConstrutedField); BeanLogger.LOG.creatingProxyInstanceUsingDifferentInstantiator(proxyClass, newInstantiator, proxyInstantiator); return newInstantiator.newInstance(proxyClass); } return proxyInstantiator.newInstance(proxyClass); } catch (InstantiationException e) { throw new DefinitionException(BeanLogger.LOG.proxyInstantiationFailed(this), e.getCause()); } catch (IllegalAccessException e) { throw new DefinitionException(BeanLogger.LOG.proxyInstantiationBeanAccessFailed(this), e.getCause()); } }