io.netty.channel.EventLoop.isShuttingDown()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中io.netty.channel.EventLoop.isShuttingDown()方法的一些代码示例,展示了EventLoop.isShuttingDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EventLoop.isShuttingDown()方法的具体详情如下:
包路径:io.netty.channel.EventLoop
类名称:EventLoop
方法名:isShuttingDown

EventLoop.isShuttingDown介绍

暂无

代码示例

代码示例来源:origin: netty/netty

@Override
public boolean isShuttingDown() {
  for (EventLoop l: activeChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  for (EventLoop l: idleChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: redisson/redisson

@Override
public boolean isShuttingDown() {
  for (EventLoop l: activeChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  for (EventLoop l: idleChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: wildfly/wildfly

@Override
public boolean isShuttingDown() {
  for (EventLoop l: activeChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  for (EventLoop l: idleChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: line/armeria

@Override
public boolean isShuttingDown() {
  return delegate().isShuttingDown();
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

if (eventLoop != null && !eventLoop.isShuttingDown()) {
 if (FLUSHER_SCHEDULE_PERIOD_NS > 0) {
  eventLoop.schedule(this, FLUSHER_SCHEDULE_PERIOD_NS, TimeUnit.NANOSECONDS);

代码示例来源:origin: apache/activemq-artemis

@Override
public boolean isShuttingDown() {
  for (EventLoop l: activeChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  for (EventLoop l: idleChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public boolean isShuttingDown() {
  for (EventLoop l: activeChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  for (EventLoop l: idleChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

@Override
public boolean isShuttingDown() {
  for (EventLoop l: activeChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  for (EventLoop l: idleChildren) {
    if (!l.isShuttingDown()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: aadnk/ProtocolLib

@Override
public boolean isShuttingDown() {
  return getDelegate().isShuttingDown();
}

代码示例来源:origin: software.amazon.awssdk/netty-nio-client

@Override
public Future<Void> release(Channel channel, Promise<Void> promise) {
  doInEventLoop(channel.eventLoop(), () -> {
    boolean shouldCloseOnRelease = Boolean.TRUE.equals(channel.attr(ChannelAttributeKey.CLOSE_ON_RELEASE).get());
    if (shouldCloseOnRelease && channel.isOpen() && !channel.eventLoop().isShuttingDown()) {
      log.debug(() -> "Closing connection (" + channel.id() + "), instead of releasing it.");
      channel.close();
    }
    delegatePool.release(channel, promise);
  });
  return promise;
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver

if (eventLoop != null && !eventLoop.isShuttingDown()) {
  eventLoop.schedule(this, 10000, TimeUnit.NANOSECONDS);

代码示例来源:origin: net.oschina.durcframework/easyopen

/** 掉线 */
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
  final EventLoop eventLoop = ctx.channel().eventLoop();
  /*
   如果按下Ctrl+C,打印:isShutdown:false,isTerminated:false, isShuttingDown:true
   logger.info("isShutdown:{},isTerminated:{}, isShuttingDown:{}", eventLoop.isShutdown(), eventLoop.isTerminated(), eventLoop.isShuttingDown());
   正准备关闭,不需要再重启了
   */
  if (eventLoop.isShuttingDown()) {
    super.channelInactive(ctx);
    return;
  }
  logger.info("已断开与服务端的链接,尝试重连...");
  eventLoop.schedule(new Runnable() {
    @Override
    public void run() {
      nettyClient.reconnect(eventLoop);
    }
  }, 5L, TimeUnit.SECONDS);
  super.channelInactive(ctx);
}

代码示例来源:origin: com.yugabyte/cassandra-driver-core

if (eventLoop != null && !eventLoop.isShuttingDown()) {
  eventLoop.schedule(this, 10000, TimeUnit.NANOSECONDS);

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

if (eventLoop != null && !eventLoop.isShuttingDown()) {
  eventLoop.schedule(this, 10000, TimeUnit.NANOSECONDS);

代码示例来源:origin: org.apache.tajo/tajo-rpc-protobuf

private void doReconnect(final InetSocketAddress address, ChannelFuture future, int retries)
  throws ConnectException {
 for (; ; ) {
  if (maxRetryNum > retries) {
   retries++;
   if(getChannel().eventLoop().isShuttingDown()) {
    LOG.warn("RPC is shutting down");
    return;
   }
   LOG.warn(getErrorMessage(ExceptionUtils.getMessage(future.cause())) + "\nTry to reconnect : " + getKey().addr);
   try {
    Thread.sleep(RpcConstants.DEFAULT_PAUSE);
   } catch (InterruptedException e) {
   }
   this.channelFuture = doConnect(address).awaitUninterruptibly();
   if (this.channelFuture.isDone() && this.channelFuture.isSuccess()) {
    break;
   }
  } else {
   LOG.error("Max retry count has been exceeded. attempts=" + retries + " caused by: " + future.cause());
   throw makeConnectException(address, future);
  }
 }
}

代码示例来源:origin: apache/tajo

private void doReconnect(final InetSocketAddress address, ChannelFuture future, int retries)
  throws ConnectException {
 for (; ; ) {
  if (maxRetryNum > retries) {
   retries++;
   if(getChannel().eventLoop().isShuttingDown()) {
    LOG.warn("RPC is shutting down");
    return;
   }
   LOG.warn(getErrorMessage(ExceptionUtils.getMessage(future.cause())) + "\nTry to reconnect : " + getKey().addr);
   try {
    Thread.sleep(RpcConstants.DEFAULT_PAUSE);
   } catch (InterruptedException e) {
   }
   this.channelFuture = doConnect(address).awaitUninterruptibly();
   if (this.channelFuture.isDone() && this.channelFuture.isSuccess()) {
    break;
   }
  } else {
   LOG.error("Max retry count has been exceeded. attempts=" + retries + " caused by: " + future.cause());
   throw makeConnectException(address, future);
  }
 }
}

代码示例来源:origin: apache/tajo

if(getChannel().eventLoop().isShuttingDown()) {
 LOG.warn("RPC is shutting down");
 return;

代码示例来源:origin: org.apache.tajo/tajo-rpc-protobuf

if(getChannel().eventLoop().isShuttingDown()) {
 LOG.warn("RPC is shutting down");
 return;

相关文章