io.undertow.server.protocol.http

## Class HttpOpenListener

- java.lang.Object
- - io.undertow.server.protocol.http.HttpOpenListener

All Implemented Interfaces:
  DelegateOpenListener, OpenListener, EventListener, org.xnio.ChannelListener<org.xnio.StreamConnection>

    public final class HttpOpenListener
    extends Object
    implements org.xnio.ChannelListener<org.xnio.StreamConnection>, DelegateOpenListener

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

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.xnio.ChannelListener

`org.xnio.ChannelListener.Setter<T extends Channel>, org.xnio.ChannelListener.SimpleSetter<T extends Channel>`

### Constructor Summary

Constructors
Constructor and Description
`HttpOpenListener(ByteBufferPool pool)`
`HttpOpenListener(ByteBufferPool pool, org.xnio.OptionMap undertowOptions)`
`HttpOpenListener(org.xnio.Pool<ByteBuffer> pool)` Deprecated.
`HttpOpenListener(org.xnio.Pool<ByteBuffer> pool, org.xnio.OptionMap undertowOptions)` Deprecated.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `closeConnections()` Close all active connections that were handled by this listener
`ByteBufferPool` `getBufferPool()`
`ConnectorStatistics` `getConnectorStatistics()`
`HttpHandler` `getRootHandler()`
`org.xnio.OptionMap` `getUndertowOptions()`
`void` `handleEvent(org.xnio.StreamConnection channel)`
`void` `handleEvent(org.xnio.StreamConnection channel, PooledByteBuffer buffer)`
`void` `setRootHandler(HttpHandler rootHandler)` Sets the root handler
`void` `setUndertowOptions(org.xnio.OptionMap undertowOptions)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HttpOpenListener

    @Deprecated
    public HttpOpenListener(org.xnio.Pool<ByteBuffer> pool)

Deprecated.

#### HttpOpenListener

    @Deprecated
    public HttpOpenListener(org.xnio.Pool<ByteBuffer> pool,
                                        org.xnio.OptionMap undertowOptions)

Deprecated.

#### HttpOpenListener

    public HttpOpenListener(ByteBufferPool pool)

#### HttpOpenListener

    public HttpOpenListener(ByteBufferPool pool,
                            org.xnio.OptionMap undertowOptions)

### Method Detail

#### handleEvent

    public void handleEvent(org.xnio.StreamConnection channel)

Specified by:
  `handleEvent` in interface `org.xnio.ChannelListener<org.xnio.StreamConnection>`

#### handleEvent

    public void handleEvent(org.xnio.StreamConnection channel,
                            PooledByteBuffer buffer)

Specified by:
  `handleEvent` in interface `DelegateOpenListener`
Parameters:
  `channel` - The channel
  `buffer` - Any additional data that was read from the stream as part of the handshake process

#### getRootHandler

    public HttpHandler getRootHandler()

Specified by:
  `getRootHandler` in interface `OpenListener`
Returns:
  The first handler that will be executed by requests on the connector

#### setRootHandler

    public void setRootHandler(HttpHandler rootHandler)

Description copied from interface: `OpenListener`
Sets the root handler

Specified by:
  `setRootHandler` in interface `OpenListener`
Parameters:
  `rootHandler` - The new root handler

#### getUndertowOptions

    public org.xnio.OptionMap getUndertowOptions()

Specified by:
  `getUndertowOptions` in interface `OpenListener`
Returns:
  The connector options

#### setUndertowOptions

    public void setUndertowOptions(org.xnio.OptionMap undertowOptions)

Specified by:
  `setUndertowOptions` in interface `OpenListener`
Parameters:
  `undertowOptions` - The connector options

#### getBufferPool

    public ByteBufferPool getBufferPool()

Specified by:
  `getBufferPool` in interface `OpenListener`
Returns:
  The buffer pool in use by this connector

#### getConnectorStatistics

    public ConnectorStatistics getConnectorStatistics()

Specified by:
  `getConnectorStatistics` in interface `OpenListener`
Returns:
  The connector statistics, or null if statistics gathering is disabled.

#### closeConnections

    public void closeConnections()

Description copied from interface: `OpenListener`
Close all active connections that were handled by this listener

Specified by:
  `closeConnections` in interface `OpenListener`