Class Selector<T>

java.lang.Object
org.wildfly.common.selector.Selector<T>
Direct Known Subclasses:
GlobalSelector, ThreadLocalSelector

@Deprecated public abstract class Selector<T> extends Object
Deprecated.
Use Contextual instead.
A selector for an object which is obtainable via static context.
Author:
David M. Lloyd
  • Constructor Details

    • Selector

      protected Selector()
      Deprecated.
  • Method Details

    • get

      public abstract T get()
      Deprecated.
      Get the currently relevant object, or null if there is none.
      Returns:
      the currently relevant object
    • nullSelector

      public static <T> Selector<T> nullSelector()
      Deprecated.
      Get the null selector. This selector always returns null.
      Type Parameters:
      T - the selectable class' type
      Returns:
      the null selector
    • selectorFor

      public static <T> Selector<T> selectorFor(Class<T> clazz)
      Deprecated.
      Get the selector for a given class. Never returns null. If there is a selector set, the caller must have the get SelectorPermission for the class.
      Type Parameters:
      T - the class type
      Parameters:
      clazz - the class
      Returns:
      the selector for the given type (not null)
    • setSelectorFor

      public static <T> void setSelectorFor(Class<T> clazz, Selector<T> selector)
      Deprecated.
      Set the selector for a given class. If there is no selector set, the caller must have the set SelectorPermission for that class. If there is one set, the caller must have the change SelectorPermission. If there is a selector set, and it is identical to the proposed selector, this method returns without taking any action.
      Type Parameters:
      T - the class type
      Parameters:
      clazz - the class
      selector - the selector to set for the class
    • selectorGetterFor

      public static <T> Selector.Getter<T> selectorGetterFor(Class<T> clazz)
      Deprecated.
      Get an efficient, unchecked selector getter for a given class. The caller must have the get SelectorPermission for the class.
      Type Parameters:
      T - the class type
      Parameters:
      clazz - the class
      Returns:
      the unchecked selector getter
    • selectorGetterActionFor

      public static <T> PrivilegedAction<Selector.Getter<T>> selectorGetterActionFor(Class<T> clazz)
      Deprecated.
      Get a privileged action which returns the getter for a selector.
      Type Parameters:
      T - the class type
      Parameters:
      clazz - the class
      Returns:
      the getter privileged action
    • getGetPermissionFor

      public static SelectorPermission getGetPermissionFor(Class<?> clazz)
      Deprecated.
      Get the get permission for the given class. The permission is cached.
      Parameters:
      clazz - the class to get the permission for
      Returns:
      the selector permission for the class
    • getSetPermissionFor

      public static SelectorPermission getSetPermissionFor(Class<?> clazz)
      Deprecated.
      Get the set permission for the given class. The permission is cached.
      Parameters:
      clazz - the class to get the permission for
      Returns:
      the selector permission for the class
    • getChangePermissionFor

      public static SelectorPermission getChangePermissionFor(Class<?> clazz)
      Deprecated.
      Get the change permission for the given class. The permission is cached.
      Parameters:
      clazz - the class to get the permission for
      Returns:
      the selector permission for the class