{@inheritDoc}

@see java.lang.Runnable#run()
763432
@Override
    public void run() {
        try {
            this.delegate.run();
        } catch (UndeclaredThrowableException ex) {
            this.errorHandler.handleError(ex.getUndeclaredThrowable());
        } catch (Throwable ex) {
            this.errorHandler.handleError(ex);
        }
    }
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;
	}
1366863
public void run() {
    lock.readLock().lock();
    try {
      if (Collections.isEmptyCollection(listeners)) {
        return;
      }
      for (ProcessorListener listener : listeners) {
        executorService.execute(listener);
      }
    } finally {
      lock.readLock().unlock();
    }
  }
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()));
        }
    }
553427
@Override
   public void run()
   {
      try {
         startBarrier.await();

         int idleCount = 0;
         while (!isRunning.compareAndSet(idleCount > LINGER_ITERATIONS && deadPool.isEmpty() && completionKeyToProcessMap.isEmpty(), false)) {
            idleCount = (!shutdown && process()) ? 0 : (idleCount + 1);
         }
      }
      catch (Exception e) {
         // TODO: how to handle this error?
         e.printStackTrace();
         isRunning.set(false);
      }
   }
847429
@Override
	public void run()
    {
        String command = globalSettings.getStringProperty(FFMQAdminClientSettings.ADM_COMMAND, null);
        if (StringTools.isEmpty(command))
        {
            err.println("No command specified");
            return;
        }
        
        try
        {
            openSession();
            processCommand(command);
        }
        catch (JMSException e)
        {
        	logError(e);
        }
        finally
        {
        	closeSession();
        }
    }
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");
        }

    }
166971
@Override
	public void run()
	{
		try
		{
			String serverHost = InetUtils.resolveAutoInterfaceAddress(settings.getStringProperty(FFMQJMXConsoleSettings.SERVER_HOST, "localhost"));
			int serverPort = settings.getIntProperty(FFMQJMXConsoleSettings.SERVER_PORT, 10003);

			String serviceUrl = "service:jmx:rmi://"+serverHost+"/jndi/rmi://"+serverHost+":"+serverPort+"/jmxconnector-FFMQ-server";
			out.println("JMX Service URL : "+serviceUrl);
			this.jmxServiceURL = new JMXServiceURL(serviceUrl);

			printServerVersion();
			
			boolean interactive = settings.getBooleanProperty(FFMQJMXConsoleSettings.INTERACTIVE, false);
			if (interactive)
				interactiveMode();
			else
			{
				String command = settings.getStringProperty(FFMQJMXConsoleSettings.COMMAND, "help");
				processCommand(command);
			}
		}
		catch (Exception e)
		{
			closeJMXResources();
			handleException(e);
		}
	}
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();
	}
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();
        }
    }
1349710
@Override
    public void run() {
        ExecutorService executorService = Executors.newFixedThreadPool(maxClients);
        try {
            serverSocket = new ServerSocket(port, maxClients);
            while (!shuttingDown) {
                try {
                    Socket socket = serverSocket.accept();
                    debugConnection = new DebugConnection(socket);
                    executorService.submit(debugConnection);
                } catch (SocketException e) {
                    // closed
                    debugConnection = null;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                debugConnection = null;
                serverSocket.close();
            } catch (Exception e) {
            }
            executorService.shutdownNow();
        }
    }
833115
@Override
    public void run() {
        try {
            handle();
        } catch (Exception e) {
            Throwables.throwIfUnchecked(e);
            throw new RuntimeException(e);
        }
    }
422854
public void run() {
        Runnable r = null;
        while (true) {
            // Try to drain the maximum capacity of thread-local items, checking
            // whether any were available
            if (workQueue.drainTo(internalQueue, threadLocalItems) == 0) {
                // block until a work item is available
                try {
                    internalQueue.offer(workQueue.take());
                } catch (InterruptedException ie) {
                    throw new Error(ie);
                }
            }
            // Execute all of the thread-local items
            while ((r = internalQueue.poll()) != null)
                r.run();
        }
    }
1113703
@Override
	public void run() {
		try {
			this.associationListener.onPayload(this.association, this.payloadData);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
1107831
@Override
    public void run() {
        if (state.compareAndSet(State.STARTED, State.STOPPING)) {
            for (final Runnable hook : hooks) {
                try {
                    hook.run();
                } catch (final Throwable t) {
                    LOGGER.error(SHUTDOWN_HOOK_MARKER, "Caught exception executing shutdown hook {}", hook, t);
                }
            }
            state.set(State.STOPPED);
        }
    }
360103
@Override
  public void run() {
    synchronized (this) {
      started = true;
    }
    finished = false;

    final byte[] buf = new byte[bufferSize];

    try {
      int length;
      while (true) {
        waitForInput(is);

        if (finish || Thread.interrupted()) {
          break;
        }

        length = is.read(buf);
        if (length <= 0 || Thread.interrupted()) {
          break;
        }
        os.write(buf, 0, length);
        if (autoflush) {
          os.flush();
        }
        if (finish) { //NOSONAR
          break;
        }
      }
      // On completion, drain any available data (which might be the first data available for quick executions)
      if (finish) {
        while((length = is.available()) > 0) {
          if (Thread.interrupted()) {
            break;
          }
          length = is.read(buf, 0, Math.min(length, buf.length));
          if (length <= 0) {
            break;
          }
          os.write(buf, 0, length);
        }
      }
      os.flush();
    } catch (InterruptedException ie) {
      // likely PumpStreamHandler trying to stop us
    } catch (Exception e) {
      synchronized (this) {
        exception = e;
      }
    } finally {
      if (closeWhenExhausted) {
        Closeables.close(os);
      }
      finished = true;
      finish = false;
      synchronized (this) {
        notifyAll();
      }
    }
  }
536913
@Override
	public void run() {

		final Map<String, WatchEventItem> eventQueue = new LinkedHashMap<>();

		while (running) {

			if (!Services.getInstance().isInitialized()) {

				try { Thread.sleep(100); } catch (InterruptedException i) {}

				// loop until we are stopped
				continue;
			}

			synchronized (watchedRoots) {

				for (final FolderInfo info : watchedRoots.values()) {

					if (info.shouldScan()) {

						// update last scanned timestamp
						info.setLastScanned(System.currentTimeMillis());

						// start a new scan thread
						new Thread(new ScanWorker(false, Paths.get(info.getRoot()), info.getRoot(), true)).start();
					}
				}
			}

			try {

				final WatchKey key = watchService.poll(100, TimeUnit.MILLISECONDS);
				if (key != null && Services.getInstance().isInitialized()) {

					final Path root;

					// synchronize access to map but keep critical section short
					synchronized (watchKeyMap) {
						root = watchKeyMap.get(key);
					}

					if (root != null) {

							for (final WatchEvent event : key.pollEvents()) {

								final Kind kind = event.kind();

								if (OVERFLOW.equals(kind)) {
									continue;
								}

								addToQueue(eventQueue, new WatchEventItem(root, (Path)key.watchable(), event));
							}

							key.reset();

					} else {

						key.cancel();
					}
				}

			} catch (InterruptedException ex) {
				ex.printStackTrace();
			}

			final SecurityContext securityContext = SecurityContext.getSuperUserInstance();

			try (final Tx tx = StructrApp.getInstance(securityContext).tx(true, true, false)) {

				// handle all watch events that are older than 2 seconds
				for (final Iterator<WatchEventItem> it = eventQueue.values().iterator(); it.hasNext();) {

					final WatchEventItem item = it.next();
					if (item.olderThan(2000)) {

						handleWatchEvent(true, item);

						it.remove();
					}
				}

				tx.success();

			} catch (Throwable t) {

				t.printStackTrace();
			}

		}

		logger.info("DirectoryWatchService stopped");
	}