Handle count of mail posting in the request.
@param runtime The runtime meta of action execute. (NotNull)
779362
protected void handleMailCount(ActionRuntime runtime) {
        if (ThreadCacheContext.exists()) {
            final PostedMailCounter counter = ThreadCacheContext.findMailCounter();
            if (counter != null) {
                saveRequestedMailCount(counter);
            }
        }
    }
343060
@Override
  public void handleNotification(NamespaceNotification n) {
    int queuedCount = 0;
    if (LOG.isDebugEnabled()) {
      LOG.debug("Handling " + NotifierUtils.asString(n) + " ...");
    }

    // Add the notification to the queues
    Set<Long> clientsForNotification = getClientsForNotification(n);
    if (clientsForNotification != null && clientsForNotification.size() > 0) {
      synchronized (clientsForNotification) {
        for (Long clientId : clientsForNotification) {
          ConcurrentLinkedQueue<NamespaceNotification> clientQueue =
              clientsData.get(clientId).queue;
          // Just test that the client wasn't removed meanwhile
          if (clientQueue == null) {
            continue;
          }
          clientQueue.add(n);
          queuedCount ++;
        }
      }
      
      ServerDispatcher.queuedNotificationsCount.addAndGet(queuedCount);
    }
    
    // Save it in history
    serverHistory.storeNotification(n);
    
    if (LOG.isDebugEnabled()) {
      LOG.debug("Done handling " + NotifierUtils.asString(n));
    }
  }
414923
@Override
  public synchronized void handleEvent(final Event event) {
    if (event.getType() == EventType.JOB_FINISHED && Status.FAILED
        .equals(event.getData().getStatus())) {
      this.value = this.value + 1;
    }
  }
721644
public void runtimeEventOccurred(RuntimeEvent event)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) 
      SibTr.debug(tc, "runtimeEventOccurred", event);
  }
525175
public static RuntimeException handleExceptionAndReturnRuntimeEx(Logger log,
            Throwable throwable, String method, Object... params) {
        handleException(log, throwable, method, params);
        return new RuntimeException(throwable);
    }
683142
@RequestMapping(method = POST)
    public void handle(@Valid @RequestBody P payload) {
        logger.debug("{} handlers", handlers.size());
        for (H handler : handlers) {
            executor.execute(runnableHandler(handler, payload));
        }
    }
1043916
private void handleRunAsync(RunAsync runAsync) {
		final long timeToRun = runAsync.getTimeNanos();
		final long delayNanos;

		if (timeToRun == 0 || (delayNanos = timeToRun - System.nanoTime()) <= 0) {
			// run immediately
			try {
				runAsync.getRunnable().run();
			} catch (Throwable t) {
				log.error("Caught exception while executing runnable in main thread.", t);
				ExceptionUtils.rethrowIfFatalErrorOrOOM(t);
			}
		}
		else {
			// schedule for later. send a new message after the delay, which will then be immediately executed
			FiniteDuration delay = new FiniteDuration(delayNanos, TimeUnit.NANOSECONDS);
			RunAsync message = new RunAsync(runAsync.getRunnable(), timeToRun);

			final Object envelopedSelfMessage = envelopeSelfMessage(message);

			getContext().system().scheduler().scheduleOnce(delay, getSelf(), envelopedSelfMessage,
					getContext().dispatcher(), ActorRef.noSender());
		}
	}
356022
private void submit(final Level level, final Object message, final Throwable t) {
        if (!m_logger.isEnabledFor(level)) return;

        if (m_asynchLoggerPool == null) {
            m_logger.log(level, message, t);
            return;
        }

        final Runnable runnableLoggingTask = createRunnableLoggingTask(level, message, t);
        try {
            m_asynchLoggerPool.submit(runnableLoggingTask).get();
        } catch (Exception e) {
            Throwables.propagate(e);
        }
    }
1300975
public Integer countPost(Query query) throws ApiException {
        ApiResponse<Integer> resp = countPostWithHttpInfo(query);
        return resp.getData();
    }
1176148
public void handleResponse(String response) {
        if (messageListener != null) {
            log.debug("Sending Http response");
            messageListener.onOutboundMessage(new RawMessage(response), null);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Sending Http response:" + NEWLINE + response);
            }
        }
    }
1135105
public void send(Message message)
  {
    Transport smtp = null;

    try {
      smtp = _session.getTransport("smtp");

      smtp.connect();

      smtp.send(message, _to);

      log.fine(this + " sent mail to " + _to[0]);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      try {
        if (smtp != null)
          smtp.close();
      } catch (Exception e) {
        log.log(Level.FINER, e.toString(), e);
      }
    }
  }
847319
@Override
	final protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setBufferSize(BUFFER_SIZE);
		postCount.incrementAndGet();
		try {
			reportingDoPost(req, resp);
		} catch (ThreadDeath t) {
			throw t;
		} catch (RuntimeException | ServletException | IOException e) {
			getLogger().log(Level.SEVERE, null, e);
			throw e;
		} catch (SQLException t) {
			getLogger().log(Level.SEVERE, null, t);
			throw new ServletException(t);
		}
	}
866449
public void handleData(String data) {
		try {
			sendEvent(new ClickEvent(this.user, getPayload()));
			if (clickHandler != null)
				clickHandler.clicked();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
599013
private static <E> void loadIntoCounter(String filename, Class<E> c, Counter<E> counter) throws RuntimeException {
    try {
      Constructor<E> m = c.getConstructor(String.class);
      BufferedReader in = IOUtils.getBufferedFileReader(filename);// new
                                                                  // BufferedReader(new
                                                                  // FileReader(filename));
      String line = in.readLine();
      while (line != null && line.length() > 0) {
        int endPos = Math.max(line.lastIndexOf(' '), line.lastIndexOf('\t'));

        counter.setCount(m.newInstance(line.substring(0, endPos).trim()), Double.parseDouble(line.substring(endPos, line.length()).trim()));

        line = in.readLine();
      }
      in.close();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
1286732
@Override
	public void handle(final T throwable, final boolean throwRuntimeException) {
		this.logger.error(throwable);
		if (throwRuntimeException) {
			if (throwable instanceof RuntimeException) {
				throw (RuntimeException) throwable;
			}
			throw new RuntimeException(throwable);
		}
	}
507292
private void updateStopRunnable(final int action) {
        if (stopRunnable != null) {
            if (action == 0) {
                handler.removeCallbacks(stopRunnable);
            } else if (action == 1) {
                handler.removeCallbacks(stopRunnable);
                handler.postDelayed(stopRunnable, STOP_DELAY);
            }
        }
    }
55472
public void scheduleOnce(Envelope envelope, long time) {
        if (envelope.getMailbox() != this) {
            throw new RuntimeException("envelope.mailbox != this mailbox");
        }

        envelopes.putEnvelopeOnce(envelope, time, comparator);
    }