Package java.util

Examples of java.util.TimerTask


        }
        if (cleanStatusTask != null) {
            cleanStatusTask.cancel();
        }
        status.setText(message);
        cleanStatusTask = new TimerTask() {
            public void run() {
                status.setText("");
                cleanStatusTask.cancel();
                cleanStatusTask = null;
            }
View Full Code Here


      e.printStackTrace();
      return;
    }
    _network_manager = (InternalNetworkManager) NetworkManagerSingleton.getInstance();
    need_more_peers_timer = new Timer( "Need more peers timer", true );
    need_more_peers_timer.scheduleAtFixedRate( new TimerTask() {
      @Override
      public void run() {
        Set<FileHash> file_hashes = session_list.keySet();
        List<FileHash> file_hashes_needed_help = new ArrayList<FileHash>();
        for(FileHash file_hash : file_hashes) {
View Full Code Here

        synchronized (this) {
            _accumulator += zoomIncrement;
            if (_zoomAccumulator != null)
                return;
            _zoomAccumulator = new Timer();
            _zoomAccumulator.schedule(new TimerTask() {
                public void run() {
                    int accuCopy;
                    synchronized (ViewTransform.this) {
                        accuCopy = _accumulator;
                        _accumulator = 0;
View Full Code Here

    } catch (JMuleManagerException e) {
      e.printStackTrace();
      return ;
    }
    remove_temp_banned_peers_timer = new Timer( "Remove temp banned peers timer", true );
    remove_temp_banned_peers_timer.scheduleAtFixedRate(new TimerTask() {
      @Override
      public void run() {
        for(TemporaryBannedIP banned_ip : temporary_banned_peers)
          if( ( System.currentTimeMillis() - banned_ip.getWhenBanned() ) >= banned_ip.getHowLong() )
            temporary_banned_peers.remove( banned_ip );
      }
    }, (long)1, REMOVE_TEMP_BANNED_PEERS_INTERVAL);
   
    remove_temp_banned_servers_timer = new Timer( "Remove temp banned servers timer", true);
    remove_temp_banned_servers_timer.scheduleAtFixedRate(new TimerTask() {
      @Override
      public void run() {
        for(TemporaryBannedIP banned_ip : temporary_banned_servers)
          if( ( System.currentTimeMillis() - banned_ip.getWhenBanned() ) >= banned_ip.getHowLong() )
            temporary_banned_servers.remove( banned_ip );
View Full Code Here

        if (null == workQueue) {
            LOG.fine("Starting retransmission queue");
            workQueue = queue;
            // workQueue.schedule(getResendInitiator(), baseRetransmissionInterval);
           
            TimerTask task = new TimerTask() {
                public void run() {
                    getResendInitiator().run();
                }
            };
            timer = new Timer();
View Full Code Here

  protected abstract void throwInterruptedException()
    throws StoreException;

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

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

        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

  }

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

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

   * 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

TOP

Related Classes of java.util.TimerTask

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.