REQUEST
- The request type.RESPONSE
- The response type.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.
Constructor and Description |
---|
SimpleWaiterImpl(ExecutorService executorService,
Callable<RESPONSE> callable,
REQUEST request) |
Modifier and Type | Method and Description |
---|---|
RESPONSE |
execute()
Executes the waiter callback and blocks until it either returns or throws an exception.
|
Future<Void> |
execute(AsyncHandler<REQUEST,RESPONSE> asyncHandler)
Executes the waiter callback and returns a Future.
|
REQUEST |
getRequest()
The request this waiter is being invoked on.
|
@ConstructorProperties(value={"executorService","callable","request"}) public SimpleWaiterImpl(ExecutorService executorService, Callable<RESPONSE> callable, REQUEST request)
public RESPONSE execute() throws Exception
Waiter
Executes the waiter callback and blocks until it either returns or throws an exception.
public Future<Void> execute(AsyncHandler<REQUEST,RESPONSE> asyncHandler)
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.
public REQUEST getRequest()
The request this waiter is being invoked on.
Copyright © 2016–2024. All rights reserved.