- All Implemented Interfaces:
Serializable
,Comparable<DMethodOptions.Locking>
- Enclosing class:
- DMethodOptions
Enumeration of locking modes for dynamic methods.
The implementation of dynamic methods uses a table that
maps argument types to code that will be called to perform an
operation. Because Java loads classes when needed, the table
may be read or modified concurrently (modifications involve
adding new entries). The type of locking used can be set
at compile time. This enumeration specifies the choices.
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic DMethodOptions.Locking
Returns the enum constant of this type with the specified name.static DMethodOptions.Locking[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NONE
No locking is required. This is appropriate for use in an application that is single-threaded, or when one can ensure that all uses of dynamic methods associated with a class or interface occur in the same thread until all classes used in the application and that implement those dynamic methods are initialized. -
DEFAULT
The default locking mode is MUTEX but may be overridden via a compiler option. -
MUTEX
A mutual-exclusion lock is used for locking. -
RWLOCK
A read-write lock is used. This is more expensive than a mutual exclusion lock but allows more concurrency. It may be useful in cases where lock contention is very high.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-