Package org.forgerock.am.cts.api
Interface ResultHandler<T,E extends Exception>
public interface ResultHandler<T,E extends Exception>
ResultHandler is responsible for providing a mechanism of allowing access to the result
of an asynchronous operation.
In particular, this interface is generic to allow it to handle the particular return types
of the potentially synchronous operations of the CTS.
This ResultHandler is intended to only handle a single result. Therefore a new instance
should be created for each request.
-
Method Summary
Modifier and TypeMethodDescriptionGet the results from the ResultHandler.void
processError
(Exception error) void
processResults
(T result)
-
Method Details
-
getResults
Get the results from the ResultHandler.- Returns:
- A possibly null, result of type T.
- Throws:
E
- If processing the task caused an error, then this error will be thrown. Also thrown if the caller is blocked for too long waiting for this task.
-
processResults
- Parameters:
result
- The result to store in this ResultHandler.
-
processError
- Parameters:
error
- The error to store in this result handler.
-