- Type Parameters:
T
- response type expected (Void
if no object, butnull
is expected)
public interface DeferredResponse<T>
Interface for receiving deferred/async responses.
GDS-ng implementations which are not capable of asynchronous or delayed processing of responses are expected to
synchronously invoke the onResponse(Object)
and - optionally - onException(Exception)
methods within the method call.
- Since:
- 5
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onException
(Exception exception) Exception received when receiving or processing the response.default void
onResponse
(T response) Called with successful response.
-
Method Details
-
onResponse
Called with successful response.- Parameters:
response
- response object, ornull
if there is no response, but the request completed successfully
-
onException
Exception received when receiving or processing the response.The default implementation only logs the exception on debug level.
For GDS-ng implementations that can only perform synchronous processing, it is implementation-defined whether or not this method is called, or if the exception is thrown directly from the invoked method.
- Parameters:
exception
- exception received processing the response
-