Package org.hibernate.cache.spi.access
Enum Class AccessType
- All Implemented Interfaces:
Serializable
,Comparable<AccessType>
,Constable
Enumerates the policies for managing concurrent access to the shared
second-level cache.
- API Note:
- This enumeration is isomorphic to
CacheConcurrencyStrategy
. We don't really need both, but one is part of this SPI, and one forms part of the API of the annotations package. In the future, it would be nice to replace them both with a neworg.hibernate.CacheConcurrencyPolicy
enum.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRead and write access.Read-only access.Read and write access.Read and write access. -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessType
fromExternalName
(@Nullable String externalName) Resolve anAccessType
from its external name.Get the external name of this value.toString()
static AccessType
Returns the enum constant of this class with the specified name.static AccessType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
READ_ONLY
Read-only access. Data may be added and removed, but not mutated. -
READ_WRITE
Read and write access. Data may be added, removed and mutated. A "soft" lock on the cached item is used to manage concurrent access during mutation. -
NONSTRICT_READ_WRITE
Read and write access. Data may be added, removed and mutated. The cached item is invalidated before and after transaction completion to manage concurrent access during mutation. This strategy is more vulnerable to inconsistencies thanREAD_WRITE
, but may allow higher throughput. -
TRANSACTIONAL
Read and write access. Data may be added, removed and mutated. Some sort of hard lock is maintained in conjunction with a JTA transaction.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getExternalName
Get the external name of this value.- Returns:
- The corresponding externalized name.
-
toString
- Overrides:
toString
in classEnum<AccessType>
-
fromExternalName
Resolve anAccessType
from its external name.- Parameters:
externalName
- The external representation to resolve- Returns:
- The
AccessType
represented by the given external name - Throws:
UnknownAccessTypeException
- if the external name was not recognized- See Also:
-