Java Examples for org.hibernate.resource.beans.spi.BeanInstanceProducer

The following java examples will help you to understand the usage of org.hibernate.resource.beans.spi.BeanInstanceProducer. These source code samples are taken from different open source projects.

Example 1
Project: spring-framework-master  File: SpringBeanContainer.java View source code
@Override
@SuppressWarnings("unchecked")
public <B> ContainedBean<B> getBean(Class<B> beanType, LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) {
    SpringContainedBean<?> bean;
    if (lifecycleOptions.canUseCachedReferences()) {
        bean = this.beanCache.get(beanType);
        if (bean == null) {
            bean = createBean(beanType, lifecycleOptions, fallbackProducer);
            this.beanCache.put(beanType, bean);
        }
    } else {
        bean = createBean(beanType, lifecycleOptions, fallbackProducer);
    }
    return (SpringContainedBean<B>) bean;
}