@ThreadSafe public static final class ThreadSafe.U extends Object
Modifier and Type | Method and Description |
---|---|
static void |
disableChecking() |
static boolean |
isCheckingEnabled()
Returns true if thread-safety checks are actually performed (normal
situation); false if they were disabled in this classloader's runtime.
|
static boolean |
isThreadSafe(Class<?> objectType,
Method method)
Tests whether a method is effectively
annotated thread safe.
|
static boolean |
isThreadSafe(Object o,
String publicMethodName,
Class<?>... methodParameterTypes)
Tests whether a public method is effectively annotated thread safe.
|
public static boolean isCheckingEnabled()
Checking may be disabled by code that lacks permission to read annotations. For instance, an unsigned applet may disable checking to avoid having AccessControlExceptions thrown by underlying library code that makes use of these tests.
disableChecking()
public static void disableChecking()
public static boolean isThreadSafe(Class<?> objectType, Method method)
objectType
- type of the object on which the method is called, per
object.getClass().method
- of the object (declared or inherited).public static boolean isThreadSafe(Object o, String publicMethodName, Class<?>... methodParameterTypes)
IllegalArgumentException
- if there is no such public method, per
Class.getMethod().