1 /* 2 * (c) Rob Gordon 2005 3 */ 4 package org.oddjob.quartz; 5 6 import org.oddjob.arooa.registry.ComponentRegistry; 7 import org.quartz.Scheduler; 8 import org.quartz.SchedulerException; 9 10 11 /** 12 * Implementations of this interface are able to be scheduled with 13 * {@link org.oddjob.scheduling.ScheduleJob} 14 * 15 * @author Rob Gordon. 16 */ 17 public interface QuartzSchedule { 18 19 /** 20 * Provide the name of the Schedule. 21 * @return The name. 22 */ 23 public String getName(); 24 25 /** 26 * The Scheduler will call this method to allow this schedule to 27 * schedule itself useing the scheduler. 28 * 29 * @param scheduler The scheduler. 30 * @throws SchedulerException If the schedule can't be scheduled. 31 */ 32 public void scheduleWith(Scheduler scheduler) throws SchedulerException; 33 34 /** 35 * The schedule will call this method to stop scheduling a schedule. 36 * 37 * @param scheduler The scheduler. 38 * @throws SchedulerException If the schedule can't be unscheduled. 39 */ 40 public void unscheduleFrom(Scheduler scheduler) throws SchedulerException; 41 42 /** 43 * 44 * @param componentRegistry 45 */ 46 public void setComponentRegistry(ComponentRegistry componentRegistry); 47 48 /** 49 * Destroy this schedule. Implementations should use this method to 50 * free up any resources used. 51 * 52 */ 53 public void destroy(); 54 55 }