Package org.jbpm.cal

Examples of org.jbpm.cal.Duration$DaySetter


    // we prepare the JobExecutor notification
    long delay = 0;
    if (timer.getRepeat() != null) {
      BusinessCalendar businessCalendar = new BusinessCalendar();
      Duration duration = new Duration(timer.getRepeat());
      delay = businessCalendar.add(new Date(0), duration).getTime();
    }

    toBeScheduledTimers.put(timer.getDbid(),
        new NotificationInfo(timer.getEligibleDate(), delay));
View Full Code Here


    Collection<Timer> timers =
      Environment.getCurrent().get(JobSession.class)
      .findAllTimers();
    BusinessCalendar businessCalendar = new BusinessCalendar();
    for (Timer timer : timers) {
      Duration duration = new Duration(timer.getRepeat());
      long delay = businessCalendar.add(new Date(0), duration).getTime();
      NotificationInfo notificationInfo =
        new NotificationInfo(timer.getEligibleDate(), delay);

      toBeScheduledTimers.put(timer.getDbid(), notificationInfo);
View Full Code Here

    ExecutionTask task = new ExecutionTask(timer);

    long repeatDelay = 0;
    if (timer.getRepeat() != null) {
      BusinessCalendar businessCalendar = new BusinessCalendar();
      Duration duration = new Duration(timer.getRepeat());
      repeatDelay = businessCalendar.add(new Date(0), duration).getTime();
    }
    try {
      Date eligibleDate = timer.getEligibleDate();
      if (repeatDelay > 0) {
View Full Code Here

      // suppose that it took the timer runner thread a
      // very long time to execute the timers.
      // then the repeat action eligibleDate could already have passed.
      while (eligibleDate.getTime() <= System.currentTimeMillis()) {
        eligibleDate =
          businessCalendar.add(eligibleDate, new Duration(repeat));
      }
      // same for the dueDate which should be after the eligibleDate
      while (dueDate.getTime() <= eligibleDate.getTime()) {
        dueDate = businessCalendar.add(dueDate, new Duration(repeat));
      }
      log.finest("updated timer '"+this+"' for repetition in '"+
          (eligibleDate.getTime()-System.currentTimeMillis())+"' millis" +
          " with due date in " +
          (dueDate.getTime()-System.currentTimeMillis())+"' millis");
View Full Code Here

TOP

Related Classes of org.jbpm.cal.Duration$DaySetter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.