public <T> Callback<T> wrapCallback(final String operationDescription,
                                        final Callback<T> callback,
                                        final Logger logger) {

        /* Set the callback to delegate to this callback. */
        Callback<T> reactiveCallback = callbackBuilder().withCallback(new Callback<T>() {
            @Override
            public void accept(T t) {
                if (logger.isDebugEnabled()) {
                    logger.debug("{} returned {}", operationDescription, t);
                }
                callback.resolve(t);
            }

        /* Provide some boiler plate error handling. */
        }).withErrorHandler(error -> {
            logger.error(String.format("ERROR calling %s", operationDescription), error);
            callback.onError(error);

        /* Provide some boiler timeout handling. */
        }).withTimeoutHandler(() -> {
            logger.error("TIMEOUT calling {}", operationDescription);
            callback.onTimeout();
        })
                .build();

        return reactiveCallback;
    }
public <T> Callback<T> wrapCallback(final String operationDescription,
                                        final Callback<T> callback,
                                        final Logger logger) {

        
        Callback<T> reactiveCallback = callbackBuilder().withCallback(new Callback<T>() {
            @Override
            public void accept(T t) {
                if (logger.isDebugEnabled()) {
                    logger.debug("{} returned {}", operationDescription, t);
                }
                callback.resolve(t);
            }

        
        }).withErrorHandler(error -> {
            logger.error(String.format("ERROR calling %s", operationDescription), error);
            callback.onError(error);

        
        }).withTimeoutHandler(() -> {
            logger.error("TIMEOUT calling {}", operationDescription);
            callback.onTimeout();
        })
                .build();

        return reactiveCallback;
    }
public < T > Callback < T > wrapCallback ( final String operationDescription , final Callback < T > callback , final Logger logger ) { /* Set the callback to delegate to this callback. */ Callback < T > reactiveCallback = callbackBuilder ( ) . withCallback ( new Callback < T > ( ) { @ Override public void accept ( T t ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "{} returned {}" , operationDescription , t ) ; } callback . resolve ( t ) ; } /* Provide some boiler plate error handling. */ } ) . withErrorHandler ( error -> { logger . error ( String . format ( "ERROR calling %s" , operationDescription ) , error ) ; callback . onError ( error ) ; /* Provide some boiler timeout handling. */ } ) . withTimeoutHandler ( ( ) -> { logger . error ( "TIMEOUT calling {}" , operationDescription ) ; callback . onTimeout ( ) ; } ) . build ( ) ; return reactiveCallback ; }
Used for quickly delegating one callback to another.
<p>
This allows one liners so you don't have to create a builder for this common case.

@param operationDescription Describe the operation for logging
@param callback             callback to delegate error and timeouts too.
@param logger               logger to log errors and timeouts.
@param <T>                  Generic type
@return wrapped callback that is tied to this reactor.
Used for quickly delegating one callback to another . <p > This allows one liners so you don t have to create a builder for this common case .