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

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

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

Connection.setProcessor介绍

[英]Sets the default Processor, which will process ConnectionI/O events. If Processor is null, - then Transport will try to get Processor using Connection's ProcessorSelector#select(IOEvent,Connection). If ProcessorSelector, associated withthe Connection is also null - Transport will try to get Processorusing own settings.
[中]设置将处理ConnectionI/O事件的默认处理器。如果Processor为null,-则传输将尝试使用连接的ProcessorSelector#select(IOEvent,Connection)获取处理器。如果与连接关联的ProcessorSelector也为null,则传输将尝试使用自己的设置获取ProcessorSelector。

代码示例

代码示例来源:origin: org.forgerock.ce.opendj/opendj-ldap-sdk

/**
 * Installs a new Grizzly filter (e.g. SSL/SASL) beneath the top-level
 * LDAP filter.
 *
 * @param filter
 *            The filter to be installed.
 */
private void installFilter(final Filter filter) {
  // Determine the index where the filter should be added.
  final FilterChain oldFilterChain = (FilterChain) connection.getProcessor();
  int filterIndex = oldFilterChain.size() - 1;
  if (filter instanceof SSLFilter) {
    // Beneath any ConnectionSecurityLayerFilters if present,
    // otherwise beneath the LDAP filter.
    for (int i = oldFilterChain.size() - 2; i >= 0; i--) {
      if (!(oldFilterChain.get(i) instanceof ConnectionSecurityLayerFilter)) {
        filterIndex = i + 1;
        break;
      }
    }
  }
  // Create the new filter chain.
  final FilterChain newFilterChain =
      FilterChainBuilder.stateless().addAll(oldFilterChain).add(filterIndex, filter)
          .build();
  connection.setProcessor(newFilterChain);
}

代码示例来源:origin: org.forgerock.ce.opendj/opendj-ldap-sdk

/**
 * Installs a new Grizzly filter (e.g. SSL/SASL) beneath the top-level LDAP
 * filter.
 *
 * @param filter
 *            The filter to be installed.
 */
void installFilter(final Filter filter) {
  synchronized (stateLock) {
    // Determine the index where the filter should be added.
    final FilterChain oldFilterChain = (FilterChain) connection.getProcessor();
    int filterIndex = oldFilterChain.size() - 1;
    if (filter instanceof SSLFilter) {
      // Beneath any ConnectionSecurityLayerFilters if present,
      // otherwise beneath the LDAP filter.
      for (int i = oldFilterChain.size() - 2; i >= 0; i--) {
        if (!(oldFilterChain.get(i) instanceof ConnectionSecurityLayerFilter)) {
          filterIndex = i + 1;
          break;
        }
      }
    }
    // Create the new filter chain.
    final FilterChain newFilterChain =
        FilterChainBuilder.stateless().addAll(oldFilterChain).add(filterIndex, filter)
            .build();
    connection.setProcessor(newFilterChain);
  }
}

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

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

connection.setProcessor(connectionFilterChain);

相关文章