- Type Parameters:
T- response type expected (Voidif no object, butnullis 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 voidonException(Exception exception) Exception received when receiving or processing the response.default voidonResponse(T response) Called with successful response.
-
Method Details
-
onResponse
Called with successful response.- Parameters:
response- response object, ornullif 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
-