Enum DMethodOptions.Locking

java.lang.Object
java.lang.Enum<DMethodOptions.Locking>
org.bzdev.lang.annotations.DMethodOptions.Locking
All Implemented Interfaces:
Serializable, Comparable<DMethodOptions.Locking>
Enclosing class:
DMethodOptions

public static enum DMethodOptions.Locking extends Enum<DMethodOptions.Locking>
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 Details

    • NONE

      public static final DMethodOptions.Locking 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

      public static final DMethodOptions.Locking DEFAULT
      The default locking mode is MUTEX but may be overridden via a compiler option.
    • MUTEX

      public static final DMethodOptions.Locking MUTEX
      A mutual-exclusion lock is used for locking.
    • RWLOCK

      public static final DMethodOptions.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

      public static DMethodOptions.Locking[] 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

      public static DMethodOptions.Locking valueOf(String name)
      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 name
      NullPointerException - if the argument is null