|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jsmpp.extra.PendingResponse<T>
public class PendingResponse<T extends Command>
This class is utility that able wait for a response for specified timeout.
Constructor Summary | |
---|---|
PendingResponse(long timeout)
Construct with specified timeout. |
Method Summary | |
---|---|
void |
done(T response)
Done with valid response and notify that response already received. |
void |
doneWithInvalidResponse(InvalidResponseException e)
Done with invalid response (negative response/non OK command_status). |
T |
getResponse()
Get the response. |
void |
waitDone()
Wait until response receive or timeout already reach. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PendingResponse(long timeout)
timeout
- is the timeout in millisecond.Method Detail |
---|
public void done(T response) throws java.lang.IllegalArgumentException
response
- is the response.
java.lang.IllegalArgumentException
- thrown if response is null.public void doneWithInvalidResponse(InvalidResponseException e)
e
- is the InvalidResponseException
.public T getResponse()
public void waitDone() throws ResponseTimeoutException, InvalidResponseException
ResponseTimeoutException
- if timeout reach.
InvalidResponseException
- if receive invalid response.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |