|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SessionRequest
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.
Method Summary | |
---|---|
void |
cancel()
Cancels the request. |
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 |
waitFor()
Waits for completion of this session request. |
Method Detail |
---|
SocketAddress getRemoteAddress()
SocketAddress getLocalAddress()
Object getAttachment()
boolean isCompleted()
true
if the request has been completed,
false
if still pending.IOSession getSession()
IOSession
instance created as a result of this request
or null
if the request is still pending.
null
if the request is still pending.IOException getException()
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.
null
if no error occurred to
this point.void waitFor() throws InterruptedException
InterruptedException
- in case the execution process was
interrupted.void setConnectTimeout(int timeout)
timeout
- connect timeout value in milliseconds.int getConnectTimeout()
void cancel()
waitFor()
} method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |