public class

DefaultListeningIOReactor

extends AbstractMultiworkerIOReactor
implements ListeningIOReactor
java.lang.Object
   ↳ org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor
     ↳ org.apache.http.impl.nio.reactor.DefaultListeningIOReactor

Class Overview

Default implementation of ListeningIOReactor. This class extends AbstractMultiworkerIOReactor with capability to listen for incoming connections.

The following parameters can be used to customize the behavior of this class:

Summary

[Expand]
Inherited Fields
From class org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor
Public Constructors
DefaultListeningIOReactor(int workerCount, ThreadFactory threadFactory, HttpParams params)
DefaultListeningIOReactor(int workerCount, HttpParams params)
Public Methods
Set<ListenerEndpoint> getEndpoints()
Returns a set of endpoints for this I/O reactor.
ListenerEndpoint listen(SocketAddress address)
Opens a new listener endpoint with the given socket address.
void pause()
Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.
void resume()
Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.
Protected Methods
void cancelRequests()
Triggered to cancel pending session requests.
void processEvents(int readyCount)
Triggered to process I/O events registered by the main Selector.
[Expand]
Inherited Methods
From class org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor
From class java.lang.Object
From interface org.apache.http.nio.reactor.IOReactor
From interface org.apache.http.nio.reactor.ListeningIOReactor

Public Constructors

public DefaultListeningIOReactor (int workerCount, ThreadFactory threadFactory, HttpParams params)

public DefaultListeningIOReactor (int workerCount, HttpParams params)

Public Methods

public Set<ListenerEndpoint> getEndpoints ()

Returns a set of endpoints for this I/O reactor.

Returns
  • set of endpoints.

public ListenerEndpoint listen (SocketAddress address)

Opens a new listener endpoint with the given socket address. Once the endpoint is fully initialized it starts accepting incoming connections and propagates I/O activity notifications to the I/O event dispatcher.

waitFor() can be used to wait for the listener to be come ready to accept incoming connections.

close() can be used to shut down the listener even before it is fully initialized.

Parameters
address the socket address to listen on.
Returns
  • listener endpoint.

public void pause ()

Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.

Throws
IOException

public void resume ()

Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.

Throws
IOException

Protected Methods

protected void cancelRequests ()

Triggered to cancel pending session requests.

Super-classes can implement this method to react to the event.

protected void processEvents (int readyCount)

Triggered to process I/O events registered by the main Selector.

Super-classes can implement this method to react to the event.

Parameters
readyCount event count.