Package de.aristaflow.adept2.util
Class Cleanup.CollectionCloseTask
java.lang.Object
de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask<Exception>
de.aristaflow.adept2.util.Cleanup.CollectionCloseTask
- All Implemented Interfaces:
CleanupTask<Exception>
@Deprecated(since="17.0.0",
forRemoval=true)
public static final class Cleanup.CollectionCloseTask
extends CleanupTask.AbstractCleanupTask<Exception>
Deprecated, for removal: This API element is subject to removal in a future version.
A cleanup task for cleaning up a collection of objects possibly being
AutoCloseable. No
cleanup will occur for objects which do not implement AutoCloseable.-
Nested Class Summary
Nested classes/interfaces inherited from interface de.aristaflow.adept2.util.CleanupTask
CleanupTask.AbstractCleanupTask<EX extends Exception>, CleanupTask.AtomicCloseTask, CleanupTask.CloseAndResetTask, CleanupTask.MutableCloseTask -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Collection<?>Deprecated, for removal: This API element is subject to removal in a future version.The collection of which to close its elements which implementAutoCloseable.Fields inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
descriptor, logger -
Constructor Summary
ConstructorsConstructorDescriptionCollectionCloseTask(String descriptor, Collection<?> coll) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newCleanup.CollectionCloseTaskfor the designatedCollectionand the designated descriptor usingCleanup's default logger.CollectionCloseTask(String descriptor, Logger logger, Collection<?> coll) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newCleanup.CollectionCloseTaskfor the designatedCollection, the designated descriptor and the designated logger.CollectionCloseTask(String descriptor, Logger logger, Collection<?> coll, Function<? super AutoCloseable, AutoCloseable> conversion) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newCleanup.CollectionCloseTaskfor the designatedCollection, the designated conversion applied to the collection elements before closing them, the designated descriptor and the designated logger. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup(boolean explicit) Deprecated, for removal: This API element is subject to removal in a future version.Performs the actual clean-up.Methods inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
getDescriptor
-
Field Details
-
coll
Deprecated, for removal: This API element is subject to removal in a future version.The collection of which to close its elements which implementAutoCloseable.
-
-
Constructor Details
-
CollectionCloseTask
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newCleanup.CollectionCloseTaskfor the designatedCollectionand the designated descriptor usingCleanup's default logger.- Parameters:
descriptor- A string that meaningfully describes this task when used for logging etc. ornull.coll- The collection of which toAutoCloseable.close()the elements.
-
CollectionCloseTask
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newCleanup.CollectionCloseTaskfor the designatedCollection, the designated descriptor and the designated logger.- Parameters:
descriptor- A string that meaningfully describes this task when used for logging etc. ornull.logger- The logger for messages and/or problems, e. g. unexpected exceptions.coll- The collection of which toAutoCloseable.close()the elements.
-
CollectionCloseTask
public CollectionCloseTask(String descriptor, Logger logger, Collection<?> coll, Function<? super AutoCloseable, AutoCloseable> conversion) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newCleanup.CollectionCloseTaskfor the designatedCollection, the designated conversion applied to the collection elements before closing them, the designated descriptor and the designated logger.- Parameters:
descriptor- A string that meaningfully describes this task when used for logging etc. ornull.logger- The logger for messages and/or problems, e. g. unexpected exceptions.coll- The collection of which toAutoCloseable.close()the elements.conversion- A function to convert the collection elements before closing. This allows to handler instances that are wrapped by a close ignoring wrapper. This may benull.
-
-
Method Details
-
cleanup
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:CleanupTaskPerforms the actual clean-up. This method is only called byCleanupand must NOT be called directly!- Parameters:
explicit- Whether the clean-up was triggered explicitly viaCleanup.clean(). Otherwise it was triggered implicitly as a post-mortem action by the object becoming phantom reachable.- Throws:
Exception
-
Cleanup.CollCloseTaskinstead.