Package com.oracle.bmc.waiter.internal
Class SimpleWaiterImpl<REQUEST,RESPONSE>
- java.lang.Object
-
- com.oracle.bmc.waiter.internal.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.
-
-
Constructor Summary
Constructors Constructor Description SimpleWaiterImpl(ExecutorService executorService, Callable<RESPONSE> callable, REQUEST request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
SimpleWaiterImpl
@ConstructorProperties({"executorService","callable","request"}) public SimpleWaiterImpl(ExecutorService executorService, Callable<RESPONSE> callable, REQUEST request)
-
-
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.
-
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.
-
getRequest
public REQUEST getRequest()
The request this waiter is being invoked on.
-
-