public final class EntityValidationThread
extends java.lang.Thread
Thread
specialized in running validation tasks. Each
ValidationThread
has its own Validator
instance. In addition
it allows a flag to be set (by the main thread) that the currently running
ConstraintValidator
may query to see if there is a termination
request. See ValidationExecutor
for the rationale behind this.#isTerminationRequested()}.
Modifier and Type | Method and Description |
---|---|
boolean |
isTerminationRequested()
Flag indicating that the
ConstraintValidator currently running in
this ValidationThread is requested to terminate itself. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public boolean isTerminationRequested()
ConstraintValidator
currently running in
this ValidationThread
is requested to terminate itself.
Constraint validators can check whether to abort the validation like so:
if(Thread.currentThread() instanceof ValidationThread) {
ValidationThread vt = (ValidationThread) Thread.currentThread();
if(vt.isTerminationRequested()) {
// Stop with what I am doing
}
}
ConstraintValidator
is requested to terminate itselfCopyright © 2007-2020 EDIT. All Rights Reserved.