1 package org.oddjob.schedules; 2 3 import java.io.Serializable ; 4 5 import org.oddjob.arooa.ArooaConstants; 6 import org.oddjob.arooa.ArooaContext; 7 import org.oddjob.arooa.ArooaHandler; 8 import org.oddjob.arooa.handlers.ValueHandler; 9 10 11 40 public class ScheduleElement implements Serializable , RefineableSchedule { 41 private static final long serialVersionUID = 20051123; 42 43 48 private ScheduleList schedules = new ScheduleList(); 49 50 58 public ArooaHandler handlerFor(ArooaContext context) { 59 ValueHandler handler = new ValueHandler("schedule"); 61 handler.setValueFactory(new ScheduleFactory()); 62 context.set(ArooaConstants.ELEMENT_HANDLER, handler); 63 return handler; 64 } 65 66 70 public void setLimits(Interval limits) { 71 schedules.setLimits(limits); 72 } 73 74 78 public void addValueSchedule(Schedule schedule) { 79 schedules.addValueSchedule(schedule); 80 } 81 82 86 public Interval nextDue(ScheduleContext context) { 87 return schedules.nextDue(context); 88 } 89 90 93 public String toString() { 94 return schedules.toString(); 95 } 96 } 97 | Popular Tags |