@Override public BoxedUnit apply() { timeout.cancel(); return null; } });
private void cancelHandshakeTimeout() { if (handshakeTimeout != null) { // cancel the task as we will fail the handshake future now handshakeTimeout.cancel(); } }
public void operationComplete(ChannelFuture future) throws Exception { timeout.cancel(); } }
private static void destroy(ChannelHandlerContext ctx) { State state = state(ctx); synchronized (state) { if (state.state != 1) { return; } state.state = 2; } if (state.readerIdleTimeout != null) { state.readerIdleTimeout.cancel(); state.readerIdleTimeout = null; } if (state.writerIdleTimeout != null) { state.writerIdleTimeout.cancel(); state.writerIdleTimeout = null; } if (state.allIdleTimeout != null) { state.allIdleTimeout.cancel(); state.allIdleTimeout = null; } }
public void close() { closed = true; Timeout task = periodicHandshakeTask; if (null != task) { task.cancel(); } for (ProxyClient sc : address2Services.values()) { sc.close(); } } }
public void releaseExternalResources() { if (trafficCounter != null) { trafficCounter.stop(); } release.set(true); if (timeout != null) { timeout.cancel(); } //shall be done outside (since it can be shared): timer.stop(); }
private static void destroy(ChannelHandlerContext ctx) { State state = state(ctx); synchronized (state) { if (state.state != 1) { return; } state.state = 2; } if (state.timeout != null) { state.timeout.cancel(); state.timeout = null; } }
@Override public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { if (trafficCounter != null) { trafficCounter.stop(); } synchronized (this) { messagesQueue.clear(); } if (writeTimeout != null) { writeTimeout.cancel(); } super.channelClosed(ctx, e); }
private static void connect(SelectionKey k) throws IOException { NioClientSocketChannel ch = (NioClientSocketChannel) k.attachment(); try { if (ch.channel.finishConnect()) { k.cancel(); if (ch.timoutTimer != null) { ch.timoutTimer.cancel(); } ch.worker.register(ch, ch.connectFuture); } } catch (ConnectException e) { ConnectException newE = new ConnectException(e.getMessage() + ": " + ch.requestedRemoteAddress); newE.setStackTrace(e.getStackTrace()); throw newE; } }
/** * Stop the monitoring process. */ @Override public synchronized void stop() { if (!monitorActive) { return; } monitorActive = false; resetAccounting(milliSecondFromNano()); trafficShapingHandler.doAccounting(this); if (timeout != null) { timeout.cancel(); } }
/** * Stop the monitoring process. */ public void stop() { if (!monitorActive) { return; } monitorActive = false; resetAccounting(milliSecondFromNano()); if (trafficShapingHandler != null) { trafficShapingHandler.doAccounting(this); } if (timeout != null) { timeout.cancel(); } }
@Override public void releaseExternalResources() { Channel channel = ctx.getChannel(); synchronized (this) { if (ctx != null && ctx.getChannel().isConnected()) { for (ToSend toSend : messagesQueue) { if (! channel.isConnected()) { // ignore break; } ctx.sendDownstream(toSend.toSend); } } messagesQueue.clear(); } if (writeTimeout != null) { writeTimeout.cancel(); } super.releaseExternalResources(); }
public void cancel() { if (cancelled.compareAndSet(false, true)) { if (requestTimeout != null) { requestTimeout.cancel(); RequestTimeoutTimerTask.class.cast(requestTimeout.getTask()).clean(); requestTimeout = null; } if (readTimeout != null) { readTimeout.cancel(); ReadTimeoutTimerTask.class.cast(readTimeout.getTask()).clean(); readTimeout = null; } } } }
@Override public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { if (timeout != null) { timeout.cancel(); timeout = null; } }
/** * Stops the host monitor. */ void shutdown() { synchronized (this) { if (timeout != null) { timeout.cancel(); timeout = null; } } }
private boolean cancelTimeout(long id) { TimeoutHolder holder = timeouts.remove(id); if (holder != null) { holder.timeout.cancel(); return true; } else { return false; } }
public void close() { closed = true; Timeout task = periodicHandshakeTask; if (null != task) { task.cancel(); } for (ProxyClient sc : address2Services.values()) { sc.close(); } } }
private void cleanupState() { timeoutExecutor.stop(); channel.close(); if (timeout != null) { timeout.cancel(); } }
public StateMachine.State handleEvent(TimestampRequestTimeoutEvent e) { if (!timestampRequests.isEmpty()) { RequestAndTimeout r = timestampRequests.remove(); if (r.getTimeout() != null) { r.getTimeout().cancel(); } queueRetryOrError(fsm, r.getRequest()); } return this; }
public StateMachine.State handleEvent(CommitRequestTimeoutEvent e) { long startTimestamp = e.getStartTimestamp(); if (commitRequests.containsKey(startTimestamp)) { RequestAndTimeout r = commitRequests.remove(startTimestamp); if (r.getTimeout() != null) { r.getTimeout().cancel(); } queueRetryOrError(fsm, r.getRequest()); } return this; }