@Override public T create(CreationalContext<T> creationalContext) { final T beanInstance = getProducer().produce(creationalContext); if (Reflections.isFinal(rawType) || Serializable.class.isAssignableFrom(beanInstance.getClass())) { return checkReturnValue(beanInstance); } else { BeanInstance proxyBeanInstance = new EnterpriseTargetBeanInstance(getTypes(), new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(), this, creationalContext, beanInstance))); return checkReturnValue(proxyFactory.create(proxyBeanInstance)); } }
public T call() throws Exception { if (instance == null) { Contextual<T> contextual = getBeanManager().getServices().get(ContextualStore.class).<Contextual<T>, T>getContextual(beanId); if (contextual instanceof EEResourceProducerField<?, ?>) { this.instance = Reflections.<EEResourceProducerField<?, T>>cast(contextual).createUnderlying(creationalContext); } else { throw BeanLogger.LOG.beanNotEeResourceProducer(contextual); } } return instance; }
@Override public T create(CreationalContext<T> creationalContext) { final T beanInstance = getProducer().produce(creationalContext); if (Reflections.isFinal(rawType) || Serializable.class.isAssignableFrom(beanInstance.getClass())) { return checkReturnValue(beanInstance); } else { BeanInstance proxyBeanInstance = new EnterpriseTargetBeanInstance(getTypes(), new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(), this, creationalContext, beanInstance))); return checkReturnValue(proxyFactory.create(proxyBeanInstance)); } }
@Override public T create(CreationalContext<T> creationalContext) { final T beanInstance = getProducer().produce(creationalContext); if (Reflections.isFinal(rawType) || Serializable.class.isAssignableFrom(beanInstance.getClass())) { return checkReturnValue(beanInstance); } else { BeanInstance proxyBeanInstance = new EnterpriseTargetBeanInstance(getTypes(), new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(), this, creationalContext, beanInstance))); return checkReturnValue(proxyFactory.create(proxyBeanInstance)); } }
@Override public T create(CreationalContext<T> creationalContext) { final T beanInstance = getProducer().produce(creationalContext); if (Reflections.isFinal(rawType) || Serializable.class.isAssignableFrom(beanInstance.getClass())) { return checkReturnValue(beanInstance); } else { BeanInstance proxyBeanInstance = new EnterpriseTargetBeanInstance(getTypes(), new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(), this, creationalContext, beanInstance))); return checkReturnValue(proxyFactory.create(proxyBeanInstance)); } }
public T call() throws Exception { if (instance == null) { Contextual<T> contextual = getBeanManager().getServices().get(ContextualStore.class).<Contextual<T>, T>getContextual(beanId); if (contextual instanceof EEResourceProducerField<?, ?>) { this.instance = Reflections.<EEResourceProducerField<?, T>>cast(contextual).createUnderlying(creationalContext); } else { throw BeanLogger.LOG.beanNotEeResourceProducer(contextual); } } return instance; }
public T call() throws Exception { if (instance == null) { Contextual<T> contextual = getBeanManager().getServices().get(ContextualStore.class).<Contextual<T>, T>getContextual(beanId); if (contextual instanceof EEResourceProducerField<?, ?>) { this.instance = Reflections.<EEResourceProducerField<?, T>>cast(contextual).createUnderlying(creationalContext); } else { throw BeanLogger.LOG.beanNotEeResourceProducer(contextual); } } return instance; }
public T call() throws Exception { if (instance == null) { Contextual<T> contextual = getBeanManager().getServices().get(ContextualStore.class).<Contextual<T>, T>getContextual(beanId); if (contextual instanceof EEResourceProducerField<?, ?>) { this.instance = Reflections.<EEResourceProducerField<?, T>>cast(contextual).createUnderlying(creationalContext); } else { throw BeanLogger.LOG.beanNotEeResourceProducer(contextual); } } return instance; }
@Override public T create(CreationalContext<T> creationalContext) { final T beanInstance = getProducer().produce(creationalContext); if (Reflections.isFinal(rawType) || Serializable.class.isAssignableFrom(beanInstance.getClass())) { return checkReturnValue(beanInstance); } else { BeanInstance proxyBeanInstance = new EnterpriseTargetBeanInstance(getTypes(), new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(), this, creationalContext, beanInstance))); return checkReturnValue(proxyFactory.create(proxyBeanInstance)); } }
public T call() throws Exception { if (instance == null) { Contextual<T> contextual = getBeanManager().getServices().get(ContextualStore.class).<Contextual<T>, T>getContextual(beanId); if (contextual instanceof EEResourceProducerField<?, ?>) { this.instance = Reflections.<EEResourceProducerField<?, T>>cast(contextual).createUnderlying(creationalContext); } else { throw BeanLogger.LOG.beanNotEeResourceProducer(contextual); } } return instance; }
@Override public T create(CreationalContext<T> creationalContext) { final T beanInstance = getProducer().produce(creationalContext); if (Reflections.isFinal(rawType) || Serializable.class.isAssignableFrom(beanInstance.getClass())) { return checkReturnValue(beanInstance); } else { BeanInstance proxyBeanInstance = new EnterpriseTargetBeanInstance(getTypes(), new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(), this, creationalContext, beanInstance))); return checkReturnValue(proxyFactory.create(proxyBeanInstance)); } }
public T call() throws Exception { if (instance == null) { Contextual<T> contextual = getBeanManager().getServices().get(ContextualStore.class).<Contextual<T>, T>getContextual(beanId); if (contextual instanceof EEResourceProducerField<?, ?>) { this.instance = Reflections.<EEResourceProducerField<?, T>>cast(contextual).createUnderlying(creationalContext); } else { throw BeanLogger.LOG.beanNotEeResourceProducer(contextual); } } return instance; }