public class JobCoordinator extends Thread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier and Type | Method and Description |
---|---|
List<JobHealthInfo> |
buildJobHealthInfos()
Get a list of the health of all jobs.
|
void |
executeJobsForCurrentTime(ZonedDateTime now)
This really should not be a public method, but needs to be so unittests can access it.
|
void |
forceRunJob(String jobName,
boolean forceEvenIfLocked) |
JobDefinition |
getJobDefinition(String name) |
static void |
initForTesting()
Creates an instance, but does not start it.
|
static JobCoordinator |
instance() |
void |
registerJob(JobDefinition job)
Register the given job definition to be run as a recurring class
|
void |
registerJobForTest(JobDefinition job,
ZonedDateTime now)
Called by unittests to load the job, with dateTime passed in
to override the current time
|
void |
run() |
static void |
shutdown() |
static void |
startUp() |
activeCount, checkAccess, clone, 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 static JobCoordinator instance()
public static void startUp()
public static void initForTesting()
public static void shutdown()
public void executeJobsForCurrentTime(ZonedDateTime now) throws ClassNotFoundException, IllegalAccessException, InstantiationException
now
- ClassNotFoundException
IllegalAccessException
InstantiationException
public void forceRunJob(String jobName, boolean forceEvenIfLocked)
public void registerJob(JobDefinition job)
job
- public void registerJobForTest(JobDefinition job, ZonedDateTime now)
job
- now
- public JobDefinition getJobDefinition(String name)
public List<JobHealthInfo> buildJobHealthInfos()
Copyright © 2016. All rights reserved.