Interface ConnectionFactory
- All Known Subinterfaces:
ConnectionFactory.Configuring, ConnectionFactory.Detecting, ConnectionFactory.Upgrading
- All Known Implementing Classes:
AbstractConnectionFactory, AbstractHTTP2ServerConnectionFactory, AbstractHTTP3ServerConnectionFactory, ALPNServerConnectionFactory, DetectorConnectionFactory, HTTP2CServerConnectionFactory, HTTP2ServerConnectionFactory, HTTP3ServerConnectionFactory, HttpConnectionFactory, NegotiatingServerConnectionFactory, OptionalSslConnectionFactory, ProxyConnectionFactory, QuicServerConnectionFactory, RawHTTP2ServerConnectionFactory, RawHTTP3ServerConnectionFactory, ServerDocs.JSONHTTPConnectionFactory, ServerFCGIConnectionFactory, SslConnectionFactory
public interface ConnectionFactory
A Factory to create
Connection instances for Connectors.
A Connection factory is responsible for instantiating and configuring a Connection instance
to handle an EndPoint accepted by a Connector.
A ConnectionFactory has a protocol name that represents the protocol of the Connections created. Example of protocol names include:
- http
- Creates an HTTP connection that can handle multiple versions of HTTP from 0.9 to 1.1
- h2
- Creates an HTTP/2 connection that handles the HTTP/2 protocol
- SSL-XYZ
- Create an SSL connection chained to a connection obtained from a connection factory with a protocol "XYZ".
- SSL-http
- Create an SSL connection chained to an HTTP connection (aka https)
- SSL-ALPN
- Create an SSL connection chained to a ALPN connection, that uses a negotiation with the client to determine the next protocol.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA ConnectionFactory that can configure the connector.static interfaceConnections created by this factory MUST implementConnection.UpgradeTo.static interface -
Method Summary
Modifier and TypeMethodDescriptionnewConnection(Connector connector, EndPoint endPoint) Creates a newConnectionwith the given parameters
-
Method Details
-
getProtocol
String getProtocol()- Returns:
- A string representing the primary protocol name.
-
getProtocols
-
newConnection
Creates a new
Connectionwith the given parameters- Parameters:
connector- TheConnectorcreating this connectionendPoint- theEndPointassociated with the connection- Returns:
- a new
Connection
-