@ThreadSafe public class SessionRequestImpl extends java.lang.Object implements SessionRequest
SessionRequest.| 构造器和说明 |
|---|
SessionRequestImpl(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
java.lang.Object attachment,
SessionRequestCallback callback) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel()
Cancels the request.
|
void |
completed(IOSession session) |
void |
failed(java.io.IOException exception) |
java.lang.Object |
getAttachment()
Returns attachment object will be added to the session's context upon
initialization.
|
int |
getConnectTimeout()
Returns connect timeout value in milliseconds.
|
java.io.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. |
java.net.SocketAddress |
getLocalAddress()
Returns local socket address.
|
java.net.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(java.nio.channels.SelectionKey key) |
void |
timeout() |
void |
waitFor()
Waits for completion of this session request.
|
public SessionRequestImpl(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
java.lang.Object attachment,
SessionRequestCallback callback)
public java.net.SocketAddress getRemoteAddress()
SessionRequestgetRemoteAddress 在接口中 SessionRequestpublic java.net.SocketAddress getLocalAddress()
SessionRequestgetLocalAddress 在接口中 SessionRequestpublic java.lang.Object getAttachment()
SessionRequestgetAttachment 在接口中 SessionRequestpublic boolean isCompleted()
SessionRequestisCompleted 在接口中 SessionRequesttrue if the request has been completed,
false if still pending.protected void setKey(java.nio.channels.SelectionKey key)
public void waitFor()
throws java.lang.InterruptedException
SessionRequestwaitFor 在接口中 SessionRequestjava.lang.InterruptedException - 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 在接口中 SessionRequestnull if the request is still pending.public java.io.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 在接口中 SessionRequestnull if no error occurred to
this point.public void completed(IOSession session)
public void failed(java.io.IOException exception)
public void timeout()
public int getConnectTimeout()
SessionRequestgetConnectTimeout 在接口中 SessionRequestpublic void setConnectTimeout(int timeout)
SessionRequestsetConnectTimeout 在接口中 SessionRequesttimeout - connect timeout value in milliseconds.public void cancel()
SessionRequestSessionRequest.waitFor()} method.cancel 在接口中 SessionRequest