Refine search
public void failWebSocket(Exception e, @Nullable Response response) { Streams streamsToClose; synchronized (this) { if (failed) return; // Already failed. failed = true; streamsToClose = this.streams; this.streams = null; if (cancelFuture != null) cancelFuture.cancel(false); if (executor != null) executor.shutdown(); } try { listener.onFailure(this, e, response); } finally { closeQuietly(streamsToClose); } }
@Override public void stop() { if(taskExecutor != null) { logger.debug("Stopping Http Site-to-Site Transaction Maintenance task..."); taskExecutor.shutdown(); } if (transactionMaintenanceTask != null) { logger.debug("Stopping transactionMaintenanceTask..."); transactionMaintenanceTask.cancel(true); } }
public void stop() { try { if (start.compareAndSet(true, false)) { scheduledFuture.cancel(true); channelCheckExecutorService.shutdown(); offlineTaskTrackerScheduledFuture.cancel(true); offlineTaskTrackerCheckExecutorService.shutdown(); } LOGGER.info("Stop channel manager success!"); } catch (Throwable t) { LOGGER.error("Stop channel manager failed!", t); } }
@Override public void onReadClose(int code, String reason) { if (code == -1) throw new IllegalArgumentException(); Streams toClose = null; synchronized (this) { if (receivedCloseCode != -1) throw new IllegalStateException("already closed"); receivedCloseCode = code; receivedCloseReason = reason; if (enqueuedClose && messageAndCloseQueue.isEmpty()) { toClose = this.streams; this.streams = null; if (cancelFuture != null) cancelFuture.cancel(false); this.executor.shutdown(); } } try { listener.onClosing(this, code, reason); if (toClose != null) { listener.onClosed(this, code, reason); } } finally { closeQuietly(toClose); } }
public void stop() { try { if (start.compareAndSet(true, false)) { scheduledFuture.cancel(true); channelCheckExecutorService.shutdown(); offlineTaskTrackerScheduledFuture.cancel(true); offlineTaskTrackerCheckExecutorService.shutdown(); } LOGGER.info("Stop channel manager success!"); } catch (Throwable t) { LOGGER.error("Stop channel manager failed!", t); } }
private void stopExtendingTtl() { if (!ttlExtendTaskExecutor.isShutdown()) { ttlExtendTaskExecutor.shutdown(); } if (ttlExtendingFuture != null && !ttlExtendingFuture.isCancelled()) { logger.debug("Cancelling extending ttl..."); ttlExtendingFuture.cancel(true); } closeSilently(extendingApiClient); }