public class SchedulerDaemon
extends java.lang.Thread
Scheduler daemon
Keeps a thread pool and an atom queue for feeding the pool.
Constructor and Description |
---|
SchedulerDaemon(java.lang.String sPropertiesFilePath)
Create new SchedulerDaemon
|
Modifier and Type | Method and Description |
---|---|
void |
abortJob(java.lang.String sGuJob)
Abort a given Job
|
AtomQueue |
atomQueue() |
java.util.Date |
creationDate()
Get date when this SchedulerDaemon was created
|
DBBind |
databaseBind() |
void |
haltAll()
Halt worker threads and set running jobs status to suspended
Wait until all running atoms are finished and then stop all worker threads
|
static void |
main(java.lang.String[] argv) |
void |
registerCallback(WorkerThreadCallback oNewCallback) |
void |
run()
Create AtomQueue and start WorkerThreadPool
|
java.util.Date |
startDate()
Get date when this SchedulerDaemon was started for the last time
|
void |
stopAll()
Stop worker threads and set running jobs status to interrupted
Default delay for forcing threads to stop is 10 seconds
|
void |
stopAll(long lDelayMilis)
Stop worker threads and set running jobs status to interrupted
Call haltAll() Wait until the specified amount of miliseconds
and force all worker threads still alive to stop.
|
java.util.Date |
stopDate()
Get date when this SchedulerDaemon was stopped for the last time
|
WorkerThreadPool |
threadPool() |
void |
unregisterCallback(java.lang.String sCallbackName) |
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 SchedulerDaemon(java.lang.String sPropertiesFilePath) throws java.lang.ClassNotFoundException, java.io.FileNotFoundException, java.io.IOException, java.sql.SQLException
Create new SchedulerDaemon
sPropertiesFilePath
- Full path to hipergate.cnf file.java.lang.ClassNotFoundException
java.io.FileNotFoundException
java.io.IOException
java.sql.SQLException
public java.util.Date creationDate()
public java.util.Date startDate()
public java.util.Date stopDate()
public AtomQueue atomQueue()
public WorkerThreadPool threadPool()
public DBBind databaseBind()
public void run()
Create AtomQueue and start WorkerThreadPool
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void registerCallback(WorkerThreadCallback oNewCallback) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void unregisterCallback(java.lang.String sCallbackName)
public void abortJob(java.lang.String sGuJob) throws java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.io.FileNotFoundException
Abort a given Job
sGuJob
- GUID of Job to be abortedSQLException,
- ClassNotFoundExceptionjava.sql.SQLException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.io.FileNotFoundException
public void haltAll() throws java.lang.IllegalStateException
Halt worker threads and set running jobs status to suspended
Wait until all running atoms are finished and then stop all worker threadsjava.lang.IllegalStateException
- If worker threads are not runningpublic void stopAll(long lDelayMilis) throws java.lang.IllegalStateException, java.sql.SQLException
Stop worker threads and set running jobs status to interrupted
Call haltAll() Wait until the specified amount of miliseconds and force all worker threads still alive to stop. This method must only be used when stalled worker threads cannot be stopped by calling haltAll().lDelayMilis
- long Delay (in miliseconds) to wait before executing
threads are forced to stopjava.lang.IllegalStateException
- If worker threads are not runningjava.sql.SQLException
public void stopAll() throws java.lang.IllegalStateException, java.sql.SQLException
Stop worker threads and set running jobs status to interrupted
Default delay for forcing threads to stop is 10 secondsjava.lang.IllegalStateException
- If worker threads are not runningjava.sql.SQLException
public static void main(java.lang.String[] argv) throws java.lang.ClassNotFoundException, java.sql.SQLException, java.io.IOException
java.lang.ClassNotFoundException
java.sql.SQLException
java.io.IOException