|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectThreadSafe.U
@ThreadSafe public static final class ThreadSafe.U
Thread-safety utilities. Includes utility methods for accessors to test the safety of code, prior to accessing it. For tests that code can use, after access, see ThreadRestricted.
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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
- actual (runtime) type of the object
on which the method is calledmethod
- 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()
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |