Package io.undertow.server.protocol.http
Class AlpnOpenListener
- java.lang.Object
-
- io.undertow.server.protocol.http.AlpnOpenListener
-
- All Implemented Interfaces:
OpenListener,EventListener,org.xnio.ChannelListener<org.xnio.StreamConnection>
public class AlpnOpenListener extends Object implements org.xnio.ChannelListener<org.xnio.StreamConnection>, OpenListener
Open listener adaptor for ALPN connections Not a proper open listener as such, but more a mechanism for selecting between them. The implementation delegates betweenJDK9AlpnOpenListenerandJettyAlpnOpenListenerbased on the current JDK version.- Author:
- Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description AlpnOpenListener(ByteBufferPool bufferPool)AlpnOpenListener(ByteBufferPool bufferPool, org.xnio.OptionMap undertowOptions)AlpnOpenListener(ByteBufferPool bufferPool, org.xnio.OptionMap undertowOptions, DelegateOpenListener httpListener)AlpnOpenListener(ByteBufferPool bufferPool, org.xnio.OptionMap undertowOptions, String fallbackProtocol, DelegateOpenListener fallbackListener)AlpnOpenListener(org.xnio.Pool<ByteBuffer> bufferPool, org.xnio.OptionMap undertowOptions)AlpnOpenListener(org.xnio.Pool<ByteBuffer> bufferPool, org.xnio.OptionMap undertowOptions, DelegateOpenListener httpListener)AlpnOpenListener(org.xnio.Pool<ByteBuffer> bufferPool, org.xnio.OptionMap undertowOptions, String fallbackProtocol, DelegateOpenListener fallbackListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AlpnOpenListeneraddProtocol(String name, DelegateOpenListener listener, int weight)ByteBufferPoolgetBufferPool()ConnectorStatisticsgetConnectorStatistics()HttpHandlergetRootHandler()org.xnio.OptionMapgetUndertowOptions()voidhandleEvent(org.xnio.StreamConnection channel)voidsetRootHandler(HttpHandler rootHandler)Sets the root handlervoidsetUndertowOptions(org.xnio.OptionMap undertowOptions)
-
-
-
Constructor Detail
-
AlpnOpenListener
public AlpnOpenListener(org.xnio.Pool<ByteBuffer> bufferPool, org.xnio.OptionMap undertowOptions, DelegateOpenListener httpListener)
-
AlpnOpenListener
public AlpnOpenListener(org.xnio.Pool<ByteBuffer> bufferPool, org.xnio.OptionMap undertowOptions)
-
AlpnOpenListener
public AlpnOpenListener(org.xnio.Pool<ByteBuffer> bufferPool, org.xnio.OptionMap undertowOptions, String fallbackProtocol, DelegateOpenListener fallbackListener)
-
AlpnOpenListener
public AlpnOpenListener(ByteBufferPool bufferPool, org.xnio.OptionMap undertowOptions, DelegateOpenListener httpListener)
-
AlpnOpenListener
public AlpnOpenListener(ByteBufferPool bufferPool)
-
AlpnOpenListener
public AlpnOpenListener(ByteBufferPool bufferPool, org.xnio.OptionMap undertowOptions)
-
AlpnOpenListener
public AlpnOpenListener(ByteBufferPool bufferPool, org.xnio.OptionMap undertowOptions, String fallbackProtocol, DelegateOpenListener fallbackListener)
-
-
Method Detail
-
getRootHandler
public HttpHandler getRootHandler()
- Specified by:
getRootHandlerin interfaceOpenListener- Returns:
- The first handler that will be executed by requests on the connector
-
setRootHandler
public void setRootHandler(HttpHandler rootHandler)
Description copied from interface:OpenListenerSets the root handler- Specified by:
setRootHandlerin interfaceOpenListener- Parameters:
rootHandler- The new root handler
-
getUndertowOptions
public org.xnio.OptionMap getUndertowOptions()
- Specified by:
getUndertowOptionsin interfaceOpenListener- Returns:
- The connector options
-
setUndertowOptions
public void setUndertowOptions(org.xnio.OptionMap undertowOptions)
- Specified by:
setUndertowOptionsin interfaceOpenListener- Parameters:
undertowOptions- The connector options
-
getBufferPool
public ByteBufferPool getBufferPool()
- Specified by:
getBufferPoolin interfaceOpenListener- Returns:
- The buffer pool in use by this connector
-
getConnectorStatistics
public ConnectorStatistics getConnectorStatistics()
- Specified by:
getConnectorStatisticsin interfaceOpenListener- Returns:
- The connector statistics, or null if statistics gathering is disabled.
-
addProtocol
public AlpnOpenListener addProtocol(String name, DelegateOpenListener listener, int weight)
-
handleEvent
public void handleEvent(org.xnio.StreamConnection channel)
- Specified by:
handleEventin interfaceorg.xnio.ChannelListener<org.xnio.StreamConnection>
-
-