@ManagedResource(objectName="org.red5.server:name=schedulingService,type=QuartzSchedulingService") public class QuartzSchedulingService extends Object implements ISchedulingService, QuartzSchedulingServiceMXBean, InitializingBean, DisposableBean
| Modifier and Type | Class and Description |
|---|---|
protected class |
QuartzSchedulingService.ScheduledJobKey |
| Modifier and Type | Field and Description |
|---|---|
protected String |
configFile
Quartz configuration properties file
|
protected org.quartz.SchedulerFactory |
factory
Creates schedulers.
|
protected String |
instanceId
Instance id
|
protected AtomicLong |
jobDetailCounter
Number of job details
|
protected JobDetailFactoryBean |
jobDetailfactory
Creates job detail.
|
protected ConcurrentMap<String,QuartzSchedulingService.ScheduledJobKey> |
keyMap
Storage for job and trigger keys
|
protected org.quartz.Scheduler |
scheduler
Service scheduler
|
protected String |
threadCount
Default thread count
|
protected SimpleTriggerFactoryBean |
triggerfactory
Creates triggers.
|
BEAN_NAME| Constructor and Description |
|---|
QuartzSchedulingService() |
| Modifier and Type | Method and Description |
|---|---|
String |
addScheduledJob(int interval,
IScheduledJob job)
Schedule a job for periodic execution.
|
String |
addScheduledJobAfterDelay(int interval,
IScheduledJob job,
int delay)
Schedule a job for periodic execution which will start after the specifed delay.
|
String |
addScheduledOnceJob(Date date,
IScheduledJob job)
Schedule a job for single execution at a given date.
|
String |
addScheduledOnceJob(long timeDelta,
IScheduledJob job)
Schedule a job for single execution in the future.
|
void |
afterPropertiesSet()
Constructs a new QuartzSchedulingService.
|
void |
destroy() |
String |
getConfigFile() |
String |
getJobName()
Getter for job name.
|
List<String> |
getScheduledJobNames()
Return names of scheduled jobs.
|
String |
getThreadCount() |
void |
pauseScheduledJob(String name)
Pauses the trigger which initiates job execution.
|
void |
pauseScheduledTrigger(String name) |
void |
removeScheduledJob(String name)
Stop executing a previously scheduled job.
|
void |
resumeScheduledJob(String name)
Resumes the trigger which initiates job execution.
|
void |
resumeScheduledTrigger(String name) |
void |
setConfigFile(String configFile) |
void |
setFactory(org.quartz.SchedulerFactory factory) |
void |
setInstanceId(String instanceId) |
void |
setThreadCount(String threadCount) |
protected String configFile
protected AtomicLong jobDetailCounter
protected org.quartz.SchedulerFactory factory
protected JobDetailFactoryBean jobDetailfactory
protected SimpleTriggerFactoryBean triggerfactory
protected org.quartz.Scheduler scheduler
protected String instanceId
protected String threadCount
protected ConcurrentMap<String,QuartzSchedulingService.ScheduledJobKey> keyMap
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void setFactory(org.quartz.SchedulerFactory factory)
public void setInstanceId(String instanceId)
public String getConfigFile()
public void setConfigFile(String configFile)
public String getThreadCount()
public void setThreadCount(String threadCount)
threadCount - the threadCount to setpublic String addScheduledJob(int interval, IScheduledJob job)
addScheduledJob in interface ISchedulingServiceinterval - time in milliseconds between two notifications of the jobjob - the job to trigger periodicallypublic String addScheduledOnceJob(Date date, IScheduledJob job)
addScheduledOnceJob in interface ISchedulingServicedate - date when the job should be executedjob - the job to triggerpublic String addScheduledOnceJob(long timeDelta, IScheduledJob job)
addScheduledOnceJob in interface ISchedulingServicetimeDelta - time delta in milliseconds from the current datejob - the job to triggerpublic String addScheduledJobAfterDelay(int interval, IScheduledJob job, int delay)
addScheduledJobAfterDelay in interface ISchedulingServiceinterval - time in milliseconds between two notifications of the jobjob - the job to trigger periodicallydelay - time in milliseconds to pass before first execution.public String getJobName()
getJobName in interface QuartzSchedulingServiceMXBeanpublic List<String> getScheduledJobNames()
getScheduledJobNames in interface ISchedulingServicegetScheduledJobNames in interface QuartzSchedulingServiceMXBeanpublic void pauseScheduledJob(String name)
pauseScheduledJob in interface ISchedulingServicename - name of the job to stoppublic void resumeScheduledJob(String name)
resumeScheduledJob in interface ISchedulingServicename - name of the job to stoppublic void pauseScheduledTrigger(String name)
public void resumeScheduledTrigger(String name)
public void removeScheduledJob(String name)
removeScheduledJob in interface ISchedulingServiceremoveScheduledJob in interface QuartzSchedulingServiceMXBeanname - name of the job to stoppublic void destroy()
throws Exception
destroy in interface DisposableBeanExceptionCopyright © 2005–2017 Red5. All rights reserved.