org.hibernate.resource.beans.container.spi.FallbackContainedBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
JPMS Module-Info's for a few of the Jakarta Libraries just until they add them in themselves
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.resource.beans.container.spi;
import org.hibernate.resource.beans.spi.BeanInstanceProducer;
import org.hibernate.resource.beans.spi.ManagedBean;
/**
* @author Steve Ebersole
*/
public class FallbackContainedBean implements ContainedBean, ManagedBean {
private final Class beanType;
private final B beanInstance;
public FallbackContainedBean(Class beanType, BeanInstanceProducer producer) {
this.beanType = beanType;
this.beanInstance = producer.produceBeanInstance( beanType );
}
public FallbackContainedBean(String beanName, Class beanType, BeanInstanceProducer producer) {
this.beanType = beanType;
this.beanInstance = producer.produceBeanInstance( beanName, beanType );
}
@Override
public Class getBeanClass() {
return beanType;
}
@Override
public B getBeanInstance() {
return beanInstance;
}
}