Class JpaCompliantLifecycleStrategy
- java.lang.Object
-
- org.hibernate.resource.beans.container.internal.JpaCompliantLifecycleStrategy
-
- All Implemented Interfaces:
BeanLifecycleStrategy
public class JpaCompliantLifecycleStrategy extends Object implements BeanLifecycleStrategy
ABeanLifecycleStrategy
to use when JPA compliance is required (i.e. when the bean lifecycle is to be managed by the JPA runtime, not the CDI runtime). The main characteristic of this strategy is that each requested bean is instantiated directly and guaranteed to not be shared in the CDI context. In particular, @Singleton-scoped or @ApplicationScoped beans are instantiated directly by this strategy, even if there is already an instance in the CDI context. This means singletons are not really singletons, but this seems to be the behavior required by the JPA 2.2 spec.
-
-
Field Summary
Fields Modifier and Type Field Description static JpaCompliantLifecycleStrategy
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <B> ContainedBeanImplementor<B>
createBean(Class<B> beanClass, BeanInstanceProducer fallbackProducer, BeanContainer beanContainer)
<B> ContainedBeanImplementor<B>
createBean(String beanName, Class<B> beanClass, BeanInstanceProducer fallbackProducer, BeanContainer beanContainer)
-
-
-
Field Detail
-
INSTANCE
public static final JpaCompliantLifecycleStrategy INSTANCE
-
-
Method Detail
-
createBean
public <B> ContainedBeanImplementor<B> createBean(Class<B> beanClass, BeanInstanceProducer fallbackProducer, BeanContainer beanContainer)
- Specified by:
createBean
in interfaceBeanLifecycleStrategy
-
createBean
public <B> ContainedBeanImplementor<B> createBean(String beanName, Class<B> beanClass, BeanInstanceProducer fallbackProducer, BeanContainer beanContainer)
- Specified by:
createBean
in interfaceBeanLifecycleStrategy
-
-