public void start(final HttpProcessor httpProcessor, final Decorator<HttpServerRequestHandler> handlerDecorator) throws IOException { if (serverRef.get() == null) { final HttpServerRequestHandler handler = new BasicHttpServerRequestHandler(registry); final HttpService httpService = new HttpService( httpProcessor != null ? httpProcessor : HttpProcessors.server(), handlerDecorator != null ? handlerDecorator.decorate(handler) : new BasicHttpServerExpectationDecorator(handler), DefaultConnectionReuseStrategy.INSTANCE, LoggingHttp1StreamListener.INSTANCE); final HttpServer server = new HttpServer( 0, httpService, null, socketConfig, sslContext != null ? sslContext.getServerSocketFactory() : ServerSocketFactory.getDefault(), new DefaultBHttpServerConnectionFactory( sslContext != null ? URIScheme.HTTPS.id : URIScheme.HTTP.id, H1Config.DEFAULT, CharCodingConfig.DEFAULT), null, LoggingExceptionListener.INSTANCE); if (serverRef.compareAndSet(null, server)) { server.start(); } } else { throw new IllegalStateException("Server already running"); } }
public void start(final HttpProcessor httpProcessor, final Decorator<HttpServerRequestHandler> handlerDecorator) throws IOException { if (serverRef.get() == null) { final HttpServerRequestHandler handler = new BasicHttpServerRequestHandler(registry); final HttpService httpService = new HttpService( httpProcessor != null ? httpProcessor : HttpProcessors.server(), handlerDecorator != null ? handlerDecorator.decorate(handler) : new BasicHttpServerExpectationDecorator(handler), DefaultConnectionReuseStrategy.INSTANCE, LoggingHttp1StreamListener.INSTANCE); final HttpServer server = new HttpServer( 0, httpService, null, socketConfig, sslContext != null ? sslContext.getServerSocketFactory() : ServerSocketFactory.getDefault(), new DefaultBHttpServerConnectionFactory( sslContext != null ? URIScheme.HTTPS.id : URIScheme.HTTP.id, H1Config.DEFAULT, CharCodingConfig.DEFAULT), null, LoggingExceptionListener.INSTANCE); if (serverRef.compareAndSet(null, server)) { server.start(); } } else { throw new IllegalStateException("Server already running"); } }
this.socketConfig = socketConfig != null ? socketConfig : SocketConfig.DEFAULT; this.serverSocketFactory = serverSocketFactory != null ? serverSocketFactory : ServerSocketFactory.getDefault(); this.connectionFactory = connectionFactory != null ? connectionFactory : new DefaultBHttpServerConnectionFactory( this.serverSocketFactory instanceof SSLServerSocketFactory ? URIScheme.HTTPS.id : URIScheme.HTTP.id, H1Config.DEFAULT,
this.socketConfig = socketConfig != null ? socketConfig : SocketConfig.DEFAULT; this.serverSocketFactory = serverSocketFactory != null ? serverSocketFactory : ServerSocketFactory.getDefault(); this.connectionFactory = connectionFactory != null ? connectionFactory : new DefaultBHttpServerConnectionFactory( this.serverSocketFactory instanceof SSLServerSocketFactory ? URIScheme.HTTPS.id : URIScheme.HTTP.id, H1Config.DEFAULT,
if (connectionFactoryCopy == null) { final String scheme = serverSocketFactoryCopy instanceof SSLServerSocketFactory ? URIScheme.HTTPS.id : URIScheme.HTTP.id; connectionFactoryCopy = new DefaultBHttpServerConnectionFactory(scheme, this.h1Config, this.charCodingConfig);
if (connectionFactoryCopy == null) { final String scheme = serverSocketFactoryCopy instanceof SSLServerSocketFactory ? URIScheme.HTTPS.id : URIScheme.HTTP.id; connectionFactoryCopy = new DefaultBHttpServerConnectionFactory(scheme, this.h1Config, this.charCodingConfig);