org.red5.server.scheduling
Class QuartzSchedulingService

java.lang.Object
  extended by org.red5.server.scheduling.QuartzSchedulingService
All Implemented Interfaces:
IScopeService, ISchedulingService, QuartzSchedulingServiceMBean

public class QuartzSchedulingService
extends Object
implements ISchedulingService, QuartzSchedulingServiceMBean

Scheduling service that uses Quartz as backend.

Author:
The Red5 Project (red5@osflash.org), Joachim Bauch (jojo@struktur.de)

Field Summary
 
Fields inherited from interface org.red5.server.api.scheduling.ISchedulingService
BEAN_NAME
 
Constructor Summary
QuartzSchedulingService()
          Constructs a new QuartzSchedulingService.
 
Method Summary
 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.
 String getJobName()
          Getter for job name.
 List<String> getScheduledJobNames()
          Return names of scheduled jobs.
 void removeScheduledJob(String name)
          Stop executing a previously scheduled job.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuartzSchedulingService

public QuartzSchedulingService()
Constructs a new QuartzSchedulingService.

Method Detail

addScheduledJob

public String addScheduledJob(int interval,
                              IScheduledJob job)
Schedule a job for periodic execution.

Specified by:
addScheduledJob in interface ISchedulingService
Parameters:
interval - time in milliseconds between two notifications of the job
job - the job to trigger periodically
Returns:
the name of the scheduled job

addScheduledOnceJob

public String addScheduledOnceJob(Date date,
                                  IScheduledJob job)
Schedule a job for single execution at a given date. Please note that the jobs are not saved if Red5 is restarted in the meantime.

Specified by:
addScheduledOnceJob in interface ISchedulingService
Parameters:
date - date when the job should be executed
job - the job to trigger
Returns:
the name of the scheduled job

addScheduledOnceJob

public String addScheduledOnceJob(long timeDelta,
                                  IScheduledJob job)
Schedule a job for single execution in the future. Please note that the jobs are not saved if Red5 is restarted in the meantime.

Specified by:
addScheduledOnceJob in interface ISchedulingService
Parameters:
timeDelta - time delta in milliseconds from the current date
job - the job to trigger
Returns:
the name of the scheduled job

addScheduledJobAfterDelay

public String addScheduledJobAfterDelay(int interval,
                                        IScheduledJob job,
                                        int delay)
Schedule a job for periodic execution which will start after the specifed delay.

Specified by:
addScheduledJobAfterDelay in interface ISchedulingService
Parameters:
interval - time in milliseconds between two notifications of the job
job - the job to trigger periodically
delay - time in milliseconds to pass before first execution.
Returns:
the name of the scheduled job

getJobName

public String getJobName()
Getter for job name.

Specified by:
getJobName in interface QuartzSchedulingServiceMBean
Returns:
Job name

getScheduledJobNames

public List<String> getScheduledJobNames()
Return names of scheduled jobs.

Specified by:
getScheduledJobNames in interface ISchedulingService
Specified by:
getScheduledJobNames in interface QuartzSchedulingServiceMBean
Returns:
list of job names

removeScheduledJob

public void removeScheduledJob(String name)
Stop executing a previously scheduled job.

Specified by:
removeScheduledJob in interface ISchedulingService
Specified by:
removeScheduledJob in interface QuartzSchedulingServiceMBean
Parameters:
name - name of the job to stop

shutdown

public void shutdown()
              throws SchedulerException
Throws:
SchedulerException


Copyright © 2006-2007 the Red5 project.