Interface ManagedBeanSettings
-
public interface ManagedBeanSettings
-
-
Field Summary
Fields Modifier and Type Field Description static StringALLOW_EXTENSIONS_IN_CDIControls whether Hibernate can try to create beans other than converters and listeners using CDI.static StringBEAN_CONTAINERIdentifies aBeanContainerto be used.static StringCDI_BEAN_MANAGERDeprecated.UseJAKARTA_CDI_BEAN_MANAGERinsteadstatic StringDELAY_CDI_ACCESSUsed in conjunction with "hibernate.resource.beans.container" when CDI is used.static StringJAKARTA_CDI_BEAN_MANAGERUsed to pass a CDIBeanManagerto Hibernate.
-
-
-
Field Detail
-
JAKARTA_CDI_BEAN_MANAGER
static final String JAKARTA_CDI_BEAN_MANAGER
Used to pass a CDIBeanManagerto Hibernate.According to the JPA specification, the
BeanManagershould be passed at boot time and be ready for immediate use at that time. But not all environments can do this (WildFly, for example). To accommodate such environments, Hibernate provides two options:- A proprietary CDI extension SPI (which has been proposed to the CDI
spec group as a standard option) which can be used to provide delayed
BeanManageraccess: to use this solution, the reference passed as theBeanManagerduring bootstrap should be typed asExtendedBeanManager. - Delayed access to the
BeanManagerreference: here, Hibernate will not access the reference passed as theBeanManagerduring bootstrap until it is first needed. Note, however, that this has the effect of delaying the detection of any deployment problems until after bootstrapping.
BeanManager, either directly, or viaExtendedBeanManager. - A proprietary CDI extension SPI (which has been proposed to the CDI
spec group as a standard option) which can be used to provide delayed
-
BEAN_CONTAINER
static final String BEAN_CONTAINER
Identifies aBeanContainerto be used.Note that for CDI-based containers setting this is not necessary - simply pass the
BeanManagerto use viaCDI_BEAN_MANAGERand optionally specifyDELAY_CDI_ACCESS. This setting useful to integrate non-CDI bean containers such as Spring.- Since:
- 5.3
- See Also:
- Constant Field Values
-
DELAY_CDI_ACCESS
static final String DELAY_CDI_ACCESS
Used in conjunction with "hibernate.resource.beans.container" when CDI is used.By default, to be JPA spec compliant, Hibernate should access the CDI
BeanManagerwhile bootstrapping theSessionFactory. In some cases however this can lead to a chicken/egg situation where the JPA provider immediately accesses theBeanManagerwhen managed beans are awaiting JPA PU injection.This setting tells Hibernate to delay accessing until first use.
This setting has the decided downside that bean config problems will not be done at deployment time, but will instead manifest at runtime. For this reason, the preferred means for supplying a CDI BeanManager is to provide an implementation of
ExtendedBeanManagerwhich gives Hibernate a callback when theBeanManageris ready for use.- Since:
- 5.0.8
- See Also:
- Constant Field Values
-
ALLOW_EXTENSIONS_IN_CDI
static final String ALLOW_EXTENSIONS_IN_CDI
Controls whether Hibernate can try to create beans other than converters and listeners using CDI. Only meaningful when a CDIcontaineris used.By default, Hibernate will only attempt to create converter and listener beans using CDI.
- Since:
- 6.2
- See Also:
- Constant Field Values
-
CDI_BEAN_MANAGER
@Deprecated static final String CDI_BEAN_MANAGER
Deprecated.UseJAKARTA_CDI_BEAN_MANAGERinstead- See Also:
- Constant Field Values
-
-