org.apache.http.impl.nio.reactor

## Class ListenerEndpointImpl

- java.lang.Object
- - org.apache.http.impl.nio.reactor.ListenerEndpointImpl

All Implemented Interfaces:
  ListenerEndpoint

    @ThreadSafe
    public class ListenerEndpointImpl
    extends Object
    implements ListenerEndpoint

Default implementation of `ListenerEndpoint`.

Since:
  4.0

### Constructor Summary

Constructors
Constructor and Description
`ListenerEndpointImpl(SocketAddress address, ListenerEndpointClosedCallback callback)`

### Method Summary

Methods
`void` `cancel()`
`void` `close()` Closes this endpoint.
`void` `completed(SocketAddress address)`
`void` `failed(IOException exception)`
`SocketAddress` `getAddress()` Returns the socket address of this endpoint.
`IOException` `getException()` Returns an instance of `IOException` thrown during initialization of this endpoint or `null`, if initialization was successful.
`boolean` `isClosed()` Determines if this endpoint has been closed and is no longer listens for incoming connections.
`boolean` `isCompleted()`
`protected void` `setKey(SelectionKey key)`
`void` `waitFor()` Waits for completion of initialization process of this endpoint.

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

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

### Constructor Detail

#### ListenerEndpointImpl

    public ListenerEndpointImpl(SocketAddress address,
                        ListenerEndpointClosedCallback callback)

### Method Detail

#### getAddress

    public SocketAddress getAddress()

Description copied from interface: `ListenerEndpoint`
Returns the socket address of this endpoint.

Specified by:
  `getAddress` in interface `ListenerEndpoint`
Returns:
  socket address.

#### isCompleted

    public boolean isCompleted()

#### getException

    public IOException getException()

Description copied from interface: `ListenerEndpoint`
Returns an instance of `IOException` thrown during initialization of this endpoint or `null`, if initialization was successful.

Specified by:
  `getException` in interface `ListenerEndpoint`
Returns:
  I/O exception object or `null`.

#### waitFor

    public void waitFor()
                 throws InterruptedException

Description copied from interface: `ListenerEndpoint`
Waits for completion of initialization process of this endpoint.

Specified by:
  `waitFor` in interface `ListenerEndpoint`
Throws:
  `InterruptedException` - in case the initialization process was interrupted.

#### completed

    public void completed(SocketAddress address)

#### failed

    public void failed(IOException exception)

#### cancel

    public void cancel()

#### setKey

    protected void setKey(SelectionKey key)

#### isClosed

    public boolean isClosed()

Description copied from interface: `ListenerEndpoint`
Determines if this endpoint has been closed and is no longer listens for incoming connections.

Specified by:
  `isClosed` in interface `ListenerEndpoint`
Returns:
  `true` if the endpoint has been closed, `false` otherwise.

#### close

    public void close()

Description copied from interface: `ListenerEndpoint`
Closes this endpoint. The endpoint will stop accepting incoming connection.

Specified by:
  `close` in interface `ListenerEndpoint`