org.glassfish.grizzly.Connection.isOpen()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(147)

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

Connection.isOpen介绍

[英]Is Connection open and ready. Returns true, if connection is open and ready, or false otherwise.
[中]连接已打开并准备就绪。如果连接已打开并准备就绪,则返回true,否则返回false。

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
public boolean isConnected() {
  return connection.isOpen();
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public boolean isConnected() {
  return connection.isOpen();
}

代码示例来源:origin: apache/incubator-dubbo

static void removeChannelIfDisconnected(Connection<?> connection) {
  if (connection != null && !connection.isOpen()) {
    ATTRIBUTE.remove(connection);
  }
}

代码示例来源:origin: apache/incubator-dubbo

static void removeChannelIfDisconnected(Connection<?> connection) {
  if (connection != null && !connection.isOpen()) {
    ATTRIBUTE.remove(connection);
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
protected Channel getChannel() {
  Connection<?> c = connection;
  if (c == null || !c.isOpen()) {
    return null;
  }
  return GrizzlyChannel.getOrAddChannel(c, getUrl(), this);
}

代码示例来源:origin: apache/incubator-dubbo

@Override
protected Channel getChannel() {
  Connection<?> c = connection;
  if (c == null || !c.isOpen()) {
    return null;
  }
  return GrizzlyChannel.getOrAddChannel(c, getUrl(), this);
}

代码示例来源:origin: apache/incubator-dubbo

static GrizzlyChannel getOrAddChannel(Connection<?> connection, URL url, ChannelHandler handler) {
  if (connection == null) {
    return null;
  }
  GrizzlyChannel ret = ATTRIBUTE.get(connection);
  if (ret == null) {
    ret = new GrizzlyChannel(connection, url, handler);
    if (connection.isOpen()) {
      ATTRIBUTE.set(connection, ret);
    }
  }
  return ret;
}

代码示例来源:origin: apache/incubator-dubbo

static GrizzlyChannel getOrAddChannel(Connection<?> connection, URL url, ChannelHandler handler) {
  if (connection == null) {
    return null;
  }
  GrizzlyChannel ret = ATTRIBUTE.get(connection);
  if (ret == null) {
    ret = new GrizzlyChannel(connection, url, handler);
    if (connection.isOpen()) {
      ATTRIBUTE.set(connection, ret);
    }
  }
  return ret;
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

if (!response.getRequest().getRequest().getConnection().isOpen()) {
  LOG.debug("Consumer connection was closed. It will be removed.");
  return false;

代码示例来源:origin: com.alibaba/dubbo

static void removeChannelIfDisconnected(Connection<?> connection) {
  if (connection != null && !connection.isOpen()) {
    ATTRIBUTE.remove(connection);
  }
}

代码示例来源:origin: com.alibaba/dubbo-remoting-grizzly

static void removeChannelIfDisconnected(Connection<?> connection) {
  if (connection != null && !connection.isOpen()) {
    ATTRIBUTE.remove(connection);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
protected Channel getChannel() {
  Connection<?> c = connection;
  if (c == null || !c.isOpen())
    return null;
  return GrizzlyChannel.getOrAddChannel(c, getUrl(), this);
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

@Override
public boolean doWork(final Connection connection) {
  if (connection.isOpen()) {
    if (handler != null) {
      handler.onTimeout(connection);
    }
    connection.closeSilently();
  }
  return true;
}

代码示例来源:origin: javaee/grizzly

@Override
public boolean doWork(final Connection connection) {
  if (connection.isOpen()) {
    if (handler != null) {
      handler.onTimeout(connection);
    }
    connection.closeSilently();
  }
  return true;
}

代码示例来源:origin: org.apache.dubbo/dubbo-remoting-grizzly

@Override
protected Channel getChannel() {
  Connection<?> c = connection;
  if (c == null || !c.isOpen()) {
    return null;
  }
  return GrizzlyChannel.getOrAddChannel(c, getUrl(), this);
}

代码示例来源:origin: javaee/grizzly

@Override
public boolean doWork(final Connection connection) {
  if (connection.isOpen()) {
    if (handler != null) {
      handler.onTimeout(connection);
    }
    connection.closeSilently();
  }
  return true;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-core

@Override
public boolean doWork(final Connection connection) {
  if (connection.isOpen()) {
    if (handler != null) {
      handler.onTimeout(connection);
    }
    connection.closeSilently();
  }
  return true;
}

代码示例来源:origin: javaee/grizzly

@Override
public boolean doWork(final Connection connection) {
  if (connection.isOpen()) {
    if (handler != null) {
      handler.onTimeout(connection);
    }
    connection.closeSilently();
  }
  return true;
}

代码示例来源:origin: org.mule.services/mule-service-http

@Test
public void failedTaskAvoidsResponse() {
 when(connection.isOpen()).thenReturn(false);
 getHandler().failed(new IOException(ERROR));
 verify(callback, never()).responseSendFailure(any(Throwable.class));
}

代码示例来源:origin: org.mule.services/mule-service-http

@Test
public void cancelledTaskResponse() {
 when(connection.isOpen()).thenReturn(true);
 getHandler().cancelled();
 verify(callback, atLeastOnce()).responseSendFailure(any(Throwable.class));
}

相关文章