/* (non-Javadoc)
@see java.lang.Thread#run()
970440
public void run()
	{
		while (true) {
			final long start = System.currentTimeMillis();
			long remaining;
			Cache c;
			synchronized (lock) {
				c = cache;
				remaining = sweepInterval * 1000;
				while (remaining > 0 && cache != null) {
					try {
						lock.wait(remaining);
					}
					catch (final InterruptedException e) {}
					remaining = start + sweepInterval * 1000 - System.currentTimeMillis();
				}
				if (cache == null)
					break;
			}
			c.removeExpired();
		}
	}
1338633
@Override
	public final void run() {

		LOGGER.debug("Executing " + getClass().getSimpleName());
		markAsInProgress();

		if (!Lists.isNullOrEmpty(listeners)) {
			Runnable startUseCaseRunnable = new Runnable() {
				@Override
				public void run() {
					for (UseCaseListener listener : listeners) {
						notifyUseCaseStart(listener);
					}
				}
			};
			if (handler != null) {
				handler.post(startUseCaseRunnable);
			} else {
				startUseCaseRunnable.run();
			}
		}

		Trace trace = null;
		if (timingTrackingEnabled()) {
			trace = TraceHelper.startTrace(getClass());
		}

		try {

			LOGGER.debug("Started " + getClass().getSimpleName());
			executionTime = null;
			startTime = DateUtils.nowMillis();
			doExecute();
			executionTime = DateUtils.nowMillis() - startTime;
			LOGGER.debug("Finished " + getClass().getSimpleName() + ". Execution time: " + DateUtils.formatDuration(executionTime));

			if (trace != null) {
				trace.putAttribute("result", "success");
				trace.incrementMetric("successes", 1);
			}

			markAsSuccessful();

			if (!Lists.isNullOrEmpty(listeners)) {
				Runnable finishedUseCaseRunnable = new Runnable() {
					@Override
					public void run() {
						for (UseCaseListener listener : listeners) {
							notifyFinishedUseCase(listener);
						}
						markAsNotified();
					}
				};
				if (handler != null) {
					handler.post(finishedUseCaseRunnable);
				} else {
					finishedUseCaseRunnable.run();
				}
			}

		} catch (RuntimeException e) {
			if (trace != null) {
				trace.putAttribute("result", "failure");
				trace.incrementMetric("failures", 1);
			}
			final AbstractException abstractException = wrapException(e);
			markAsFailed(abstractException);
			logHandledException(abstractException);

			if (!Lists.isNullOrEmpty(listeners)) {
				Runnable finishedFailedUseCaseRunnable = new Runnable() {
					@Override
					public void run() {
						for (UseCaseListener listener : listeners) {
							notifyFailedUseCase(abstractException, listener);
						}
						markAsNotified();
					}
				};
				if (handler != null) {
					handler.post(finishedFailedUseCaseRunnable);
				} else {
					finishedFailedUseCaseRunnable.run();
				}
			}
		} finally {
			if (trace != null) {
				trace.stop();
			}
		}
	}
305450
@Override
    public void run() {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        subjectRepository.getSubjectsCollection(new SubjectRepository.SubjectListCallback() {
            @Override
            public void onSubjectListLoader(final Collection<Subject> subjects) {
                mainThread.post(new Runnable() {
                    @Override
                    public void run() {
                        callback.onSubjectListLoaded(subjects);
                    }
                });
            }

            @Override
            public void onError(final SubjectException exception) {
                mainThread.post(new Runnable() {
                    @Override
                    public void run() {
                        callback.onError(exception);
                        Log.i(getClass().toString(), "Error!");
                    }
                });
            }
        });
    }
1268498
@Override
	public void run()
	{
		try
		{
			while (!stopRequired)
			{
				if (traceEnabled)
					log.trace("Thread entering passive wait : "+getName());
				
				// Passive wait
				waitLock.acquire();
				if (stopRequired)
					break;
				
				// Process the container
				if (traceEnabled)
					log.trace("Executing task "+task);

				// Execute task
				task.execute();
				
				// Notify listener
				listener.executionComplete(this);
			}
		}
		catch (Throwable ex)
		{
			log.error("Asynchronous execution thread failed",ex);
		}
		log.debug("Thread exits : "+getName());
	}
1208169
@Override
    public void run() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {

        }
        //TODO replace me with a timer task
        while (running) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (needsDataRefresh) {
                if (System.currentTimeMillis() - lastMovement > 500) {
                    generateMap();
                    needsDataRefresh = false;
                }
            }
        }
    }
833773
@Override
	public void run() {
		try {
			while (running && (monitored == null || !monitored.isDone())) {
				logger.info(getMemoryUsageStatsAsString(memoryBean));
				logger.info(getDirectMemoryStatsAsString(directBufferBean));
				logger.info(getMemoryPoolStatsAsString(poolBeans));
				logger.info(getGarbageCollectorStatsAsString(gcBeans));
				
				try {
					Thread.sleep(interval);
				}
				catch (InterruptedException e) {
					if (running) {
						throw e;
					}
				}
			}
		}
		catch (Throwable t) {
			logger.error("Memory logger terminated with exception", t);
		}
	}
800212
@Override
    public void run() {
        synchronized (lock) {
            if (mIsDone || mIsCancelled) {
                return;
            }
            mIsStarted = true;
        }

        try {
            t = mCallable.call();
        } catch (Exception e) {
            e.printStackTrace();
        }

        synchronized (lock) {
            mIsDone = true;
            lock.notifyAll();
        }

    }
702388
public final void run() throws IOException, InterruptedException {
        InputStreamReader isr = new InputStreamReader(this.is, this.charset);
        BufferedReader br = new BufferedReader(isr);
        this.line = null;
        this.lineNumber = 0;
        try {
            do {
                if (this.exit) {
                    return;
                }
                if(Thread.currentThread().isInterrupted()){
                throw new InterruptedException();
            }
                this.nextLine = br.readLine();
                try {
                    if (this.line != null) {
                        processLine(this.line);
                        if (this.exit) {
                            return;
                        }
                    }
                } catch (Exception e) {
                    onExceptionFound(e);
                } finally {
                    this.lineNumber++;
                    this.line = this.nextLine;
                }
            } while (this.line != null);
        } finally {
            onFinish();
        }
    }
1325232
@Override
    public void run() {
        while(true) {
            WatchKey key;
            try {
                key = watcher.take();
            } catch (InterruptedException e) {
                log.warn(e);
                continue;
            }

            List<FileInfo> fileInfos = addOnMap.get(key);
            checkAndProcessFileInfo(key, fileInfos);

            // reset key and remove from set if directory no longer accessible
            boolean valid = key.reset();
            if (!valid) {
                addOnMap.remove(key);

                // all directories are inaccessible
                if (addOnMap.isEmpty()) {
                    break;
                }
            }
        }
    }
1143966
public void run()
   {
      this.currentThread = Thread.currentThread();
      this.running.set(true);

      while (this.running.get())
      {
         Task nextTask = null;
         try
         {
            if (_logger.isDebugEnabled())
               _logger.debug("Waiting for next task...");
            nextTask = this.taskSet.take();
            if (_logger.isDebugEnabled())
               _logger.debug("next from taskset is task: " + nextTask.getCommand());
            this.executor.submit(nextTask);
            if (_logger.isDebugEnabled())
               _logger.debug("submitted for execution command: " + nextTask.getCommand());
         }
         catch (InterruptedException e)
         {
            _logger.debug("Task manager thread interrupted.");
            this.running.set(false);
         }
         catch (Exception e)
         {
            _logger.debug("Task manager experienced an unhandled exception, shutting down");
            this.running.set(false);
         }
      }
      _logger.info("Shutting down task manager.");

      this.taskSet.clear();
      executor.shutdown();
   }
876601
public void run()
    {
        Folder folder = this.getInboxFolder();
        
        if (folder != null)
            this.processMail(folder);

        try {
            folder.close(true);
        } catch (MessagingException e) {
            e.printStackTrace();
        }
    }
1126678
@Override
	public void run() {
		Stopwatch stopwatch = SimonManager.getStopwatch(NAME);
		try (Split ignored = stopwatch.start();) {
			sleep(SLEEP);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		// signal to latch that the thread is finished
		latch.countDown();
	}
510436
public void run() {
        try {
            while (--expires >= 0) {
                sleep(sysInterval);
                synchronized (ThreadClockImpl.class) {
                    currentTimeMillis += sysInterval;
                }
            }
        } catch (InterruptedException e) {
            System.out.println("Clock thread interrupted");
        }
    }
535065
@Override
    public void run() {

        final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "run", "alarm");
        }

        if (isTracingEnabled && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "run: alarm, Pool contents ==> " + this.toString());
            Tr.debug(this, tc, "reaperThreadStarted: ", reaperThreadStarted);
        }

        if (needToReclaimConnections() || needToReclaimTLSConnections()) {
            // Create thread to reclaim connections
            startReclaimConnectionThread();
        }

        if (isTracingEnabled && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "run: alarm, Pool contents ==> " + this.toString());
            Tr.debug(this, tc, "reaperThreadStarted: ", reaperThreadStarted);
        }

        synchronized (amLockObject) {
            if (this.agedTimeout < 1) {
                if ((totalConnectionCount.get() > minConnections) && alarmThreadCounter.get() >= 0) {
                    createReaperAlarm();
                } else {
                    if (alarmThreadCounter.get() > 0)
                        alarmThreadCounter.decrementAndGet();
                    if (isTracingEnabled && tc.isDebugEnabled())
                        Tr.debug(tc, "Alarm thread was NOT started. Number of alarm threads is " + alarmThreadCounter.get());
                }
            } else {
                if (totalConnectionCount.get() > 0 && alarmThreadCounter.get() >= 0) {
                    createReaperAlarm();
                } else {
                    if (alarmThreadCounter.get() > 0)
                        alarmThreadCounter.decrementAndGet();
                    if (isTracingEnabled && tc.isDebugEnabled())
                        Tr.debug(tc, "Alarm thread was NOT started. Number of alarm threads is " + alarmThreadCounter.get());
                }
            }
        }

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "run");
        }

    }
351304
@Override
  public void run()
  {
    boolean isValid = false;
      
    try {
      _socket.getChannel().configureBlocking(true);
      /*
      EndpointReaderWebSocket wsEndpointReader = _client.getEndpointReader();
      
      do {
        if (! wsEndpointReader.onRead()) {
          return;
        }
      } while (wsEndpointReader.isReadAvailable() && ! _client.isClosed());
      
      isValid = ! _client.isClosed();
      
      if (isValid) {
        registerKeepalive();
      }
      */
    } catch (Exception e) {
      e.printStackTrace();
      log.log(Level.WARNING, e.toString(), e);
    } finally {
      if (! isValid) {
        _client.close();
      }
    }
  }
411333
public void run()
    {

        String strURL = this.getProperty(DBParams.URL);
        String strOut = this.getProperty("out");
        
        this.moveThisFile(strURL, strOut);
    }
829339
@Override
    public void run()
    {
        while (true)
        {
            try
            {
                Thread.sleep(120000);
                PeerMonitor.getInstance().startSweep();
            }
            catch (final InterruptedException e)
            {
                PeerMonitor.logger.error(e, e);

            }
        }

    }