public final class Deferrers extends Object
ThreadLocal
Modifier and Type | Class and Description |
---|---|
static class |
Deferrers.Deferred
Class wrapping executeDeferred method and stack depth for action.
|
Modifier and Type | Method and Description |
---|---|
static void |
cancelAllDeferredActionsGlobally()
Cancel all defer actions globally.
|
static void |
cancelDeferredActions()
Cancel all defer actions for the current stack depth.
|
static Deferrers.Deferred |
defer(Deferrers.Deferred deferred)
Defer some action.
|
static Disposable |
defer(Disposable disposable)
Defer execution of some disposable object.
|
static Runnable |
defer(Runnable runnable)
Defer execution of some runnable action.
|
static <T extends Closeable> |
defer(T closeable)
Defer closing of an closeable object.
|
static <T> T |
deferredClose(T closeable)
Defer object containing public close() method.
|
static boolean |
isEmpty()
Check that presented defer actions for the current thread.
|
static void |
processDeferredActions()
Process all defer actions for the current stack depth level.
|
@Weight(value=NORMAL) public static Deferrers.Deferred defer(Deferrers.Deferred deferred)
deferred
- action to be defer.@Warning(value="Using reflection") @Weight(value=NORMAL) public static <T> T deferredClose(T closeable)
T
- type of the object to be processedcloseable
- an object with close() method.@Weight(value=NORMAL) public static <T extends Closeable> T defer(T closeable)
T
- type of closeable objectcloseable
- an object implements java.io.Closeable@Weight(value=NORMAL) public static Runnable defer(Runnable runnable)
runnable
- some runnable action to be executed in futureAssertionError
- if the runnable object is null@Weight(value=NORMAL) public static Disposable defer(Disposable disposable)
disposable
- some disposable object to be processed.AssertionError
- if the disposable object is nullDisposable
@Weight(value=NORMAL) public static void cancelAllDeferredActionsGlobally()
@Weight(value=VARIABLE, comment="Depends on the current call stack depth") public static void cancelDeferredActions()
@Weight(value=VARIABLE, comment="Depends on the current call stack depth") public static void processDeferredActions()
Copyright © 2011–2021 Igor Maznitsa. All rights reserved.