Class SimpleWaiterImpl<REQUEST,​RESPONSE>

  • Type Parameters:
    REQUEST - The request type.
    RESPONSE - The response type.
    All Implemented Interfaces:
    Waiter<REQUEST,​RESPONSE>

    public class SimpleWaiterImpl<REQUEST,​RESPONSE>
    extends Object
    implements Waiter<REQUEST,​RESPONSE>
    SimpleWaiterImpl is a basic wrapper around a Callable that executes an action, and provides methods to either execute it synchronously or asynchronously.
    • Method Detail

      • execute

        public RESPONSE execute()
                         throws Exception
        Description copied from interface: Waiter
        Executes the waiter callback and blocks until it either returns or throws an exception.
        Specified by:
        execute in interface Waiter<REQUEST,​RESPONSE>
        Returns:
        The response.
        Throws:
        Exception - If the waiter timed out.
      • execute

        public Future<Void> execute​(AsyncHandler<REQUEST,​RESPONSE> asyncHandler)
        Description copied from interface: Waiter
        Executes the waiter callback and returns a Future.

        The Future will not contain an information. The provided handler will be invoked with either the successful response instance, or the exception thrown in case of failure.

        Specified by:
        execute in interface Waiter<REQUEST,​RESPONSE>
        Parameters:
        asyncHandler - The async handler to call, must not be null.
        Returns:
        A Future for the submitted request.
      • getRequest

        public REQUEST getRequest()
        The request this waiter is being invoked on.