public void setCronExpression(CronExpression cronExpression) { TimeZone origTz = getTimeZone(); this.cronEx = cronExpression; this.cronEx.setTimeZone( origTz ); }
public Trigger createTrigger(long timestamp, String[] calendarNames, Calendars calendars) { return new IntervalTrigger( timestamp, this.startTime, this.endTime, this.repeatLimit, 0, 0, calendarNames, calendars ); }
public Trigger createTrigger(long timestamp, String[] calendarNames, Calendars calendars) { return new CronTrigger( timestamp, this.startTime, this.endTime, this.repeatLimit, this.cronExpression, calendarNames, calendars ); }
public Trigger createTrigger( long timestamp, // current time String[] calendarNames, Calendars calendars ) { if ( this.durations == null ) { throw new IllegalStateException( "CompositeMaxDurationTimer cannot have no durations" ); } Date maxDurationDate = new Date( getMaxDuration() + timestamp ); return new CompositeMaxDurationTrigger( maxDurationDate, timer != null ? timer.createTrigger( timestamp, calendarNames, calendars ) : null, calendarNames, calendars ); }
public boolean removeJob(JobHandle jobHandle) { jobHandle.setCancel( true ); jobFactoryManager.removeTimerJobInstance( ((JDKJobHandle) jobHandle).getTimerJobInstance() ); return this.scheduler.remove( (Runnable) ((JDKJobHandle) jobHandle).getFuture() ); }
public PseudoClockScheduler createInstance() { return new PseudoClockScheduler(); } };
public JDKTimerService createInstance() { return new JDKTimerService(); } },
public void setCronExpression(String cronExpression) { setCronExpression( determineCronExpression( cronExpression ) ); }
/** * @inheritDoc * * @see org.drools.time.TimerService#removeJob(org.drools.time.JobHandle) */ public boolean removeJob(JobHandle jobHandle) { jobHandle.setCancel( true ); jobFactoryManager.removeTimerJobInstance( ((DefaultJobHandle) jobHandle).getTimerJobInstance() ); synchronized( queue ) { return this.queue.remove( (Callable<Void>) ((DefaultJobHandle) jobHandle).getTimerJobInstance() ); } }
public boolean isPendingReactivation() { DefaultJobHandle timeHandle = (DefaultJobHandle) getJobHandle(); Trigger trig = timeHandle.getTimerJobInstance().getTrigger(); return trig.hasNextFireTime() != null && trig instanceof CronTrigger; } }
/** * Returns the next date/time <I>after</I> the given date/time which * satisfies the cron expression. * * @param date the date/time at which to begin the search for the next valid * date/time * @return the next valid date/time */ public Date getNextValidTimeAfter(Date date) { return getTimeAfter(date); }
public Collection<TimerJobInstance> getTimerJobInstances() { return jobFactoryManager.getTimerJobInstances(); }
public Object getJob() { return timerJobInstance != null ? timerJobInstance.getJob() : null; }
public TimerJobFactoryManager createInstance() { return new TrackableTimeJobFactoryManager(); } },
/** * Indicates whether the specified cron expression can be parsed into a * valid cron expression * * @param cronExpression the expression to evaluate * @return a boolean indicating whether the given expression is a valid cron * expression */ public static boolean isValidExpression(String cronExpression) { try { new CronExpression(cronExpression); } catch (ParseException pe) { return false; } return true; }
public CronTrigger(long timestamp, Date startTime, Date endTime, int repeatLimit, String cronExpression, String[] calendarNames, Calendars calendars) { this( timestamp, startTime, endTime, repeatLimit, determineCronExpression( cronExpression ), calendarNames, calendars ); }
public static TimerService getTimerService( SessionConfiguration config ) { switch( config.getClockType() ) { case REALTIME_CLOCK: return config.newTimerService(); case PSEUDO_CLOCK: return new PseudoClockScheduler(); } return null; } }
public Trigger createTrigger(long timestamp, String[] calendarNames, Calendars calendars) { return new IntervalTrigger( timestamp, this.startTime, this.endTime, this.repeatLimit, this.delay, this.period, calendarNames, calendars ); }
protected Date getTimeAfter(Date afterTime) { this.repeatCount++; return (this.cronEx == null) ? null : this.cronEx.getTimeAfter( afterTime ); }
public Collection<TimerJobInstance> getTimerJobInstances() { return jobFactoryManager.getTimerJobInstances(); }