REQUEST
- type of the requestRESPONSE
- type of the responsepublic class StreamClosingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE> extends ForwardingAsyncHandler<REQUEST,RESPONSE>
A wrapper around an async handler that closes the stream at the end of a request, if the body is a stream.
Constructor and Description |
---|
StreamClosingAsyncHandler(AsyncHandler<REQUEST,RESPONSE> delegate) |
Modifier and Type | Method and Description |
---|---|
void |
onError(REQUEST request,
Throwable error)
Called if the request could not be completed successfully.
|
void |
onSuccess(REQUEST request,
RESPONSE response)
Called if the request was successfully completed.
|
public StreamClosingAsyncHandler(AsyncHandler<REQUEST,RESPONSE> delegate)
public void onSuccess(REQUEST request, RESPONSE response)
AsyncHandler
Called if the request was successfully completed.
onSuccess
in interface AsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
onSuccess
in class ForwardingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
request
- The request that was made.response
- The response that was received.public void onError(REQUEST request, Throwable error)
AsyncHandler
Called if the request could not be completed successfully.
onError
in interface AsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
onError
in class ForwardingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
request
- The request that was made.error
- The error that was received.Copyright © 2016–2024. All rights reserved.