|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.systinet.wasp.async.AsyncConversation
AsyncConversation represents client handle to asynchronous invocation.
Instance of this interface is obtained by calling beginX method
on given invocation level(f.e. for JAX-RPC see WaspCall
).
It can be used for obtaining information about state of the async
communication as so as a registry for client callbacks.
Typical usage is as follows:
{ ... AsyncConversation async = helloService.beginHello(); async.setCallback(this); ... } public void onResponse(AsyncConversation async) { String resonse = helloService.endHello(async); }
Constructor Summary | |
AsyncConversation()
|
Method Summary | |
abstract void |
finish()
Finishes asynchronous communication represented by this AsyncConversation . |
abstract long |
getTimeout()
Gets the timeout for waiting for given response. |
abstract boolean |
isResponseReady()
Returns information, whether response is ready on client. |
abstract void |
setCallback(AsyncCallback callback)
Sets the callback, which get called once the response is ready on client. |
abstract void |
setTimeout(long millis)
Sets the timeout for waiting for given response. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AsyncConversation()
Method Detail |
public abstract void setCallback(AsyncCallback callback)
callback
- callback implementationpublic abstract boolean isResponseReady() throws TimeoutException
true
is returned by this method, proper endX method can be called for retrieving response
to client.
true
when response is ready on client, false
otherwise
TimeoutException
- when response didn't come in given timeoutpublic abstract void setTimeout(long millis)
millis
- timeout in milis, zero value means infinite timeoutpublic abstract long getTimeout()
setTimeout(long)
for further
description
public abstract void finish()
AsyncConversation
.
Any further asynchronous responses are discarded. This method should be called whenever
response is not awaited on client f.e. response already came and client is not awaiting
any other as a part of previously started communication.
Note that each asynchronous communication is discarded after timeout, which can
be se using setTimeout(long)
. This method discards given communication immediatelly.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |