Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-515

Add convenience API org.apache.http.impl.nio.DefaultHttpServerIODispatch.create(T, SSLContext, ConnectionConfig, HttpRequestFactory)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.10
    • Component/s: HttpCore NIO
    • Labels:
      None

      Description

      Add convenience API org.apache.http.impl.nio.DefaultHttpServerIODispatch.create(T, SSLContext, ConnectionConfig, HttpRequestFactory):

           /**
           * Creates a new instance of this class to be used for dispatching I/O event
           * notifications to the given protocol handler.
           * 
           * @param eventHandler the server protocol handler.
           * @param sslContext an SSLContext or null (for a plain text connection.)
           * @param config a connection configuration
           * @param httpRequestFactory the request factory used by this object to generate {@link HttpRequest} instances. 
           * @return a new instance
           * @since 4.4.10
           */
          public static <T extends NHttpServerEventHandler> DefaultHttpServerIODispatch<T> create(final T eventHandler,
                  final SSLContext sslContext, final ConnectionConfig config, HttpRequestFactory httpRequestFactory) {
              final NHttpMessageParserFactory<HttpRequest> httpRequestParserFactory = new DefaultHttpRequestParserFactory(
                      null, httpRequestFactory);
              // @formatter:off
              return sslContext == null
                      ? new DefaultHttpServerIODispatch<T>(eventHandler,
                              new DefaultNHttpServerConnectionFactory(null, httpRequestParserFactory, null, config))
                      : new DefaultHttpServerIODispatch<T>(eventHandler,
                              new SSLNHttpServerConnectionFactory(sslContext, null, httpRequestParserFactory, null, config));
              // @formatter:om
          }
      

        Attachments

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              ggregory Gary D. Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: