Interface BeanContainer

All Superinterfaces:
Stoppable

@JavaServiceLoadable @SPI({USE,IMPLEMENT,SUPPLY}) public interface BeanContainer extends 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:
  • Method Details

    • stop

      void stop()
      Stop the container after all acquisition, access, and release operations have completed. Shutdown need not support concurrent calls.
      Specified by:
      stop in interface Stoppable
    • 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

      void releaseBean(ManagedBean<?> bean)
      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.