Package com.logicaldoc.core.threading
Class NotifyingThread<T>
java.lang.Object
com.logicaldoc.core.threading.NotifyingThread<T>
- Type Parameters:
- T- the type of callable
- All Implemented Interfaces:
- Callable<T>
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 SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceInterface to be implemented by the listeners
- 
Constructor SummaryConstructorsConstructorDescriptionNotifyingThread(String name) NotifyingThread(Callable<T> wrappedCallable, String name) 
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidaddListener(NotifyingThread.ThreadCompleteListener<T> listener) final Tcall()doRun()Concrete implementations should override this method to implement their own processing.longGets the elapsed time since the begin of the execution until now o until the end of the thread's executiongetError()getName()booleanisOver()Checks if the thread has finishedfinal voidvoid
- 
Constructor Details- 
NotifyingThread
- 
NotifyingThread
 
- 
- 
Method Details- 
addListener
- 
removeListener
- 
getName
- 
setName
- 
getElapsedTimepublic 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
 
- 
isOverpublic boolean isOver()Checks if the thread has finished- Returns:
- if the it has finished
 
- 
call
- 
doRunConcrete implementations should override this method to implement their own processing.
- 
getError
 
-