|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CallableResultHandler<T>
Used by AsynchronousCallableCompletionService
to specify a callback class, whose methods are called with the result (or exception) of the Callable
submitted to the service.
class AddToListCallableImpl implements CallableResultHandler<Integer>
{
final List<Integer> resultList = Collections.synchronizedList(new ArrayList<Integer>());
final List<ExecutionException> errorList = Collections.synchronizedList(new ArrayList<ExecutionException>());
public void onCompletion(Integer resultFromAsynchronousOperation) {
resultList.add(resultFromAsynchronousOperation);
// Do stuff with the result ...
}
public void onException(ExecutionException executionException) {
errorList.add(executionException);
executionException.printStackTrace();
}
}
Method Summary | |
---|---|
void |
onCompletion(T resultOfCallable) Invoked with the result of the Callable submitted to AsynchronousCallableCompletionService.submit(Callable) . |
void |
onException(java.util.concurrent.ExecutionException executionException) Invoked with the ExecutionException of the Callable submitted to AsynchronousCallableCompletionService.submit(Callable) . |
Method Detail |
---|
void onCompletion(T resultOfCallable)
Callable
submitted to AsynchronousCallableCompletionService.submit(Callable)
.resultOfCallable
- the Callable
's result.void onException(java.util.concurrent.ExecutionException executionException)
ExecutionException
of the Callable
submitted to AsynchronousCallableCompletionService.submit(Callable)
.executionException
- the Callable
's exception. Use Throwable.getCause()
to determine the cause.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |