Top Description Inners Fields Constructors Methods
org.wildfly.common.selector

public abstract Class Selector<T>

extends Object
Class Inheritance
Known Direct Subclasses
org.wildfly.common.selector.ThreadLocalSelector, org.wildfly.common.selector.ContextClassLoaderSelector, org.wildfly.common.selector.GlobalSelector
Annotations
@Deprecated
Imports
java.lang.reflect.InvocationTargetException, java.security.PrivilegedAction, java.util.concurrent.atomic.AtomicReference, org.wildfly.common.Assert, org.wildfly.common.context.Contextual

Deprecated

Use Contextual instead.

A selector for an object which is obtainable via static context.
Author
David M. Lloyd

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Selector.Getter<
the selectable class' type
T
>

An efficient, unchecked getter for a selector for a given class.

pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final Selector<?>
NULL

Deprecated as a consequence of Selector being deprecated.
private static final ClassValue<Selector.Holder<?>>

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract T

Returns:

the currently relevant object
get
()

Get the currently relevant object, or null if there is none.

public static SelectorPermission

Returns:

the selector permission for the class
getChangePermissionFor
(Class<?>
the class to get the permission for
clazz
)

Get the change permission for the given class.

public static SelectorPermission

Returns:

the selector permission for the class
getGetPermissionFor
(Class<?>
the class to get the permission for
clazz
)

Get the get permission for the given class.

public static SelectorPermission

Returns:

the selector permission for the class
getSetPermissionFor
(Class<?>
the class to get the permission for
clazz
)

Get the set permission for the given class.

public static <
the selectable class' type
T
>
Selector<T>

Returns:

the null selector
nullSelector
()

Deprecated as a consequence of Selector being deprecated.
Get the null selector.
public static <
the class type
T
>
Selector<T>

Returns:

the selector for the given type (not null)
selectorFor
(Class<T>
the class
clazz
)

Deprecated as a consequence of Selector being deprecated.
Get the selector for a given class.
public static <
the class type
T
>
PrivilegedAction<Selector.Getter<T>>

Returns:

the getter privileged action
selectorGetterActionFor
(final Class<T>
the class
clazz
)

Get a privileged action which returns the getter for a selector.

public static <
the class type
T
>
Selector.Getter<T>

Returns:

the unchecked selector getter
selectorGetterFor
(Class<T>
the class
clazz
)

Get an efficient, unchecked selector getter for a given class.

public static <
the class type
T
>
void
setSelectorFor(Class<T>
the class
clazz
,
Selector<T>
the selector to set for the class
selector
)

Deprecated as a consequence of Selector being deprecated.
Set the selector for a given class.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NULLback to summary
private static final Selector<?> NULL

Deprecated

as a consequence of Selector being deprecated. See corresponding docs for further information.

selValback to summary
private static final ClassValue<Selector.Holder<?>> selVal

Constructor Detail

Selectorback to summary
protected Selector()

Method Detail

getback to summary
public abstract T get()

Get the currently relevant object, or null if there is none.

Returns:T

the currently relevant object

getChangePermissionForback to summary
public static SelectorPermission getChangePermissionFor(Class<?> clazz)

Get the change permission for the given class. The permission is cached.

Parameters
clazz:Class<?>

the class to get the permission for

Returns:SelectorPermission

the selector permission for the class

getGetPermissionForback to summary
public static SelectorPermission getGetPermissionFor(Class<?> clazz)

Get the get permission for the given class. The permission is cached.

Parameters
clazz:Class<?>

the class to get the permission for

Returns:SelectorPermission

the selector permission for the class

getSetPermissionForback to summary
public static SelectorPermission getSetPermissionFor(Class<?> clazz)

Get the set permission for the given class. The permission is cached.

Parameters
clazz:Class<?>

the class to get the permission for

Returns:SelectorPermission

the selector permission for the class

nullSelectorback to summary
public static <T> Selector<T> nullSelector()

Deprecated

as a consequence of Selector being deprecated. See corresponding docs for further information.

Get the null selector. This selector always returns null.

Parameters
<T>
the selectable class' type
Returns:Selector<T>

the null selector

Annotations
@SuppressWarnings:unchecked
selectorForback to summary
public static <T> Selector<T> selectorFor(Class<T> clazz)

Deprecated

as a consequence of Selector being deprecated. See corresponding docs for further information.

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.

Parameters
<T>
the class type
clazz:Class<T>

the class

Returns:Selector<T>

the selector for the given type (not null)

Annotations
@SuppressWarnings:unchecked
selectorGetterActionForback to summary
public static <T> PrivilegedAction<Selector.Getter<T>> selectorGetterActionFor(final Class<T> clazz)

Get a privileged action which returns the getter for a selector.

Parameters
<T>
the class type
clazz:Class<T>

the class

Returns:PrivilegedAction<Selector.Getter<T>>

the getter privileged action

selectorGetterForback to summary
public static <T> Selector.Getter<T> selectorGetterFor(Class<T> clazz)

Get an efficient, unchecked selector getter for a given class. The caller must have the get SelectorPermission for the class.

Parameters
<T>
the class type
clazz:Class<T>

the class

Returns:Selector.Getter<T>

the unchecked selector getter

Annotations
@SuppressWarnings:unchecked
setSelectorForback to summary
public static <T> void setSelectorFor(Class<T> clazz, Selector<T> selector)

Deprecated

as a consequence of Selector being deprecated. See corresponding docs for further information.

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.

Parameters
<T>
the class type
clazz:Class<T>

the class

selector:Selector<T>

the selector to set for the class

Annotations
@SuppressWarnings:unchecked
org.wildfly.common.selector back to summary

public final Class Selector.Getter<T>

extends Object
Class Inheritance
Type Parameters
<T>
the selectable class' type

An efficient, unchecked getter for a selector for a given class.

Field Summary

Modifier and TypeField and Description
private final Selector.Holder<T>

Constructor Summary

AccessConstructor and Description
pack-priv
Getter(final Selector.Holder<T> holder)

Method Summary

Modifier and TypeMethod and Description
public Selector<T>

Returns:

the selector
getSelector
()

Deprecated as a consequence of Selector being deprecated.
Get the selector for this getter.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

holderback to summary
private final Selector.Holder<T> holder

Constructor Detail

Getterback to summary
pack-priv Getter(final Selector.Holder<T> holder)

Method Detail

getSelectorback to summary
public Selector<T> getSelector()

Deprecated

as a consequence of Selector being deprecated. See corresponding docs for further information.

Get the selector for this getter. No permission checks are performed.

Returns:Selector<T>

the selector

org.wildfly.common.selector back to summary

pack-priv final Class Selector.Holder<T>

extends AtomicReference<Selector<T>>
Class Inheritance
Annotations
@SuppressWarnings:serial

Field Summary

Modifier and TypeField and Description
private final SelectorPermission
private final Class<T>
private final SelectorPermission
private final AtomicReference<Object>
private final SelectorPermission

Constructor Summary

AccessConstructor and Description
pack-priv
Holder(final Class<T> clazz)

Method Summary

Modifier and TypeMethod and Description
pack-priv SelectorPermission
pack-priv Class<T>
pack-priv SelectorPermission
pack-priv SelectorPermission
pack-priv void
lock(Object key)

pack-priv void
Inherited from java.util.concurrent.atomic.AtomicReference:
accumulateAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndAccumulategetAndSetgetAndUpdategetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

changePermissionback to summary
private final SelectorPermission changePermission
clazzback to summary
private final Class<T> clazz
getPermissionback to summary
private final SelectorPermission getPermission
lockRefback to summary
private final AtomicReference<Object> lockRef
setPermissionback to summary
private final SelectorPermission setPermission

Constructor Detail

Holderback to summary
pack-priv Holder(final Class<T> clazz)

Method Detail

getChangePermissionback to summary
pack-priv SelectorPermission getChangePermission()
getClazzback to summary
pack-priv Class<T> getClazz()
getGetPermissionback to summary
pack-priv SelectorPermission getGetPermission()
getSetPermissionback to summary
pack-priv SelectorPermission getSetPermission()
lockback to summary
pack-priv void lock(Object key)
unlockback to summary
pack-priv void unlock(Object key)