|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.impl.nio.reactor.SessionRequestImpl
@ThreadSafe public class SessionRequestImpl
Default implementation of SessionRequest.
| Constructor Summary | |
|---|---|
SessionRequestImpl(SocketAddress remoteAddress,
SocketAddress localAddress,
Object attachment,
SessionRequestCallback callback)
|
|
| Method Summary | |
|---|---|
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. |
protected void |
setKey(SelectionKey key)
|
void |
timeout()
|
void |
waitFor()
Waits for completion of this session request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SessionRequestImpl(SocketAddress remoteAddress,
SocketAddress localAddress,
Object attachment,
SessionRequestCallback callback)
| Method Detail |
|---|
public SocketAddress getRemoteAddress()
SessionRequest
getRemoteAddress in interface SessionRequestpublic SocketAddress getLocalAddress()
SessionRequest
getLocalAddress in interface SessionRequestpublic Object getAttachment()
SessionRequest
getAttachment in interface SessionRequestpublic boolean isCompleted()
SessionRequest
isCompleted in interface SessionRequesttrue if the request has been completed,
false if still pending.protected void setKey(SelectionKey key)
public void waitFor()
throws InterruptedException
SessionRequest
waitFor in interface SessionRequestInterruptedException - in case the execution process was
interrupted.public IOSession getSession()
SessionRequestIOSession instance created as a result of this request
or null if the request is still pending.
getSession in interface SessionRequestnull if the request is still pending.public IOException getException()
SessionRequestIOException instance if the request could not be
successfully executed due to an I/O error or null if no
error occurred to this point.
getException in interface SessionRequestnull if no error occurred to
this point.public void completed(IOSession session)
public void failed(IOException exception)
public void timeout()
public int getConnectTimeout()
SessionRequest
getConnectTimeout in interface SessionRequestpublic void setConnectTimeout(int timeout)
SessionRequest
setConnectTimeout in interface SessionRequesttimeout - connect timeout value in milliseconds.public void cancel()
SessionRequestSessionRequest.waitFor()} method.
cancel in interface SessionRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||