public interface

SessionRequest

org.apache.http.nio.reactor.SessionRequest
Known Indirect Subclasses

Class Overview

SessionRequest interface represents a request to establish a new connection (or session) to a remote host. It can be used to monitor the status of the request, to block waiting for its completion, or to cancel the request.

Implementations of this interface are expected to be threading safe.

Summary

Public Methods
abstract void cancel()
Cancels the request.
abstract Object getAttachment()
Returns attachment object will be added to the session's context upon initialization.
abstract int getConnectTimeout()
Returns connect timeout value in milliseconds.
abstract IOException getException()
Returns IOException instance if the request could not be successfully executed due to an I/O error or null if no error occurred to this point.
abstract SocketAddress getLocalAddress()
Returns local socket address.
abstract SocketAddress getRemoteAddress()
Returns socket address of the remote host.
abstract IOSession getSession()
Returns IOSession instance created as a result of this request or null if the request is still pending.
abstract boolean isCompleted()
Determines whether the request has been completed (either successfully or unsuccessfully).
abstract void setConnectTimeout(int timeout)
Sets connect timeout value in milliseconds.
abstract void waitFor()
Waits for completion of this session request.

Public Methods

public abstract void cancel ()

Cancels the request. Invocation of this method will set the status of the request to completed and will unblock threads blocked in the {waitFor()} method.

public abstract Object getAttachment ()

Returns attachment object will be added to the session's context upon initialization. This object can be used to pass an initial processing state to the protocol handler.

Returns
  • attachment object.

public abstract int getConnectTimeout ()

Returns connect timeout value in milliseconds.

Returns
  • connect timeout value in milliseconds.

public abstract IOException getException ()

Returns IOException instance if the request could not be successfully executed due to an I/O error or null if no error occurred to this point.

Returns
  • I/O exception or null if no error occurred to this point.

public abstract SocketAddress getLocalAddress ()

Returns local socket address.

Returns
  • local socket address.

public abstract SocketAddress getRemoteAddress ()

Returns socket address of the remote host.

Returns
  • socket address of the remote host

public abstract IOSession getSession ()

Returns IOSession instance created as a result of this request or null if the request is still pending.

Returns
  • I/O session or null if the request is still pending.

public abstract boolean isCompleted ()

Determines whether the request has been completed (either successfully or unsuccessfully).

Returns
  • true if the request has been completed, false if still pending.

public abstract void setConnectTimeout (int timeout)

Sets connect timeout value in milliseconds.

Parameters
timeout connect timeout value in milliseconds.

public abstract void waitFor ()

Waits for completion of this session request.

Throws
InterruptedException in case the execution process was interrupted.