Examples of TimerTask


Examples of java.util.TimerTask

  protected abstract void throwInterruptedException()
    throws StoreException;

  private void startTimer(long timeLimit) {
    TimerTask tt = new TimerTask() {

      @Override
      public void run() {
        interrupt();
      }
View Full Code Here

Examples of java.util.TimerTask

        if (syncTimerTask != null) {
          logger.error("syncTimerTask is not null");
        }

        syncTimerTask = new TimerTask() {

          @Override
          public void run() {
            try {
              // Acquire read lock to guarantee that the statement list
View Full Code Here

Examples of java.util.TimerTask

  }

  // ÿ�����ϰ�ҹʱ���Զ�����
  private void manager() {
    Timer timer = new Timer();
    TimerTask tt2 = new TimerTask() {
      public void run() {
        loadNewWords();
      }
    };
View Full Code Here

Examples of java.util.TimerTask

   
   
   
    
    public HttpCache() {
        timerTask = new TimerTask() {
            public void run() {
                cache.periodicChecks();
            }
        };
               
View Full Code Here

Examples of java.util.TimerTask

   * Starts to update the values with the previously set period. Default is 1 second.
   */
  public void start() {
    if (isRunning()) return;
    timer = new Timer(true); // do not block the application on exit
    timer.scheduleAtFixedRate(new TimerTask() {
      public void run() {
        try {
          step();
        } catch (DataException e) {
          if (autoStop && (e instanceof NoSuchIndex)) {
View Full Code Here

Examples of java.util.TimerTask

    }
  }

  private void startMaintenanceTimer(int period) {
    maintenanceTimer = new Timer(true);
    maintenanceTimer.schedule(new TimerTask() {
      public void run() {
        if (maintenanceScheduled) {
          gc();
          // need to lock for consistent backup
          lock.readLock().lock();
View Full Code Here

Examples of java.util.TimerTask

  private static Runnable runnable;

  public static void start() {
    stop();
    timer = new Timer();
    timer.schedule(new TimerTask() {
      public void run() {
        try {
          String newSource = Registry
              .getParameter(Names.JEASE_TIMER_TASK);
          if (Validations.isNotEmpty(newSource)) {
View Full Code Here

Examples of java.util.TimerTask

          sessionTemporaryFolder.deleteOnExit();
        }
       
        // Launch a timer that updates modification date of the temporary folder each minute
        final long updateDelay = 60000;
        new Timer(true).schedule(new TimerTask() {
            @Override
            public void run() {
              // Ensure modification date is always growing in case system time was adjusted
              sessionTemporaryFolder.setLastModified(Math.max(System.currentTimeMillis(),
                  sessionTemporaryFolder.lastModified() + updateDelay));
            }
          }, updateDelay, updateDelay);
       
        if (siblingTemporaryFolders != null
            && siblingTemporaryFolders.length > 0) {
          // Launch a timer that will delete in 10 min temporary folders older than a week
          final long deleteDelay = 10 * 60000;
          final long age = 7 * 24 * 3600000;
          new Timer(true).schedule(new TimerTask() {
              @Override
              public void run() {
                long now = System.currentTimeMillis();
                for (File siblingTemporaryFolder : siblingTemporaryFolders) {
                  if (siblingTemporaryFolder.exists()
View Full Code Here

Examples of java.util.TimerTask

      this.timer = null;
    }
    int autoSaveDelayForRecovery = this.application.getUserPreferences().getAutoSaveDelayForRecovery();
    if (autoSaveDelayForRecovery > 0) {
      this.timer = new Timer("autoSaveTimer", true);
      TimerTask task = new TimerTask() {
        @Override
        public void run() {
          if (System.currentTimeMillis() - lastAutoSaveTime > MINIMUM_DELAY_BETWEEN_AUTO_SAVE_OPERATIONS) {
            cloneAndSaveHomes();
          }
View Full Code Here

Examples of java.util.TimerTask

        public void onRequest(final IHttpExchange exchange) throws IOException, BadMessageException {
            receivedRequests.incrementAndGet();
           
            int delay = exchange.getRequest().getIntParameter("delay", 0);
                   
            TimerTask task = new TimerTask() {
                @Override
                public void run() {
                    try {
                        exchange.send(new HttpResponse(200, "text/plain", "OK"));
                    } catch (IOException ioe) {
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.