public class

SessionRequestImpl

extends Object
implements SessionRequest
java.lang.Object
   ↳ org.apache.http.impl.nio.reactor.SessionRequestImpl

Class Overview

Default implementation of SessionRequest.

Summary

Public Constructors
SessionRequestImpl(SocketAddress remoteAddress, SocketAddress localAddress, Object attachment, SessionRequestCallback callback)
Public Methods
void cancel()
Cancels the request.
void completed(IOSession session)
void failed(IOException exception)
Object getAttachment()
Returns attachment object will be added to the session's context upon initialization.
int getConnectTimeout()
Returns connect timeout value in milliseconds.
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.
SocketAddress getLocalAddress()
Returns local socket address.
SocketAddress getRemoteAddress()
Returns socket address of the remote host.
IOSession getSession()
Returns IOSession instance created as a result of this request or null if the request is still pending.
boolean isCompleted()
Determines whether the request has been completed (either successfully or unsuccessfully).
void setConnectTimeout(int timeout)
Sets connect timeout value in milliseconds.
void timeout()
void waitFor()
Waits for completion of this session request.
Protected Methods
void setKey(SelectionKey key)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.nio.reactor.SessionRequest

Public Constructors

public SessionRequestImpl (SocketAddress remoteAddress, SocketAddress localAddress, Object attachment, SessionRequestCallback callback)

Public Methods

public 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 void completed (IOSession session)

public void failed (IOException exception)

public 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 int getConnectTimeout ()

Returns connect timeout value in milliseconds.

Returns
  • connect timeout value in milliseconds.

public 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 SocketAddress getLocalAddress ()

Returns local socket address.

Returns
  • local socket address.

public SocketAddress getRemoteAddress ()

Returns socket address of the remote host.

Returns
  • socket address of the remote host

public 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 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 void setConnectTimeout (int timeout)

Sets connect timeout value in milliseconds.

Parameters
timeout connect timeout value in milliseconds.

public void timeout ()

public void waitFor ()

Waits for completion of this session request.

Protected Methods

protected void setKey (SelectionKey key)