public class SingleThreadExecutor
extends java.lang.Thread
Single Thread Scheduler Executor
SingleThreadExecutor is a class that processes jobs and atoms in a simple way, unlike SchedulerDaemon witch is based on an AtomQueue and a WorkerThreadPool, SingleThreadExecutor uses directly the database for tracking execution progress for a single thread.
Constructor and Description |
---|
SingleThreadExecutor(DBBind oDbb,
java.lang.String sJobId)
Create new SingleThreadExecutor for a single Job
|
SingleThreadExecutor(java.util.Properties oProps,
java.lang.String sJobId)
Create new SingleThreadExecutor for a single Job
|
SingleThreadExecutor(java.lang.String sPropertiesFilePath)
Create new SingleThreadExecutor
|
SingleThreadExecutor(java.lang.String sPropertiesFilePath,
java.lang.String sJobId)
Create new SingleThreadExecutor for a single Job
|
Modifier and Type | Method and Description |
---|---|
Atom |
activeAtom() |
Job |
activeJob() |
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() |
static void |
main(java.lang.String[] argv) |
void |
registerCallback(WorkerThreadCallback oNewCallback)
Register a thread callback object
|
void |
run() |
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 SingleThreadExecutor(java.lang.String sPropertiesFilePath) throws java.io.FileNotFoundException, java.io.IOException
Create new SingleThreadExecutor
sPropertiesFilePath
- Absolute path to hipergate.cnf properties filejava.io.FileNotFoundException
java.io.IOException
public SingleThreadExecutor(java.lang.String sPropertiesFilePath, java.lang.String sJobId) throws java.io.FileNotFoundException, java.io.IOException
Create new SingleThreadExecutor for a single Job
sPropertiesFilePath
- Absolute path to hipergate.cnf properties filesJobId
- GUID of Job for which to process atoms,
if null the executor will process atoms for all pending jobsjava.io.FileNotFoundException
java.io.IOException
public SingleThreadExecutor(java.util.Properties oProps, java.lang.String sJobId)
Create new SingleThreadExecutor for a single Job
oProps
- Environment properties (usually taken from hipergate.cnf)sJobId
- GUID of Job for which to process atoms,
if null the executor will process atoms for all pending jobspublic SingleThreadExecutor(DBBind oDbb, java.lang.String sJobId)
Create new SingleThreadExecutor for a single Job
oDbb
- DBBind used for accesing the satabasesJobId
- GUID of Job for which to process atoms,
if null the executor will process atoms for all pending jobspublic 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()
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.public static void main(java.lang.String[] argv) throws java.io.FileNotFoundException, java.io.IOException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, org.xml.sax.SAXException
java.io.FileNotFoundException
java.io.IOException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
org.xml.sax.SAXException