public class WorkerThread
extends java.lang.Thread
Scheduled Job Worker Thread
Constructor and Description |
---|
WorkerThread(WorkerThreadPool oThreadPool,
AtomConsumer oAtomConsumer)
Create WorkerThread
|
Modifier and Type | Method and Description |
---|---|
Atom |
activeAtom() |
Job |
activeJob() |
AtomConsumer |
getConsumer() |
int |
getDelayMS() |
void |
getDelayMS(int iMiliseconds) |
java.lang.String |
getProperty(java.lang.String sKey)
Get Environment property from hipergate.cnf
|
long |
getRunningTimeMS() |
void |
halt()
Halt thread execution commiting all operations in course before stopping
If a thread is dead-locked by any reason halting it will not cause any effect.
|
java.lang.String |
lastError() |
void |
registerCallback(WorkerThreadCallback oNewCallback)
Register a thread callback object
|
void |
run()
Process atoms obtained through AtomConsumer
Each worker WorkerThread will enter an endless loop until the queue is empty
or an interrupt signal is received.
|
void |
setConsumer(AtomConsumer oAtomConsumer) |
boolean |
unregisterCallback(java.lang.String sCallbackName)
Unregister a thread callback object
|
activeCount, checkAccess, 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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public WorkerThread(WorkerThreadPool oThreadPool, AtomConsumer oAtomConsumer)
oThreadPool
- oAtomConsumer
- public int getDelayMS()
public void getDelayMS(int iMiliseconds)
public long getRunningTimeMS()
public AtomConsumer getConsumer()
public void setConsumer(AtomConsumer oAtomConsumer)
public java.lang.String getProperty(java.lang.String sKey)
sKey
- Property Namepublic Atom activeAtom()
public Job activeJob()
public java.lang.String lastError()
public void registerCallback(WorkerThreadCallback oNewCallback) throws java.lang.IllegalArgumentException
oNewCallback
- WorkerThreadCallback subclass instancejava.lang.IllegalArgumentException
- If a callback with same name has oNewCallback was already registeredpublic boolean unregisterCallback(java.lang.String sCallbackName)
sCallbackName
- Name of callback to be unregisteredpublic void run()
Process atoms obtained through AtomConsumer
Each worker WorkerThread will enter an endless loop until the queue is empty or an interrupt signal is received.run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void halt()
Halt thread execution commiting all operations in course before stopping
If a thread is dead-locked by any reason halting it will not cause any effect.