public abstract class ThreadEventManager
extends java.lang.Object
Constructor and Description |
---|
ThreadEventManager() |
Modifier and Type | Method and Description |
---|---|
void |
addThreadListener(IThreadListener pThreadListener)
Adds a thread listener object.
|
void |
addThreadListener(IThreadListener pThreadListener,
int iPosition)
Adds a thread listener object at a specified position.
|
protected void |
fireEndedProperlyEvent()
Informs all thread listeners that the thread ended properly.
|
protected void |
fireInterruptedEvent(java.lang.String pReason)
Informs all thread listeners that the thread got interrupted and could not be ended properly.
|
protected void |
fireProgressStatusEvent(double dProgress,
java.lang.String pCurrentWork)
Fires a status event, that informs all thread listeners about the current status of the thread.
|
void |
removeAllThreadListeners()
Removes all thread listener objects.
|
void |
removeThreadListener(IThreadListener pThreadListener)
Removes the specified thread listener object.
|
public void addThreadListener(IThreadListener pThreadListener)
pThreadListener
- The thread listener object that should listen to this thread.public void addThreadListener(IThreadListener pThreadListener, int iPosition)
pThreadListener
- The thread listener object that should listen to this thread.iPosition
- The position in the list of thread listeners where the listener should be added.public void removeThreadListener(IThreadListener pThreadListener)
pThreadListener
- The thread listener that should no longer listen to this Thread.public void removeAllThreadListeners()
protected void fireProgressStatusEvent(double dProgress, java.lang.String pCurrentWork)
dProgress
- The progress as a double between 0 and 1.pCurrentWork
- A description of the current work that is processed.protected void fireEndedProperlyEvent()
protected void fireInterruptedEvent(java.lang.String pReason)
pReason
- The reason why the thread got interrupted.