private void schedulePump() { try { this.executor.execute(this); } catch (final RejectedExecutionException rejectedException) { this.isPumpHealthy = false; if (TRACE_LOGGER.isWarnEnabled()) { TRACE_LOGGER.warn(String.format( "Receive pump for eventHub (%s), consumerGroup (%s), partition (%s) exiting with error: %s", this.eventHubName, this.consumerGroupName, ReceivePump.this.receiver.getPartitionId(), rejectedException.toString())); } this.onReceiveHandler.onError(rejectedException); } }
private enum State { NEW(CellInfo.INITIAL, false, false, true), PRE_STARTUP(CellInfo.ACTIVE, true, false, true), POST_STARTUP(CellInfo.ACTIVE, true, true, true), RUNNING(CellInfo.ACTIVE, false, true, true), FAILED(CellInfo.REMOVING, false, true, true), STOPPING(CellInfo.REMOVING, false, true, false), TERMINATED(CellInfo.DEAD, false, false, false); /** State included in CellInfo. */ int externalState; /** * Whether the cell is currently processing startup callbacks. */ boolean isStarting; /** * Whether it is legal for a cell to call {@link #sendMessage(CellMessage, * boolean, boolean, boolean, CellMessageAnswerable, Executor, long)}. */ boolean isSendWithCallbackAllowed; /** * Whether callbacks are guaranteed to be called. At some point * during shutdown, the timeout mechanism is stopped and callbacks * are no longer called automatically. */ boolean areCallbacksGuaranteed;
LOGGER.error("Failed to invoke callback: {}", e.toString()); reregisterCallback(request.getUOID(), _lock);
/** * Executes a request asynchronously. */ public static void executeAsync(AsyncCmisServlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { AsyncCmisExecutor executor = getAsyncCmisExecutor(servlet.getServletConfig(), request, response); if (executor == null) { // there is no executor -> execute synchronously servlet.executeSync(request, response); } else { // there is an executor -> start asynchronous execution AsyncContext asyncContext = request.startAsync(); try { executor.execute(asyncContext, new CmisRequestRunner(asyncContext, servlet)); } catch (RejectedExecutionException ree) { if (LOG.isWarnEnabled()) { LOG.warn("Submitting async request failed: {}", ree.toString(), ree); } servlet.sendError(new CmisServiceUnavailableException("CMIS server is busy", ree), request, response); asyncContext.complete(); } catch (Exception e) { LOG.error("Executing async request failed: {}", e.toString(), e); servlet.sendError(e, request, response); asyncContext.complete(); } } }