Enum ContextStrategy

java.lang.Object
java.lang.Enum<ContextStrategy>
org.wildfly.clustering.server.context.ContextStrategy
All Implemented Interfaces:
Serializable, Comparable<ContextStrategy>, java.lang.constant.Constable, ContextFactory

public enum ContextStrategy extends Enum<ContextStrategy> implements ContextFactory
Implementations for creating contexts.
Author:
Paul Ferraro
  • Enum Constant Details

    • UNSHARED

      public static final ContextStrategy UNSHARED
      Creates an unshared context, where state is always "absent".
      invalid reference
      Context#computeIfAbsent(Object, Function)
      will always creates its value from the specified factory. Intended for use when some other mechanism already ensures mutually exclusive access to the requested state.
    • SHARED

      public static final ContextStrategy SHARED
      Creates a context storing sharable references. Concurrent
      invalid reference
      Context#computeIfAbsent(Object, Function)
      invocations for the same key will reference the same state, until all references are closed.
  • Method Details

    • values

      public static ContextStrategy[] 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 ContextStrategy 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