private Chain < ApiResponse > createResponseChain ( IAsyncHandler < ApiResponse > responseHandler ) { ResponseChain chain = new ResponseChain ( policyImpls , context ) ; chain . headHandler ( responseHandler ) ; chain . policyFailureHandler ( result -> { if ( apiConnectionResponse != null ) { apiConnectionResponse . abort ( ) ; } policyFailureHandler . handle ( result ) ; } ) ; chain . policyErrorHandler ( result -> { if ( apiConnectionResponse != null ) { apiConnectionResponse . abort ( ) ; } policyErrorHandler . handle ( result ) ; } ) ; return chain ; }
Creates the chain used to apply policies in reverse order to the api response .