Interface BeanContainer
- All Superinterfaces:
Stoppable
Abstracts any kind of container for managed beans, for example,
the CDI
BeanManager. A
custom bean container may be integrated with Hibernate by
implementing this interface and specifying the implementation
using "hibernate.resource.beans.container".- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAcquisition policy read by container implementations. -
Method Summary
Modifier and TypeMethodDescription<B> ContainedBean<B> getBean(Class<B> beanType, BeanContainer.LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) <B> ContainedBean<B> getBean(String name, Class<B> beanType, BeanContainer.LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) <B> ContainedBean<B> getBootstrapSafeBean(Class<B> beanType, BeanContainer.LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) Acquire a handle without requiring the backing container to be ready.default booleanWhether this container obtains beans exclusively through the fallback producer.voidreleaseBean(ManagedBean<?> bean) Unregister and destroy a bean owned by this container.voidstop()Stop the container after all acquisition, access, and release operations have completed.
-
Method Details
-
stop
-
getBean
<B> ContainedBean<B> getBean(Class<B> beanType, BeanContainer.LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) -
getBean
<B> ContainedBean<B> getBean(String name, Class<B> beanType, BeanContainer.LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) -
getBootstrapSafeBean
<B> ContainedBean<B> getBootstrapSafeBean(Class<B> beanType, BeanContainer.LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) Acquire a handle without requiring the backing container to be ready. Accessing the instance requires the backing container to be ready. -
releaseBean
Unregister and destroy a bean owned by this container. Repeated releases and releases of foreign handles have no effect. Callers must finish using the bean before releasing it, including all users of a shared bean. -
isFallback
default boolean isFallback()Whether this container obtains beans exclusively through the fallback producer.
-