Enum Class BeanInstanceCaching

java.lang.Object
java.lang.Enum<BeanInstanceCaching>
org.hibernate.resource.beans.spi.BeanInstanceCaching
All Implemented Interfaces:
Serializable, Comparable<BeanInstanceCaching>, Constable

@Incubating(since="8.0", group="bootstrap-safe-beans") @SPI(USE) public enum BeanInstanceCaching extends Enum<BeanInstanceCaching>
Controls caching of bean references obtained from the ManagedBeanRegistry. This policy does not change the underlying bean container's scope semantics.
Since:
8.0
  • Enum Constant Details

    • ALLOW

      public static final BeanInstanceCaching ALLOW
      Allow reuse of a shared, cached instance. Repeated calls for the same bean class may return the same ManagedBean handle.
    • DISALLOW

      public static final BeanInstanceCaching DISALLOW
      Bypass Hibernate's bean cache for both lookup and storage. Each call returns an independently managed ManagedBean handle that must be released via ManagedBeanRegistry.releaseBean(ManagedBean). The underlying container's scope semantics may still cause handles to refer to the same bean instance.
  • Method Details

    • values

      public static BeanInstanceCaching[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BeanInstanceCaching valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null