public abstract class JobScheduler extends Object
JobScheduler
.JobSchedule
,
JobScheduleConfig
Modifier and Type | Field and Description |
---|---|
static String |
CALENDAR
Feature name for calendar-based job schedule.
|
static String[] |
EMPTY_STRING_ARRAY
Convenience empty string array.
|
protected static String |
MANAGED_EXECUTOR_SERVICE_LOOKUP
Lookup name for the managed scheduled executor service.
|
static String |
PERSISTENT
Feature name for persistent job schedule.
|
protected static String |
TIMER_SCHEDULER_LOOKUP
Lookup name for EJB-Timer-based job scheduler implementation.
|
protected static TimeUnit |
timeUnit
Time unit for job schedule.
|
Modifier | Constructor and Description |
---|---|
protected |
JobScheduler()
Default no-arg constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
cancel(String scheduleId)
Cancels a job schedule by its id.
|
void |
delete(String scheduleId)
Deletes a job schedule by its id.
|
String[] |
getFeatures()
Gets the features supported by the current job scheduler.
|
static javax.batch.operations.JobOperator |
getJobOperator()
Convenience method for getting
JobOperator . |
abstract JobSchedule |
getJobSchedule(String scheduleId)
Gets the job schedule by its id.
|
static JobScheduler |
getJobScheduler()
Gets the job scheduler without passing any parameters.
|
static JobScheduler |
getJobScheduler(Class<? extends JobScheduler> schedulerType,
ConcurrentMap<String,JobSchedule> schedules,
String managedScheduledExecutorServiceLookup)
Gets the job scheduler, specifying scheduler type,
ConcurrentMap<String, JobSchedule> for storing all job schedules, and the lookup
name of ManagedScheduledExecutorService resource. |
abstract List<JobSchedule> |
getJobSchedules()
Gets all job schedules known to the scheduler.
|
abstract JobSchedule |
schedule(JobScheduleConfig scheduleConfig)
submits a job schedule specified with the job schedule config.
|
public static final String[] EMPTY_STRING_ARRAY
public static final String PERSISTENT
public static final String CALENDAR
protected static final TimeUnit timeUnit
protected static final String TIMER_SCHEDULER_LOOKUP
protected static final String MANAGED_EXECUTOR_SERVICE_LOOKUP
public static JobScheduler getJobScheduler()
getJobScheduler(Class, ConcurrentMap, String)
public static JobScheduler getJobScheduler(Class<? extends JobScheduler> schedulerType, ConcurrentMap<String,JobSchedule> schedules, String managedScheduledExecutorServiceLookup)
ConcurrentMap<String, JobSchedule>
for storing all job schedules, and the lookup
name of ManagedScheduledExecutorService
resource.
This method determines which type of job scheduler to use as follows:
schedulerType
is specified, instantiate the specified type.
managedScheduledExecutorServiceLookup
succeeds,
creates ExecutorSchedulerImpl
with the executor from that lookup.
ExecutorSchedulerImpl
with the executor from that lookup.
ExecutorSchedulerImpl
.
schedulerType
- fully-qualified class name of job scheduler typeschedules
- ConcurrentMap<String, JobSchedule>
for storing all job schedulesmanagedScheduledExecutorServiceLookup
- lookup name of ManagedScheduledExecutorService
resourcepublic static javax.batch.operations.JobOperator getJobOperator()
JobOperator
.JobOperator
public String[] getFeatures()
EMPTY_STRING_ARRAY
,
PERSISTENT
,
CALENDAR
public void delete(String scheduleId)
cancel(String)
method.scheduleId
- the schedule id to deletepublic abstract JobSchedule schedule(JobScheduleConfig scheduleConfig)
scheduleConfig
- job schedule configpublic abstract List<JobSchedule> getJobSchedules()
public abstract boolean cancel(String scheduleId)
scheduleId
- the schedule id to cancelpublic abstract JobSchedule getJobSchedule(String scheduleId)
scheduleId
- id of the job schedule to retrieveCopyright © 2018 JBoss by Red Hat. All rights reserved.