本文整理匯總了Java中io.netty.util.Timeout.isCancelled方法的典型用法代碼示例。如果您正苦於以下問題:Java Timeout.isCancelled方法的具體用法?Java Timeout.isCancelled怎麽用?Java Timeout.isCancelled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.netty.util.Timeout
的用法示例。
在下文中一共展示了Timeout.isCancelled方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] Batching the messages from the batch container from timer thread", topic,
producerName);
}
// semaphore acquired when message was enqueued to container
synchronized (ProducerImpl.this) {
batchMessageAndSend();
}
// schedule the next batch message task
client.timer().newTimeout(this, conf.getBatchingMaxPublishDelayMs(), TimeUnit.MILLISECONDS);
}
示例2: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
log.debug("Timeout occured for Session {}", id);
//Notify the listener that timeout has occured
final SessionValue session = sessionManager.getSession(id);
//Do not proceed if the session is null
if (session == null) {
log.error("could not find session value for id {}. Registry Size : {}", id, sessionManager.getSessionEntries().size());
return;
}
//Check first if the promise has been completed
if (session.getClientPromise() != null && !session.getClientPromise().isDone() && !session.getClientPromise().isCancelled() && !timeout.isCancelled()) {
//Send a ReadTimeoutException to the client
session.getClientPromise().completeExceptionally(new ReadTimeoutException(id, String.format("Timeout occured for '%s' Started: %f seconds ago", id, ((double) Duration.ofMillis(System.currentTimeMillis() - session.getTimeRegistered()).toMillis() / 1000.0))));
}
}
示例3: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (!ctx.channel().isOpen()) {
return;
}
if (!handler.isClientConnection &&
((handler.remoteNode == null ||
!handler.rpcService.isConnected(handler.remoteNode.
getNodeId()))))
ctx.fireExceptionCaught(EXCEPTION);
}
示例4: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (!ctx.channel().isOpen()) {
return;
}
ctx.channel().disconnect();
}
示例5: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (!ctx.channel().isOpen()) {
return;
}
if (channelHandler.syncManager.ready == false)
ctx.channel().disconnect();
}
示例6: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
if (!timeout.isCancelled()) {
log.warn("App handshake plugin for {} timed out. Returning result {}.",
sw, defaultResult);
exitPlugin(defaultResult);
}
}
示例7: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (!ctx.channel().isOpen()) {
return;
}
if (!handshakeHandler.isSwitchHandshakeComplete())
ctx.fireExceptionCaught(EXCEPTION);
}
示例8: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout to) {
if (!devices.isEmpty() && !to.isCancelled() && delay > 0) {
sendEvent(devices.get(Math.min(currentDevice, devices.size() - 1)));
currentDevice = (currentDevice + 1) % devices.size();
timeout = to.timer().newTimeout(to.task(), delay, TimeUnit.MILLISECONDS);
}
}
示例9: run
import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
if (stopped || timeout.isCancelled()) {
return;
}
log.trace("Collecting stats for {}", pcepTunnelId);
sendTunnelStatistic();
if (!stopped && !timeout.isCancelled()) {
log.trace("Scheduling stats collection in {} seconds for {}",
this.refreshInterval, pcepTunnelId);
timeout.timer().newTimeout(this, refreshInterval, TimeUnit.SECONDS);
}
}