public final class LifecycleScopes
extends java.lang.Object
LifecycleScopeProviders. This includes factories for resolving
Completable representations of scopes, corresponding events, etc.| Modifier and Type | Method and Description |
|---|---|
static <E> CompletableSource |
resolveScopeFromLifecycle(<any> lifecycle,
E endEvent) |
static <E> CompletableSource |
resolveScopeFromLifecycle(<any> lifecycle,
E endEvent,
java.util.Comparator<E> comparator) |
static <E> CompletableSource |
resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider)
Overload for resolving lifecycle providers that defaults to checking start and end boundaries
of lifecycles.
|
static <E> CompletableSource |
resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider,
boolean checkEndBoundary)
Overload for resolving lifecycle providers allows configuration of checking "end" boundaries
of lifecycles.
|
public static <E> CompletableSource resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider) throws OutsideScopeException
Note: This resolves the scope immediately, so consider deferring execution as
needed, such as using defer.
E - the lifecycle event typeprovider - the LifecycleScopeProvider to resolve.CompletableSource representation of a given providerOutsideScopeException - if the LifecycleScopeProvider.correspondingEvents()
throws an OutsideScopeException during resolution.public static <E> CompletableSource resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider, boolean checkEndBoundary) throws OutsideScopeException
LifecycleNotStartedException (if peekLifecycle returns null) or
LifecycleEndedException if the lifecycle is ended. To configure the runtime behavior
of these exceptions, see AutoDisposePlugins.
Note: This resolves the scope immediately, so consider deferring execution as
needed, such as using defer.
E - the lifecycle event typeprovider - the LifecycleScopeProvider to resolve.checkEndBoundary - whether or not to check that the lifecycle has endedCompletableSource representation of a given providerOutsideScopeException - if the LifecycleScopeProvider.correspondingEvents()
throws an OutsideScopeException during resolution.public static <E> CompletableSource resolveScopeFromLifecycle(<any> lifecycle,
E endEvent)
E - the lifecycle event typelifecycle - the stream of lifecycle eventsendEvent - the target end eventCompletable representation of a given lifecycle, targeting the given eventpublic static <E> CompletableSource resolveScopeFromLifecycle(<any> lifecycle,
E endEvent,
java.util.Comparator<E> comparator)
E - the lifecycle event typelifecycle - the stream of lifecycle eventsendEvent - the target end eventcomparator - an optional comparator for checking event equality.Completable representation of a given lifecycle, targeting the given event