T
- The functional interface that's being translated into the internally used CleanupFn
.public static class DefaultResourceCleaner.Builder<T> extends Object
Builder
for creating DefaultResourceCleaner
instances.Modifier and Type | Method and Description |
---|---|
DefaultResourceCleaner<T> |
build() |
DefaultResourceCleaner.Builder<T> |
withPrioritizedCleanup(String label,
T prioritizedCleanup)
Prioritized cleanups run before their regular counterparts.
|
DefaultResourceCleaner.Builder<T> |
withRegularCleanup(String label,
T regularCleanup)
Regular cleanups are resources for which the cleanup is triggered after all prioritized
cleanups succeeded.
|
public DefaultResourceCleaner.Builder<T> withPrioritizedCleanup(String label, T prioritizedCleanup)
withRegularCleanup(String, Object)
is started.label
- The label being used when logging errors in the given cleanup.prioritizedCleanup
- The cleanup callback that is going to be prioritized.public DefaultResourceCleaner.Builder<T> withRegularCleanup(String label, T regularCleanup)
label
- The label being used when logging errors in the given cleanup.regularCleanup
- The cleanup callback that is going to run after all prioritized
cleanups are finished.withPrioritizedCleanup(String, Object)
public DefaultResourceCleaner<T> build()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.