Top Description Fields Constructors Methods
io.undertow.server.protocol.http

public final Class HttpOpenListener

extends Object
implements ChannelListener<StreamConnection>, DelegateOpenListener
Class Inheritance
All Implemented Interfaces
io.undertow.server.DelegateOpenListener, io.undertow.server.OpenListener, org.xnio.ChannelListener, java.util.EventListener
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.Collections, .Set, java.util.concurrent.ConcurrentHashMap, org.xnio.ChannelListener, .IoUtils, .OptionMap, .Options, .Pool, .StreamConnection, io.undertow.UndertowLogger, .UndertowMessages, .UndertowOptions, io.undertow.conduits.BytesReceivedStreamSourceConduit, .BytesSentStreamSinkConduit, .IdleTimeoutConduit, .ReadTimeoutStreamSourceConduit, .WriteTimeoutStreamSinkConduit, io.undertow.connector.ByteBufferPool, .PooledByteBuffer, io.undertow.server.ConnectorStatistics, .ConnectorStatisticsImpl, .DelegateOpenListener, .HttpHandler, .ServerConnection, .XnioByteBufferPool

Open listener for HTTP server. XNIO should be set up to chain the accept handler to post-accept open listeners to this listener which actually initiates HTTP parsing.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private final ByteBufferPool
private final int
private final Set<HttpServerConnection>
private final ConnectorStatisticsImpl
private volatile HttpRequestParser
private volatile HttpHandler
private volatile boolean
private volatile OptionMap

Constructor Summary

AccessConstructor and Description
public
HttpOpenListener(final Pool<ByteBuffer> pool)
Deprecated

public
HttpOpenListener(final Pool<ByteBuffer> pool, final OptionMap undertowOptions)
Deprecated

public
public
HttpOpenListener(final ByteBufferPool pool, final OptionMap undertowOptions)

Method Summary

Modifier and TypeMethod and Description
public void
closeConnections()

Overrides default io.undertow.server.OpenListener.closeConnections.

Close all active connections that were handled by this listener

public ByteBufferPool
public ConnectorStatistics
public HttpHandler
public OptionMap
public void
handleEvent(StreamConnection
the channel event
channel
)

Implements org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

public void
handleEvent(final StreamConnection
The channel
channel
,
PooledByteBuffer
Any additional data that was read from the stream as part of the handshake process
buffer
)

Implements io.undertow.server.DelegateOpenListener.handleEvent.

public void
setRootHandler(final HttpHandler
The new root handler
rootHandler
)

Implements io.undertow.server.OpenListener.setRootHandler.

Sets the root handler

public void
setUndertowOptions(final OptionMap
The connector options
undertowOptions
)

Implements io.undertow.server.OpenListener.setUndertowOptions.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferPoolback to summary
private final ByteBufferPool bufferPool
bufferSizeback to summary
private final int bufferSize
connectionsback to summary
private final Set<HttpServerConnection> connections
connectorStatisticsback to summary
private final ConnectorStatisticsImpl connectorStatistics
parserback to summary
private volatile HttpRequestParser parser
rootHandlerback to summary
private volatile HttpHandler rootHandler
statisticsEnabledback to summary
private volatile boolean statisticsEnabled
undertowOptionsback to summary
private volatile OptionMap undertowOptions

Constructor Detail

HttpOpenListenerback to summary
public HttpOpenListener(final Pool<ByteBuffer> pool)

Deprecated

Annotations
@Deprecated
HttpOpenListenerback to summary
public HttpOpenListener(final Pool<ByteBuffer> pool, final OptionMap undertowOptions)

Deprecated

Annotations
@Deprecated
HttpOpenListenerback to summary
public HttpOpenListener(final ByteBufferPool pool)
HttpOpenListenerback to summary
public HttpOpenListener(final ByteBufferPool pool, final OptionMap undertowOptions)

Method Detail

closeConnectionsback to summary
public void closeConnections()

Overrides default io.undertow.server.OpenListener.closeConnections.

Doc from io.undertow.server.OpenListener.closeConnections.

Close all active connections that were handled by this listener

Annotations
@Override
getBufferPoolback to summary
public ByteBufferPool getBufferPool()

Implements io.undertow.server.OpenListener.getBufferPool.

Returns:ByteBufferPool

Doc from io.undertow.server.OpenListener.getBufferPool.

The buffer pool in use by this connector

Annotations
@Override
getConnectorStatisticsback to summary
public ConnectorStatistics getConnectorStatistics()

Implements io.undertow.server.OpenListener.getConnectorStatistics.

Returns:ConnectorStatistics

Doc from io.undertow.server.OpenListener.getConnectorStatistics.

The connector statistics, or null if statistics gathering is disabled.

Annotations
@Override
getRootHandlerback to summary
public HttpHandler getRootHandler()

Implements io.undertow.server.OpenListener.getRootHandler.

Returns:HttpHandler

Doc from io.undertow.server.OpenListener.getRootHandler.

The first handler that will be executed by requests on the connector

Annotations
@Override
getUndertowOptionsback to summary
public OptionMap getUndertowOptions()

Implements io.undertow.server.OpenListener.getUndertowOptions.

Returns:OptionMap

Doc from io.undertow.server.OpenListener.getUndertowOptions.

The connector options

Annotations
@Override
handleEventback to summary
public void handleEvent(StreamConnection channel)

Implements org.xnio.ChannelListener.handleEvent.

Doc from org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

Parameters
channel:StreamConnection

the channel event

Annotations
@Override
handleEventback to summary
public void handleEvent(final StreamConnection channel, PooledByteBuffer buffer)

Implements io.undertow.server.DelegateOpenListener.handleEvent.

Parameters
channel:StreamConnection

Doc from io.undertow.server.DelegateOpenListener.handleEvent.

The channel

buffer:PooledByteBuffer

Doc from io.undertow.server.DelegateOpenListener.handleEvent.

Any additional data that was read from the stream as part of the handshake process

Annotations
@Override
setRootHandlerback to summary
public void setRootHandler(final HttpHandler rootHandler)

Implements io.undertow.server.OpenListener.setRootHandler.

Doc from io.undertow.server.OpenListener.setRootHandler.

Sets the root handler

Parameters
rootHandler:HttpHandler

The new root handler

Annotations
@Override
setUndertowOptionsback to summary
public void setUndertowOptions(final OptionMap undertowOptions)

Implements io.undertow.server.OpenListener.setUndertowOptions.

Parameters
undertowOptions:OptionMap

Doc from io.undertow.server.OpenListener.setUndertowOptions.

The connector options

Annotations
@Override