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.Object
Deprecated.UseContextual
instead.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 class
Selector.Getter<T>
Deprecated.An efficient, unchecked getter for a selector for a given class.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Selector()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract T
get()
Deprecated.Get the currently relevant object, ornull
if there is none.static SelectorPermission
getChangePermissionFor(java.lang.Class<?> clazz)
Deprecated.Get thechange
permission for the given class.static SelectorPermission
getGetPermissionFor(java.lang.Class<?> clazz)
Deprecated.Get theget
permission for the given class.static SelectorPermission
getSetPermissionFor(java.lang.Class<?> clazz)
Deprecated.Get theset
permission for the given class.static <T> Selector<T>
nullSelector()
Deprecated.Get thenull
selector.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> void
setSelectorFor(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, ornull
if there is none.- Returns:
- the currently relevant object
-
nullSelector
public static <T> Selector<T> nullSelector()
Deprecated.Get thenull
selector. This selector always returnsnull
.- Type Parameters:
T
- the selectable class' type- Returns:
- the
null
selector
-
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 theget
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(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 theset
SelectorPermission
for that class. If there is one set, the caller must have thechange
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 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 theget
SelectorPermission
for 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 theget
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(java.lang.Class<?> clazz)
Deprecated.Get theset
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(java.lang.Class<?> clazz)
Deprecated.Get thechange
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
-
-