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

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

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

EventLoop.isShutdown介绍

暂无

代码示例

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

  1. @Override
  2. public boolean isShutdown() {
  3. for (EventLoop l: activeChildren) {
  4. if (!l.isShutdown()) {
  5. return false;
  6. }
  7. }
  8. for (EventLoop l: idleChildren) {
  9. if (!l.isShutdown()) {
  10. return false;
  11. }
  12. }
  13. return true;
  14. }

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

  1. @Override
  2. public boolean isShutdown() {
  3. for (EventLoop l: activeChildren) {
  4. if (!l.isShutdown()) {
  5. return false;
  6. }
  7. }
  8. for (EventLoop l: idleChildren) {
  9. if (!l.isShutdown()) {
  10. return false;
  11. }
  12. }
  13. return true;
  14. }

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

  1. @Override
  2. public boolean isShutdown() {
  3. for (EventLoop l: activeChildren) {
  4. if (!l.isShutdown()) {
  5. return false;
  6. }
  7. }
  8. for (EventLoop l: idleChildren) {
  9. if (!l.isShutdown()) {
  10. return false;
  11. }
  12. }
  13. return true;
  14. }

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

  1. @Override
  2. public boolean isShutdown() {
  3. for (EventLoop l: activeChildren) {
  4. if (!l.isShutdown()) {
  5. return false;
  6. }
  7. }
  8. for (EventLoop l: idleChildren) {
  9. if (!l.isShutdown()) {
  10. return false;
  11. }
  12. }
  13. return true;
  14. }

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

  1. @Override
  2. public boolean isShutdown() {
  3. for (EventLoop l: activeChildren) {
  4. if (!l.isShutdown()) {
  5. return false;
  6. }
  7. }
  8. for (EventLoop l: idleChildren) {
  9. if (!l.isShutdown()) {
  10. return false;
  11. }
  12. }
  13. return true;
  14. }

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

  1. @Override
  2. public boolean isShutdown() {
  3. for (EventLoop l: activeChildren) {
  4. if (!l.isShutdown()) {
  5. return false;
  6. }
  7. }
  8. for (EventLoop l: idleChildren) {
  9. if (!l.isShutdown()) {
  10. return false;
  11. }
  12. }
  13. return true;
  14. }

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

  1. @Override
  2. public boolean isShutdown() {
  3. return getDelegate().isShutdown();
  4. }

代码示例来源:origin: apache/servicemix-bundles

  1. @Override
  2. public void sendMessage(BytesReference reference, ActionListener<Void> listener) {
  3. ChannelPromise writePromise = channel.newPromise();
  4. writePromise.addListener(f -> {
  5. if (f.isSuccess()) {
  6. listener.onResponse(null);
  7. } else {
  8. final Throwable cause = f.cause();
  9. Netty4Utils.maybeDie(cause);
  10. assert cause instanceof Exception;
  11. listener.onFailure((Exception) cause);
  12. }
  13. });
  14. channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise);
  15. if (channel.eventLoop().isShutdown()) {
  16. listener.onFailure(new TransportException("Cannot send message, event loop is shutting down."));
  17. }
  18. }

代码示例来源:origin: com.strapdata.elasticsearch.plugin/transport-netty4

  1. @Override
  2. public void sendMessage(BytesReference reference, ActionListener<Void> listener) {
  3. ChannelPromise writePromise = channel.newPromise();
  4. writePromise.addListener(f -> {
  5. if (f.isSuccess()) {
  6. listener.onResponse(null);
  7. } else {
  8. final Throwable cause = f.cause();
  9. Netty4Utils.maybeDie(cause);
  10. assert cause instanceof Exception;
  11. listener.onFailure((Exception) cause);
  12. }
  13. });
  14. channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise);
  15. if (channel.eventLoop().isShutdown()) {
  16. listener.onFailure(new TransportException("Cannot send message, event loop is shutting down."));
  17. }
  18. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  1. @Override
  2. public void sendMessage(BytesReference reference, ActionListener<Void> listener) {
  3. ChannelPromise writePromise = channel.newPromise();
  4. writePromise.addListener(f -> {
  5. if (f.isSuccess()) {
  6. listener.onResponse(null);
  7. } else {
  8. final Throwable cause = f.cause();
  9. ExceptionsHelper.maybeDieOnAnotherThread(cause);
  10. assert cause instanceof Exception;
  11. listener.onFailure((Exception) cause);
  12. }
  13. });
  14. channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise);
  15. if (channel.eventLoop().isShutdown()) {
  16. listener.onFailure(new TransportException("Cannot send message, event loop is shutting down."));
  17. }
  18. }

代码示例来源:origin: org.elasticsearch.plugin/transport-netty4-client

  1. @Override
  2. public void sendMessage(BytesReference reference, ActionListener<Void> listener) {
  3. ChannelPromise writePromise = channel.newPromise();
  4. writePromise.addListener(f -> {
  5. if (f.isSuccess()) {
  6. listener.onResponse(null);
  7. } else {
  8. final Throwable cause = f.cause();
  9. ExceptionsHelper.maybeDieOnAnotherThread(cause);
  10. if (cause instanceof Error) {
  11. listener.onFailure(new Exception(cause));
  12. } else {
  13. listener.onFailure((Exception) cause);
  14. }
  15. }
  16. });
  17. channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise);
  18. if (channel.eventLoop().isShutdown()) {
  19. listener.onFailure(new TransportException("Cannot send message, event loop is shutting down."));
  20. }
  21. }

相关文章