protected void setString(final AutoTimer timer, final String value) { timer.getScheduleExpression().minute(value); } },
@PostConstruct public void initialize() { ScheduleExpression scheduleExpression = new ScheduleExpression() .hour("*") .minute("*") .second("*/5"); TimerConfig timerConfig = new TimerConfig(); timerConfig.setInfo("Every 5 second timer"); timerService.createCalendarTimer(scheduleExpression, timerConfig); }
public ScheduleExpression getScheduleExpression() { if (this.scheduleExpression == null) { this.scheduleExpression = new ScheduleExpression(); this.scheduleExpression.second(this.scheduleExprSecond).minute(this.scheduleExprMinute).hour(this.scheduleExprHour).dayOfWeek(this.scheduleExprDayOfWeek) .dayOfMonth(this.scheduleExprDayOfMonth).month(this.scheduleExprMonth).year(this.scheduleExprYear).timezone(this.scheduleExprTimezone) .start(this.scheduleExprStartDate).end(this.scheduleExprEndDate); } return scheduleExpression; }
s.minute(builder.scheduleExprMinute); s.hour(builder.scheduleExprHour); s.dayOfWeek(builder.scheduleExprDayOfWeek);
private ScheduleExpression clone(ScheduleExpression schedule) { // clone the schedule ScheduleExpression clonedSchedule = new ScheduleExpression(); clonedSchedule.second(schedule.getSecond()); clonedSchedule.minute(schedule.getMinute()); clonedSchedule.hour(schedule.getHour()); clonedSchedule.dayOfWeek(schedule.getDayOfWeek()); clonedSchedule.dayOfMonth(schedule.getDayOfMonth()); clonedSchedule.month(schedule.getMonth()); clonedSchedule.year(schedule.getYear()); clonedSchedule.timezone(schedule.getTimezone()); clonedSchedule.start(schedule.getStart()); clonedSchedule.end(schedule.getEnd()); return clonedSchedule; }
scheduleExpression.dayOfWeek(schedule.getDayOfWeek()); scheduleExpression.hour(schedule.getHour()); scheduleExpression.minute(schedule.getMinute()); scheduleExpression.month(schedule.getMonth()); scheduleExpression.second(schedule.getSecond());
public ScheduleExpression minute(int minute) { return minute(Integer.toString(minute)); }
protected void setString(final AutoTimer timer, final String value) { timer.getScheduleExpression().minute(value); } },
ScheduleExpression schedule = new ScheduleExpression(); schedule.hour(hourProperty);//previously read property from .properties file schedule.minute(minuteProperty);//previously read property from .properties file Timer timer = timerService.createCalendarTimer(schedule);
@Singleton @Startup public class ProgrammaticTimer { @Resource TimerService timerService; public void createTimer(String timerId, int frec){ ScheduleExpression expression = new ScheduleExpression(); expression.minute("*/"+freq).hour("*"); timerService.createCalendarTimer(expression, new TimerConfig(timerId, true)); } @Timeout public void execute(){ System.out.println("----Invoked: " + System.currentTimeMillis()); } }
@PostConstruct public void init() { timerService.createCalendarTimer(new ScheduleExpression().second("*/1") .minute("*").hour("*")); }
synchronized public void startTimer() { ScheduleExpression schedule = new ScheduleExpression(); if (null == timezone) { log.warning("Timezone not set, using default: America/Sao_Paulo"); schedule.timezone("America/Sao_Paulo"); } else { schedule.timezone(timezone); } schedule.hour("23"); schedule.minute("00"); timerService.createCalendarTimer(schedule); }
@PostConstruct public void configure() { if (DeploymentSynchronizer.DEPLOY_SYNC_ENABLED) { ScheduleExpression schedule = new ScheduleExpression(); schedule.hour("*"); schedule.minute("*"); schedule.second("*/" + DeploymentSynchronizer.DEPLOY_SYNC_INTERVAL); timer = timerService.createCalendarTimer(schedule, new TimerConfig(null, false)); } }
public void register(final String clientId) { sendMessage(REGISTER_ENDPOINT, applicationConfig.toJSON()); ScheduleExpression schedule = new ScheduleExpression(); schedule.second("*/10").minute("*").hour("*").start(Calendar.getInstance().getTime()); TimerConfig config = new TimerConfig(); config.setPersistent(false); Timer timer = timerService.createCalendarTimer(schedule, config); LOGGER.config(() -> timer.getSchedule().toString()); }
public void register(final String clientId) { sendMessage(REGISTER_ENDPOINT, applicationConfig.toJSON()); ScheduleExpression schedule = new ScheduleExpression(); schedule.second("*/10").minute("*").hour("*").start(Calendar.getInstance().getTime()); TimerConfig config = new TimerConfig(); config.setPersistent(false); Timer timer = timerService.createCalendarTimer(schedule, config); LOGGER.config(() -> timer.getSchedule().toString()); }
@PostConstruct public void configure() { DeploymentStore store = new DeploymentStore(); store.setCommandService(commandService); setDeploymentStore(store); if (DEPLOY_SYNC_ENABLED) { ScheduleExpression schedule = new ScheduleExpression(); schedule.hour("*"); schedule.minute("*"); schedule.second("*/" + DEPLOY_SYNC_INTERVAL); timer = timerService.createCalendarTimer(schedule, new TimerConfig(null, false)); } }
public ScheduleExpression getScheduleExpression() { return new ScheduleExpression(). second(second_). minute(minute_). hour(hour_). dayOfMonth(dayOfMonth_). month(month_). dayOfWeek(dayOfWeek_). year(year_). timezone(timezone_). start(start_). end(end_); }
public ScheduleExpression getScheduleExpression() { if (this.scheduleExpression == null) { this.scheduleExpression = new ScheduleExpression(); this.scheduleExpression.second(this.scheduleExprSecond).minute(this.scheduleExprMinute).hour(this.scheduleExprHour).dayOfWeek(this.scheduleExprDayOfWeek) .dayOfMonth(this.scheduleExprDayOfMonth).month(this.scheduleExprMonth).year(this.scheduleExprYear).timezone(this.scheduleExprTimezone) .start(this.scheduleExprStartDate).end(this.scheduleExprEndDate); } return scheduleExpression; }
public ScheduleExpression getScheduleExpression() { return new ScheduleExpression(). second(getSecond()). minute(getMinute()). hour(getHour()). dayOfMonth(getDayOfMonth()). month(getMonth()). dayOfWeek(getDayOfWeek()). year(getYear()). timezone(getTimeZoneID()). start(getStart()). end(getEnd()); }
private ScheduleExpression copy(final ScheduleExpression scheduleExpression) { final ScheduleExpression scheduleExpressionCopy = new ScheduleExpression(); scheduleExpressionCopy.year(scheduleExpression.getYear()); scheduleExpressionCopy.month(scheduleExpression.getMonth()); scheduleExpressionCopy.dayOfMonth(scheduleExpression.getDayOfMonth()); scheduleExpressionCopy.dayOfWeek(scheduleExpression.getDayOfWeek()); scheduleExpressionCopy.hour(scheduleExpression.getHour()); scheduleExpressionCopy.minute(scheduleExpression.getMinute()); scheduleExpressionCopy.second(scheduleExpression.getSecond()); scheduleExpressionCopy.start(scheduleExpression.getStart()); scheduleExpressionCopy.end(scheduleExpression.getEnd()); scheduleExpressionCopy.timezone(scheduleExpression.getTimezone()); return scheduleExpressionCopy; }