/* (non-Javadoc)
@see java.lang.Runnable#run()
337050
@Override
    public void run() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "run", Thread.currentThread().getName() + " " + this.in.getReadListener());
        }
        
        try {     
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Issuing the async read for the data");
            }
            
            if (_isc==null) {
                
                _callback.complete(null);
            
            } else {
                //Call into the HttpInboundService context for the body data, passing in the callback and forcing
                //the read to go asynchronous
                //If there is data immediately available Channel will call the callback.complete before returning to this thread
                _isc.getRequestBodyBuffer(_callback, true);
            }
        } catch (Exception e){
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "An exception occurred during the async read : " + e);
            }
            e.printStackTrace();
            //There was a problem with the read so we should invoke their onError, since technically it's been set now
            if(this.in.getReadListener()!= null)
                this.in.getReadListener().onError(e);
        } finally {
            asyncContext.setReadListenerRunning(false);
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "run", this.in.getReadListener());
        }
    }
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;
	}
1312990
@Override
    public synchronized void run() {
        try {
            notifier.beforePollingCycle(new BeforePollingCycleEvent(dp));
            if (!executor.isShutdown()) {
                executor.invokeAll(pollers);
            }
            notifier.afterPollingCycle(new AfterPollingCycleEvent(dp));
        } catch (InterruptedException e) {
            // allow thread to exit gracefully
        } catch (Throwable t) {
            LOG.error("Unexpected error!", t);
        }
    }
298521
public void run() {
    String hostName = host != null ? host : "localhost";
    ServerTools.print("Starting LanguageTool " + JLanguageTool.VERSION +
            " (build date: " + JLanguageTool.BUILD_DATE + ", " + JLanguageTool.GIT_SHORT_ID + ") server on " + getProtocol() + "://" + hostName + ":" + port  + "...");
    server.start();
    isRunning = true;
    ServerTools.print("Server started");
  }
1304475
@Override
	public synchronized void run()
    {
        if (!start())
        	return;
        
        try
        {
        	inRunnableMode = true;
        	while (!stopRequired)
        		wait();
        }
        catch (InterruptedException e)
        {
        	log.error("Server was interrupted.");
        }
        
        shutdown();      
    }
683450
@Override
    public void run() {
        try {
            m_returned = m_method.invoke(m_object, m_args);
        } catch (Throwable thrown) {
            m_thrown = thrown;
        }
    }
890827
@SuppressWarnings("InfiniteLoopStatement")
  @Override
  public void run() {
    try {
      while (true) {
        try {
          cleanUp(queue.remove());
        } catch (InterruptedException e) { /* ignore */ }
      }
    } catch (ShutDown shutDown) { /* ignore */ }
  }
74089
@Override
    public void run() {

        boolean runOnce = (m_runnable != null);

        while (m_run) {
            setPriority(m_pool.getThreadPriority());
            try {
                if (m_runnable == null) {
                    m_runnable = m_pool.getNextRunnable();
                }

                if (m_runnable != null) {
                    m_runnable.run();
                }
            } catch (InterruptedException e) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_THREAD_INTERRUPTED_1, getName()), e);
            } catch (Throwable t) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_THREAD_ERROR_1, getName()), t);
            } finally {
                if (runOnce) {
                    m_run = false;
                }
                m_runnable = null;
            }
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_THREAD_SHUTDOWN_1, getName()));
        }
    }
1077521
public void run() {
    /* check if running the routine is still necessary */
    if(shutDownHookExecuted) {
      return;
    }
    synchronized (processes) {
      running = true;
      Enumeration e = processes.elements();
      while (e.hasMoreElements()) {
        destroy((Process) e.nextElement());
      }
      processes.clear();
      shutDownHookExecuted = true;
    }
  }
845576
public void run()
    {
        try
        {
            if (!thread.compareAndSet(null, Thread.currentThread()))
            {
                return;
            }

            final IdleStrategy idleStrategy = this.idleStrategy;
            final Agent agent = this.agent;
            try
            {
                agent.onStart();
            }
            catch (final Throwable throwable)
            {
                errorHandler.onError(throwable);
                isRunning = false;
            }

            while (isRunning)
            {
                if (doDutyCycle(idleStrategy, agent))
                {
                    break;
                }
            }

            try
            {
                agent.onClose();
            }
            catch (final Throwable throwable)
            {
                errorHandler.onError(throwable);
            }
        }
        finally
        {
            isClosed = true;
        }
    }
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();
			}
		}
	}
262827
@Override
	public final void run() {

		this.running.set( true );
		while( this.running.get()) {
			try {
				Message message = this.messageQueue.take();
				if( this.running.get())
					processMessage( message );

			} catch( InterruptedException e ) {
				break;
			}
		}

		Logger.getLogger( getClass().getName()).fine( "Roboconf's message processing thread is stopping." );
		this.running.set( false );
	}
1242806
@Override
  public void run() {

    this.stateLock.lock();

    try {

      if (this.state != RunnableProcessState.INIT) {
        throw new IllegalStateException("The RunnableProcess can't be reused");
      }

      // Setup the stdout and stderr destinations.
      final File errFile = new File(folder, standardErrorFileName);
      final File outFile = new File(folder, standardOutFileName);

      // Launch the process
      try {

        LOG.log(Level.FINEST,
            "Launching process \"{0}\"\nSTDERR can be found in {1}\nSTDOUT can be found in {2}",
            new Object[] {this.id, errFile.getAbsolutePath(), outFile.getAbsolutePath()});

        this.process = new ProcessBuilder()
            .command(this.command)
            .directory(this.folder)
            .redirectError(errFile)
            .redirectOutput(outFile)
            .start();

        this.setState(RunnableProcessState.RUNNING);
        this.processObserver.onProcessStarted(this.id);

      } catch (final IOException ex) {
        LOG.log(Level.SEVERE, "Unable to spawn process " + this.id + " with command " + this.command, ex);
      }

    } finally {
      this.stateLock.unlock();
    }

    try {

      // Wait for its completion
      LOG.log(Level.FINER, "Wait for process completion: {0}", this.id);
      final int returnValue = this.process.waitFor();
      this.processObserver.onProcessExit(this.id, returnValue);

      this.stateLock.lock();
      try {
        this.setState(RunnableProcessState.ENDED);
        this.doneCond.signalAll();
      } finally {
        this.stateLock.unlock();
      }

      LOG.log(Level.FINER, "Process \"{0}\" returned {1}", new Object[] {this.id, returnValue});

    } catch (final InterruptedException ex) {
      LOG.log(Level.SEVERE,
          "Interrupted while waiting for the process \"{0}\" to complete. Exception: {1}",
          new Object[] {this.id, ex});
    }
  }
600069
@Override
    public void run() {
        // Check for a pending exception.  A CancellationException could be set if a cancel() was driven while this Runnable
        // was being re-scheduled.
        if (this.m_pendingException != null) {
            return;
        }

        // NOTE: Already running in Default Executor thread.
        try {
            this.m_runnable.run();
        } catch (Exception e) {
            this.m_pendingException = new ExecutionException(e);
            this.m_coordinationLatch.countDown();
            return;
        }

        try {
            long scheduleTime = this.m_periodInterval;
            if (!this.m_scheduledWithDelay) {
                this.m_myNextExecutionTime = this.m_myNextExecutionTime + this.m_periodInterval;
                long currentTime = System.nanoTime();

                scheduleTime = (this.m_myNextExecutionTime > currentTime) ? (this.m_myNextExecutionTime - currentTime) : 0;
            }

            m_schedFuture = this.m_scheduledExecutor.schedule(this, scheduleTime, TimeUnit.NANOSECONDS);
        } catch (Exception e) {
            this.m_pendingException = e;
            this.m_coordinationLatch.countDown();
        }
    }
685992
@Override public void run() {
    super.run();
    try {
      process = Runtime.getRuntime().exec("logcat -v time");
    } catch (IOException e) {
      Log.e(LOGTAG, "IOException executing logcat command.", e);
    }
    readLogcat();
  }
1193102
public final void run() {
        int partitionCount = partitionService.getPartitionCount();
        latch = new CountDownLatch(partitionCount);

        for (int partitionId = 0; partitionId < partitionCount; partitionId++) {
            operationExecutor.execute(new CollectContainerRunnable(partitionId));
        }

        try {
            latch.await();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }
1193180
public void run(String... args) throws Exception {
        List<String> parameters = parseCommandLine(args);
        if (!parameters.isEmpty()) {
            runClassicRunner(parameters);
        }
    }