/* (non-Javadoc)
@see java.lang.Runnable#run()
511886
public void run()
    {
        try
        {
            log.info("Starting Publisher thread");

            while (!Thread.currentThread().isInterrupted())
            {
                Collection<ScriptSession> sessions = serverContext.getScriptSessionsByPage("/dwr/gi/index.html");
                ScriptProxy proxy = new ScriptProxy(sessions);

                Corporation corp = corporations.getNextChangedCorporation();
                proxy.addFunctionCall("OpenAjax.publish", "gidemo", "corporation", corp);

                int timeToSleep = random.nextInt(2500);
                Thread.sleep(timeToSleep);
            }
        }
        catch (InterruptedException ex)
        {
            // Ignore, we expect this
        }
        finally
        {
            log.info("Stopping Publisher thread");
        }
    }
1051919
@Override
	public final void run () {
		Status result = execute();
		if (result == null) throw new IllegalStateException("Invalid status 'null' returned by the execute method");
		switch (result) {
		case SUCCEEDED:
			success();
			return;
		case FAILED:
			fail();
			return;
		case RUNNING:
			running();
			return;
		default:
			throw new IllegalStateException("Invalid status '" + result.name() + "' returned by the execute method");
		}
	}
1234942
@Override
	public void run() {

		while (!stopProcessing.get()) {

			try {
				JawrWatchEvent evt = watchEvents.take();
				AtomicBoolean processingBundle = bundlesHandler.isProcessingBundle();
				synchronized (processingBundle) {

					// Wait until processing ends
					while (processingBundle.get() && !stopProcessing.get()) {
						try {
							processingBundle.wait();
						} catch (InterruptedException e) {
							LOGGER.debug("Thread interrupted");
						}
					}
				}
				if (evt != null && !stopProcessing.get()) {
					process(evt);
				}
			} catch (InterruptedException e) {
				LOGGER.debug("Thread interrupted");
			}
		}
		
		this.bundlesHandler = null;
		this.watcher = null;
	}
1092015
@Override
   public void run()
   {
      try {
         startBarrier.await();

         int idleCount = 0;
         while (!isRunning.compareAndSet(idleCount > lingerIterations && pidToProcessMap.isEmpty(), false)) {
            idleCount = (!shutdown && process()) ? 0 : (idleCount + 1);
         }
      }
      catch (Exception e) {
         // TODO: how to handle this error?
         isRunning.set(false);
      }
   }
906737
public void run() {
    this.runnerState = JobControl.RUNNING;
    while (true) {
      while (this.runnerState == JobControl.SUSPENDED) {
        try {
          Thread.sleep(5000);
        }
        catch (Exception e) {
					
        }
      }
      checkRunningJobs();	
      checkWaitingJobs();		
      startReadyJobs();		
      if (this.runnerState != JobControl.RUNNING && 
          this.runnerState != JobControl.SUSPENDED) {
        break;
      }
      try {
        Thread.sleep(5000);
      }
      catch (Exception e) {
				
      }
      if (this.runnerState != JobControl.RUNNING && 
          this.runnerState != JobControl.SUSPENDED) {
        break;
      }
    }
    this.runnerState = JobControl.STOPPED;
  }
462191
@Override
    public void run() {
        if (this.state.compareAndSet(NEW, RUNNING)) {
            try {
                renameThread("RUNNING");
                this.threadRef.set(Thread.currentThread());
                PoolUtils.doWorkInPool(this.jedisPool, new PoolWork<Jedis, Void>() {
                    /**
                     * {@inheritDoc}
                     */
                    @Override
                    public Void doWork(final Jedis jedis) throws IOException {
                        jedis.sadd(key(WORKERS), name);
                        jedis.set(key(WORKER, name, STARTED), new SimpleDateFormat(DATE_FORMAT).format(new Date()));
                        listenerDelegate.fireEvent(WORKER_START, WorkerPoolImpl.this, null, null, null, null, null);
                        loadRedisScripts(jedis);
                        return null;
                    }
                });
                poll();
            } catch (Exception ex) {
                LOG.error("Uncaught exception in worker run-loop!", ex);
                this.listenerDelegate.fireEvent(WORKER_ERROR, this, null, null, null, null, ex);
            } finally {
                renameThread("STOPPING");
                this.listenerDelegate.fireEvent(WORKER_STOP, this, null, null, null, null, null);
                PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, Void>() {
                    /**
                     * {@inheritDoc}
                     */
                    @Override
                    public Void doWork(final Jedis jedis) {
                        jedis.srem(key(WORKERS), name);
                        jedis.del(key(WORKER, name), key(WORKER, name, STARTED), key(STAT, FAILED, name),
                                key(STAT, PROCESSED, name));
                        return null;
                    }
                });
                this.threadRef.set(null);
            }
        } else if (RUNNING.equals(this.state.get())) {
            throw new IllegalStateException("This WorkerImpl is already running");
        } else {
            throw new IllegalStateException("This WorkerImpl is shutdown");
        }
    }
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();
	}
1178459
@Override
    public void run ()
    {
        try {
            _running = true;
            willStart();

            while (isRunning()) {
                try {
                    iterate();
                } catch (Exception e) {
                    handleIterateFailure(e);
                }
            }

        } catch (Throwable t) {
            log.warning("Looping thread terminated with exception.", "thread", this, t);

        } finally {
            // running needs to be false even if this exited due to a Throwable from iterate
            _running = false;
            didShutdown();
        }
    }
890827
@SuppressWarnings("InfiniteLoopStatement")
  @Override
  public void run() {
    try {
      while (true) {
        try {
          cleanUp(queue.remove());
        } catch (InterruptedException e) { /* ignore */ }
      }
    } catch (ShutDown shutDown) { /* ignore */ }
  }
675934
@Override
	final public void run() {
		try {
			if(args.length>0) handleCommand(args);
			else runImpl();
			status="Done";
		} catch(IOException exception) {
			this.err.println(getName()+": "+exception.getMessage());
			status="IO Error: "+exception.getMessage();
			this.err.flush();
		} catch(SQLException exception) {
			this.err.println(getName()+": "+exception.getMessage());
			status="SQL Error: "+exception.getMessage();
			this.err.flush();
		} catch(ThreadDeath TD) {
			throw TD;
		} catch(Throwable T) {
			ErrorPrinter.printStackTraces(T, this.err);
			status="Error: "+T.toString();
			this.err.flush();
		} finally {
			if(Thread.currentThread()==thread) thread=null;
		}
	}
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;
                }
            }
        }
    }
33093
@Override
    public void run() {
        while (!Thread.currentThread().isInterrupted()) {
            try {
                int count = collectionService.commitAnnotations(ANNOTATION_CHUNK_SIZE, TIMEOUT);

                if (count > 0) {
                    LOGGER.info(MessageFormat.format("Committed {0} annotations.", count));
                    jobCounter.addAndGet(count);
                }
                Thread.sleep(POLL_INTERVAL_MS);
            } catch (InterruptedException ie) {
                LOGGER.info("Execution was interrupted.");
                Thread.currentThread().interrupt();
                break;
            } catch (Throwable ex) {
                LOGGER.info("Error occurred while committing annotations. Reason {}", ex.toString());
            }
        }
        LOGGER.warn(MessageFormat.format("Annotation committer thread interrupted. {} annotations committed by this thread.", jobCounter.get()));
        collectionService.dispose();
        monitorService.dispose();
    }
76441
@Override
    public synchronized void run() {

        try {
            // do the rename operation
            m_elementRename.actionRename(getReport());
        } catch (Exception e) {
            getReport().println(e);
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getMessage());
            }
        }
    }
1141605
public static void runIntoJAT(final JRebirthRunnable runnable) {
        if (Platform.isFxApplicationThread()) {
            // We are into a JAT so just run it synchronously
            runnable.run();
        } else {
            // The runnable will be run into the JAT during the next round
            Platform.runLater(runnable);
        }
    }
528031
@Override
    public void run() {
        try {
            if (this.isDone()) {
                return;
            }
            ExpeditedFutureTask<V> futureTask = new ExpeditedFutureTask<V>(this.m_callable);
            this.m_defaultFuture = futureTask;
            this.m_executor.execute(futureTask);
            this.m_scheduledExecutorQueue.remove(this);
        } catch (Exception e) {
            this.m_pendingException = new RuntimeException(e);
            return;
        } finally {
            // Let blocked ScheduleFuture methods thru now.
            this.m_coordinationLatch.countDown();
        }
    }
887873
@Override
    public void run() {

        try {
            // do the import
            m_htmlImport.startImport(getReport());
        } catch (Exception e) {
            getReport().println(e);
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage());
            }
        }
    }
1360963
public void
run() {
	try {
		Message response = res.send(query);
		listener.receiveMessage(id, response);
	}
	catch (Exception e) {
		listener.handleException(id, e);
	}
}