Package com.logicaldoc.core.threading
Class NotifyingThread
java.lang.Object
java.lang.Thread
com.logicaldoc.core.threading.NotifyingThread
- All Implemented Interfaces:
Runnable
A Thread that notifies it's listeners about the end of the elaboration and
also measures the execution time.
- Since:
- 8.5.3
- Author:
- Marco Meschieri - LogicalDOC
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface to be implemented by the listenersNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionNotifyingThread
(Runnable target, String name) NotifyingThread
(String name) NotifyingThread
(ThreadGroup group, String name) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
void
doRun()
Concrete implementations should override this method to implement their own processing.long
Gets the elapsed time since the begin of the execution until now o until the end of the thread's executiongetError()
boolean
isOver()
Checks if the thread has finishedfinal void
final void
run()
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
NotifyingThread
public NotifyingThread() -
NotifyingThread
-
NotifyingThread
-
NotifyingThread
-
-
Method Details
-
addListener
-
removeListener
-
getElapsedTime
public long getElapsedTime()Gets the elapsed time since the begin of the execution until now o until the end of the thread's execution- Returns:
- the elapsed time in milliseconds
-
isOver
public boolean isOver()Checks if the thread has finished- Returns:
- if the it has finished
-
run
public final void run() -
doRun
public void doRun()Concrete implementations should override this method to implement their own processing. -
getError
-