T
- type of result for AsyncCallback.onSuccess(Object)
if the
operation completed successfully.public abstract class Handler<T> extends Object implements Callable<T>
Typically an RPC service implementation will extend this class and use Guice injection to manage its state. For example:
class Foo extends Handler<Result> { interface Factory { Foo create(... args ...); } @Inject Foo(state, @Assisted args) { ... } Result get() throws Exception { ... } }
Constructor and Description |
---|
Handler() |
public final void to(com.google.gwtjsonrpc.common.AsyncCallback<T> callback)
callback
- callback to receive the result of call()
.public abstract T call() throws Exception
call
in interface Callable<T>
VoidResult.INSTANCE
if
there is no meaningful return value for the operation.Exception
- the operation failed. The caller will log the exception
and the stack trace, if it is worth logging on the server side.