Package com.oracle.bmc.waiter
Interface WaiterScheduler
-
public interface WaiterScheduler
Abstraction forGenericWaiter
to 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 WaiterScheduler
SYNC
Scheduler implementation that blocks in theschedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit)
method for the given time to pass.static WaiterScheduler
UNSUPPORTED
AWaiterScheduler
where waiting is not supported.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static WaiterScheduler
fromService(ScheduledExecutorService service)
Create a new instance from the givenScheduledExecutorService
.Future<?>
schedule(Runnable command, long time, TimeUnit unit)
-
-
-
Field Detail
-
UNSUPPORTED
static final WaiterScheduler UNSUPPORTED
AWaiterScheduler
where waiting is not supported.Always throws an exception.
GenericWaiter
will 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.
GenericWaiter
can 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.
-
-