Examples of TimerTask


Examples of java.util.TimerTask

            return true;
        }
        if(timer.getNumberOfScheduled() >= limitSched) {
            return false;
        }
        final TimerTask cancel = new TimerTask() {
            public void run() {
                if(activeCount.get() < 1) {
                    closeQuietly(channels);
                }
            }
View Full Code Here

Examples of java.util.TimerTask

   private void scheduleAutocloseTask() {
       final int delay = COConfigurationManager.getIntParameter("Message Popup Autoclose in Seconds") * 1000;
        if(delay < 1000)
            return;

       closeTimer.scheduleAtFixedRate(new TimerTask() {
           public void run() {
               display.syncExec(new AERunnable() {
                    public void runSupport() {
                        if(shell.isDisposed()) {
                            closeTimer.cancel();
View Full Code Here

Examples of java.util.TimerTask

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

Examples of java.util.TimerTask

      synchronized(timerLock){
        if(timer!=null){
          return; // there is a timer let it do its job
        }
        timer = new Timer(true); // do not block the application on exit 
        timer.schedule(new TimerTask() {
        public void run() {
          int n=0;
          synchronized(paintedAreas){
            Iterator it=paintedAreas.keySet().iterator();
            if(!it.hasNext()){
View Full Code Here

Examples of java.util.TimerTask

    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

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

Examples of java.util.TimerTask

      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

Examples of java.util.TimerTask

        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

Examples of java.util.TimerTask

    } 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

Examples of java.util.TimerTask

        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
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.