List of usage examples for java.util TimerTask toString
public String toString()
From source file:org.openadaptor.core.adaptor.AdaptorRunConfiguration.java
private void scheduleTask(Adaptor adaptor, long delayMs, TimerTask task) { if (timer == null) { timer = new Timer(); }/*w ww . ja v a2 s . c om*/ log.info("scheduled " + task.toString() + " for " + delayMs + "ms time"); timer.schedule(task, delayMs); }
From source file:org.openadaptor.core.adaptor.AdaptorRunConfiguration.java
private Date scheduleTask(Adaptor adaptor, String cronExpression, TimerTask task, Date currentTime) { try {/*ww w . jav a2 s . c o m*/ if (timer == null) { timer = new Timer(); } CronExpression cron = new CronExpression(cronExpression); Date time = cron.getTimeAfter(currentTime == null ? new Date() : currentTime); log.info("scheduled " + task.toString() + " for " + time); timer.schedule(task, time); return time; } catch (Exception e) { throw new RuntimeException("failed to schedule task", e); } }