public class Response extends Object
Asynchronous or Batched methods
which return a Completion or Future.
public interface MyService extends Remote {
@Asynchronous
Completion<Results> performAnalysis(Object params) throws RemoteException;
...
}
public class MyServiceImpl implements MyService {
public Completion<Results> performAnalysis(Object params) {
try {
Results results;
...
return Response.complete(results);
} catch (Exception e) {
return Response.exception(e);
}
}
}
| Modifier and Type | Method and Description |
|---|---|
static <V> Completion<V> |
complete(V value)
Returns a
Completion which always returns the given value. |
static <V> Completion<V> |
exception(Throwable cause)
Returns a
Completion which always throws an ExecutionException wrapping the given cause. |
public static <V> Completion<V> complete(V value)
Completion which always returns the given value.public static <V> Completion<V> exception(Throwable cause)
Completion which always throws an ExecutionException wrapping the given cause.Copyright © 2006–2015 Cojen. All rights reserved.