d.inverno-http-server.1.6.2.source-code.module-info Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of inverno-http-server Show documentation
Show all versions of inverno-http-server Show documentation
Inverno HTTP 1.x/2 server module
/*
* Copyright 2020 Jeremy KUHN
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import io.netty.buffer.Unpooled;
import io.inverno.core.v1.Application;
import io.inverno.mod.base.Charsets;
import io.inverno.mod.http.base.Parameter;
/**
*
* The Inverno framework HTTP server module provides a HTTP1.x and HTTP/2 server.
*
*
*
* It defines the following sockets:
*
*
*
* - httpServerConfiguration
* - the HTTP server module configuration
* - netService (required)
* - the Net service used to create the HTTP server
* - resourceService (required)
* - the resource service used to load resources required by the HTTP server (eg. key store...)
* - controller
* - override the default HTTP server controller used to process server exchanges
* - headerCodecs
* - custom header codecs
* - parameterConverter
* - override the default parameter converter used in {@link Parameter} instances to convert their values
*
*
*
* It exposes the following beans:
*
*
*
* - httpServerConfiguration
* - the HTTP server module configuration
* - controller
* - the HTTP server controller
*
*
*
* A simple HTTP server using the default configuration can be started as follows:
*
*
* {@code
* NetService netService = ...;
* ResourceService resourceService = ...;
*
* Application.with(new Server.Builder(netService, resourceService)
* .setHttpServerConfiguration(HttpServerConfigurationLoader.load(conf -> conf.server_port(8080)))
* .setController(ServerController.from(
* exchange -> exchange
* .response()
* .body()
* .raw()
* .value(Unpooled.unreleasableBuffer(Unpooled.copiedBuffer("Hello, world!", Charsets.DEFAULT)))
* ))
* ).run();
* }
*
* @author Jeremy Kuhn
* @since 1.0
*/
@io.inverno.core.annotation.Module
module io.inverno.mod.http.server {
requires io.inverno.core;
requires static io.inverno.core.annotation; // for javadoc...
requires transitive io.inverno.mod.base;
requires io.inverno.mod.configuration;
requires transitive io.inverno.mod.http.base;
requires org.apache.commons.text;
requires org.apache.logging.log4j;
requires jdk.unsupported; // required by netty for low level API for accessing direct buffers
requires transitive reactor.core;
requires transitive org.reactivestreams;
requires transitive io.netty.buffer;
requires io.netty.common;
requires io.netty.codec;
requires io.netty.codec.http;
requires io.netty.codec.http2;
requires io.netty.handler;
requires static com.aayushatharva.brotli4j;
exports io.inverno.mod.http.server;
exports io.inverno.mod.http.server.ws;
}