Package com.oracle.bmc.waiter
Interface WaiterScheduler
-
public interface WaiterSchedulerAbstraction forGenericWaiterto implement the “schedule” functionality to implement asynchronous waiting.Basically a cut down version of
ScheduledExecutorService, with only theScheduledExecutorService.schedule(Runnable, long, TimeUnit)method.
-
-
Field Summary
Fields Modifier and Type Field Description static WaiterSchedulerSYNCScheduler implementation that blocks in theschedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit)method for the given time to pass.static WaiterSchedulerUNSUPPORTEDAWaiterSchedulerwhere waiting is not supported.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static WaiterSchedulerfromService(ScheduledExecutorService service)Create a new instance from the givenScheduledExecutorService.Future<?>schedule(Runnable command, long time, TimeUnit unit)
-
-
-
Field Detail
-
UNSUPPORTED
static final WaiterScheduler UNSUPPORTED
AWaiterSchedulerwhere waiting is not supported.Always throws an exception.
GenericWaiterwill still succeed if the wait delay is configured as 0, but not if it’s positive.
-
SYNC
static final WaiterScheduler SYNC
Scheduler implementation that blocks in theschedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit)method for the given time to pass.This removes the need for a separate threaded scheduler.
GenericWaitercan handle the case whereschedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit)blocks, so this will not deadlock or anything.
-
-
Method Detail
-
fromService
static WaiterScheduler fromService(ScheduledExecutorService service)
Create a new instance from the givenScheduledExecutorService.Tasks will be run on that executor.
-
-