Package org.wildfly.common.selector
Class Selector<T>
- java.lang.Object
-
- org.wildfly.common.selector.Selector<T>
-
- Direct Known Subclasses:
GlobalSelector,ThreadLocalSelector
@Deprecated public abstract class Selector<T> extends java.lang.ObjectDeprecated.UseContextualinstead.A selector for an object which is obtainable via static context.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSelector.Getter<T>Deprecated.An efficient, unchecked getter for a selector for a given class.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSelector()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract Tget()Deprecated.Get the currently relevant object, ornullif there is none.static SelectorPermissiongetChangePermissionFor(java.lang.Class<?> clazz)Deprecated.Get thechangepermission for the given class.static SelectorPermissiongetGetPermissionFor(java.lang.Class<?> clazz)Deprecated.Get thegetpermission for the given class.static SelectorPermissiongetSetPermissionFor(java.lang.Class<?> clazz)Deprecated.Get thesetpermission for the given class.static <T> Selector<T>nullSelector()Deprecated.Get thenullselector.static <T> Selector<T>selectorFor(java.lang.Class<T> clazz)Deprecated.Get the selector for a given class.static <T> java.security.PrivilegedAction<Selector.Getter<T>>selectorGetterActionFor(java.lang.Class<T> clazz)Deprecated.Get a privileged action which returns the getter for a selector.static <T> Selector.Getter<T>selectorGetterFor(java.lang.Class<T> clazz)Deprecated.Get an efficient, unchecked selector getter for a given class.static <T> voidsetSelectorFor(java.lang.Class<T> clazz, Selector<T> selector)Deprecated.Set the selector for a given class.
-
-
-
Method Detail
-
get
public abstract T get()
Deprecated.Get the currently relevant object, ornullif there is none.- Returns:
- the currently relevant object
-
nullSelector
public static <T> Selector<T> nullSelector()
Deprecated.Get thenullselector. This selector always returnsnull.- Type Parameters:
T- the selectable class' type- Returns:
- the
nullselector
-
selectorFor
public static <T> Selector<T> selectorFor(java.lang.Class<T> clazz)
Deprecated.Get the selector for a given class. Never returnsnull. If there is a selector set, the caller must have thegetSelectorPermissionfor 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(java.lang.Class<T> clazz, Selector<T> selector)Deprecated.Set the selector for a given class. If there is no selector set, the caller must have thesetSelectorPermissionfor that class. If there is one set, the caller must have thechangeSelectorPermission. 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 classselector- the selector to set for the class
-
selectorGetterFor
public static <T> Selector.Getter<T> selectorGetterFor(java.lang.Class<T> clazz)
Deprecated.Get an efficient, unchecked selector getter for a given class. The caller must have thegetSelectorPermissionfor the class.- Type Parameters:
T- the class type- Parameters:
clazz- the class- Returns:
- the unchecked selector getter
-
selectorGetterActionFor
public static <T> java.security.PrivilegedAction<Selector.Getter<T>> selectorGetterActionFor(java.lang.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(java.lang.Class<?> clazz)
Deprecated.Get thegetpermission 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(java.lang.Class<?> clazz)
Deprecated.Get thesetpermission 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(java.lang.Class<?> clazz)
Deprecated.Get thechangepermission for the given class. The permission is cached.- Parameters:
clazz- the class to get the permission for- Returns:
- the selector permission for the class
-
-