Package org.jobrunr.configuration
Class JobRunr
- java.lang.Object
-
- org.jobrunr.configuration.JobRunr
-
public class JobRunr extends java.lang.Object
This class provides the entry point for the JobRunr configuration. This is needed when you want to use the static methods onBackgroundJob
to enqueue and schedule jobs. It also allows to startup the Dashboard which will be available on port 8000.An example:
JobRunr.configure() .useJobStorageProvider(jobStorageProvider) .useJobActivator(jobActivator) .useDefaultBackgroundJobServer() .useJmxExtensions() .useDashboard() .initialize();
Both the backgroundJobServer and the dashboard fluent API allow to be enabled or disabled using ENV variables which is handy in docker containers.An example:
boolean isBackgroundJobServerEnabled = true; // or get it via ENV variables boolean isDashboardEnabled = true; // or get it via ENV variables JobRunr.configure() .useJobStorageProvider(jobStorageProvider) .useJobActivator(jobActivator) .useDefaultBackgroundJobServerIf(isBackgroundJobServerEnabled) .useDashboardIf(isDashboardEnabled) .useJmxExtensions() .initialize();
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JobRunrConfiguration
configure()
static JobRunrConfiguration
destroy()
-
-
-
Method Detail
-
configure
public static JobRunrConfiguration configure()
-
destroy
public static JobRunrConfiguration destroy()
-
-