Examples of ScheduleTimer


Examples of org.jboss.as.ejb3.timerservice.spi.ScheduleTimer

        }
        final List<ScheduleTimer> timers = new ArrayList<ScheduleTimer>();

        for (Map.Entry<Method, List<AutoTimer>> entry : autoTimers.entrySet()) {
            for (AutoTimer timer : entry.getValue()) {
                timers.add(new ScheduleTimer(entry.getKey(), timer.getScheduleExpression(), timer.getTimerConfig()));
            }
        }
        // restore the timers
        restoreTimers(timers);
        started = true;
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.spi.ScheduleTimer

                boolean found = false;
                final CalendarTimerEntity entity = (CalendarTimerEntity) activeTimer.getPersistentState();
                //so we know we have an auto timer. We need to try and match it up with the auto timers.
                ListIterator<ScheduleTimer> it = newAutoTimers.listIterator();
                while (it.hasNext()) {
                    ScheduleTimer timer = it.next();
                    final String methodName = timer.getMethod().getName();
                    final String[] params = new String[timer.getMethod().getParameterTypes().length];
                    for (int i = 0; i < timer.getMethod().getParameterTypes().length; ++i) {
                        params[i] = timer.getMethod().getParameterTypes()[i].getName();
                    }
                    if (doesTimeoutMethodMatch(entity.getTimeoutMethod(), methodName, params)) {

                        //the timers have the same method.
                        //now lets make sure the schedule is the same
                        if (this.doesScheduleMatch(entity.getScheduleExpression(), timer.getScheduleExpression())) {
                            it.remove();
                            found = true;
                            break;
                        }
                    }
                }
                if (!found) {
                    activeTimer.setTimerState(TimerState.CANCELED);
                } else {
                    startTimer(activeTimer);
                    ROOT_LOGGER.debug("Started timer: " + activeTimer);
                }
                this.persistTimer(activeTimer);
            } else if (!ineligibleTimerStates.contains(activeTimer.getState())) {
                this.startTimer(activeTimer);
            }
            ROOT_LOGGER.debug("Started timer: " + activeTimer);
        }

        for (ScheduleTimer timer : newAutoTimers) {
            this.loadAutoTimer(timer.getScheduleExpression(), timer.getTimerConfig(), timer.getMethod());
        }

    }
View Full Code Here

Examples of org.jboss.ejb3.timerservice.spi.ScheduleTimer

        final org.jboss.ejb3.timerservice.api.TimerService timerService = (org.jboss.ejb3.timerservice.api.TimerService) timerServiceFactory.createTimerService(invoker);
        final List<ScheduleTimer> timers = new ArrayList<ScheduleTimer>();

        for(Map.Entry<Method, List<AutoTimer>> entry : autoTimers.entrySet()) {
            for(AutoTimer timer : entry.getValue()) {
                timers.add(new ScheduleTimer(entry.getKey(), timer.getScheduleExpression(), timer.getTimerConfig()));
            }
        }

        timerServiceFactory.restoreTimerService(timerService, timers);
View Full Code Here

Examples of org.jboss.ejb3.timerservice.spi.ScheduleTimer

                boolean found = false;
                final CalendarTimerEntity entity = (CalendarTimerEntity) activeTimer.getPersistentState();
                //so we know we have an auto timer. We need to try and match it up with the auto timers.
                ListIterator<ScheduleTimer> it = newAutoTimers.listIterator();
                while (it.hasNext()) {
                    ScheduleTimer timer = it.next();
                    final String methodName = timer.getMethod().getName();
                    final String[] params = new String[timer.getMethod().getParameterTypes().length];
                    for (int i = 0; i < timer.getMethod().getParameterTypes().length; ++i) {
                        params[i] = timer.getMethod().getParameterTypes()[i].getName();
                    }
                    if (doesTimeoutMethodMatch(entity.getTimeoutMethod(), methodName, params)) {

                        //the timers have the same method.
                        //now lets make sure the schedule is the same
                        if (this.doesScheduleMatch(entity.getScheduleExpression(), timer.getScheduleExpression())) {
                            it.remove();
                            found = true;
                            break;
                        }
                    }
                }
                if (found) {
                    startTimer(activeTimer);
                    logger.debug("Started timer: " + activeTimer);
                    // save any changes to the state (that will have happened on call to startTimer)
                    this.persistTimer(activeTimer);
                } else {
                    //the annotation is no longer there
                    this.removeTimer(activeTimer);
                }
            }
            //TODO: we need to make sure that these only fire one event after being restored
            this.startTimer(activeTimer);
            logger.debug("Started timer: " + activeTimer);
            // save any changes to the state (that will have happened on call to startTimer)
            this.persistTimer(activeTimer);
        }

        for (ScheduleTimer timer : newAutoTimers) {
            this.loadAutoTimer(timer.getScheduleExpression(), timer.getTimerConfig(), timer.getMethod());
        }

    }
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.ScheduleTimer

    clone.getOffsetWidth(); // Force update
    clone.getStyle().setOpacity(0.0);


    // schedule removal of clone from DOM once animation complete
    new ScheduleTimer() {
      @Override
      public void run() {
        clone.removeFromParent();
      }
    }.schedule(DEFAULT_REMOVE_MS);
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.ScheduleTimer

    if (regionNode.getImplNodelet() == null) {
      return;
    }
    regionNode.getImplNodelet().addClassName(resources.css().repaired());
    ScheduleTimer t = new ScheduleTimer() {
      @Override
      public void run() {
        regionNode.getImplNodelet().removeClassName(resources.css().repaired());
      }
    };
    t.schedule(800);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.ScheduleTimer

      submitImmediately();
    } else {
      // No synchronization issues in GWT.
      if (!submitScheduled) {
        submitScheduled = true;
        new ScheduleTimer() {
          @Override
          public void run() {
            submitIfScheduled();
          }
        }.schedule(timeoutMs);
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.ScheduleTimer

   * Registers the Gadget object as RPC event listener with the Gadget RPC
   * Controller after waiting for the Gadget RPC library to load.
   */
  private void scheduleControllerRegistration(
      final String url, final long width, final long height) {
    new ScheduleTimer() {
      private double loadWarningTime =
          Duration.currentTimeMillis() + GADGET_RPC_LOAD_WARNING_TIMEOUT_MS;
      @Override
      public void run() {
        if (!isActive()) {
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.ScheduleTimer

  }

  private void delayedPodiumInitialization() {
    // TODO(user): This is a hack to delay Podium initialization.
    // Define an initialization protocol for Podium to avoid this.
    new ScheduleTimer() {
      @Override
      public void run() {
        initializePodium();
      }
    }.schedule(3000);
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.ScheduleTimer

      }
    }.schedule(3000);
  }

  private void removeFrameBorder() {
    new ScheduleTimer() {
      @Override
      public void run() {
        ui.removeThrobber();
      }
    }.schedule(FRAME_BORDER_REMOVE_DELAY_MS);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.