public final class ThreadCop
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ThreadCop.ACCESS
the access type
|
static class |
ThreadCop.MODE
the thread modes
|
Modifier and Type | Method and Description |
---|---|
static boolean |
access(java.lang.Object target)
modify access
|
static boolean |
access(java.lang.Object target,
ThreadCop.ACCESS access)
check the thread access of the object
|
static boolean |
addPauseAt(java.lang.String position,
long timeToPause)
add pause to a location
|
static void |
causeExceptionAt(java.lang.String position)
cause an exception at
|
static boolean |
checkExceptionAt(java.lang.String position)
cause an exception at
|
static boolean |
checkFlowControlException(java.lang.Throwable t)
check that this a flow control exception
|
static boolean |
clearLocations()
clear all pauses.
|
static ThreadCop.MODE |
currentMonitor(java.lang.Object target)
monitor the object
|
static boolean |
enter(java.lang.Object target)
The are entering the target object
|
static boolean |
enter(java.lang.Object target,
ThreadCop.ACCESS access)
The are entering the target object
|
static long |
errorCount()
The total error count
|
static long |
incrementErrorCount()
increment the error count
|
static ThreadCopError |
lastError()
The last error that occurred.
|
static boolean |
leave(java.lang.Object target)
The are leaving the target object
|
static boolean |
modify(java.lang.Object target)
modify access
|
static boolean |
monitor(java.lang.Object target,
ThreadCop.MODE mode)
monitor the object
|
static boolean |
pauseAt(java.lang.String position)
pause at a location
|
static boolean |
popMonitor(java.lang.Object target)
monitor the object
|
static boolean |
pushMonitor(java.lang.Object target,
ThreadCop.MODE mode)
monitor the object
|
static boolean |
read(java.lang.Object target)
read access
|
static void |
recordLastError(ThreadCopError lastError)
record the last error that occurred.
|
public static boolean checkFlowControlException(java.lang.Throwable t)
t
- public static boolean clearLocations()
public static boolean addPauseAt(java.lang.String position, long timeToPause)
position
- this positiontimeToPause
- now long to pausepublic static boolean pauseAt(java.lang.String position)
position
- this positionpublic static void causeExceptionAt(java.lang.String position)
position
- this positionpublic static boolean checkExceptionAt(java.lang.String position)
position
- this positionpublic static long errorCount()
public static ThreadCopError lastError()
public static void recordLastError(ThreadCopError lastError)
lastError
- the last error.public static boolean pushMonitor(@Nullable java.lang.Object target, @Nonnull ThreadCop.MODE mode)
target
- the target objectmode
- the access modepublic static boolean popMonitor(java.lang.Object target)
target
- the target object@CheckReturnValue @Nonnull public static ThreadCop.MODE currentMonitor(@Nonnull java.lang.Object target)
target
- the target objectpublic static boolean monitor(java.lang.Object target, ThreadCop.MODE mode)
target
- the target objectmode
- the access modepublic static boolean read(java.lang.Object target)
target
- the target objectpublic static boolean modify(java.lang.Object target)
target
- the target objectpublic static boolean access(java.lang.Object target)
target
- the target objectpublic static boolean access(java.lang.Object target, ThreadCop.ACCESS access)
target
- the target objectaccess
- the type of accesspublic static boolean enter(java.lang.Object target)
target
- the target objectpublic static boolean enter(java.lang.Object target, ThreadCop.ACCESS access)
target
- the target objectaccess
- the type of accesspublic static boolean leave(java.lang.Object target)
target
- the target objectpublic static long incrementErrorCount()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.