Package de.aristaflow.adept2.util
Class Cleanup.Builder
java.lang.Object
de.aristaflow.adept2.util.Cleanup.Builder
A builder for
Cleanup that provides some additional options and generally easier
usage than complex constructors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets a specific cleaner to be used.descriptor(String descriptor) Sets the designated string that meaningfully describes this task when used for logging etc.Sets the logger for messages and/or problems, e. g.Finishes creating aCleanupfor the given object using the other provided information.Finishes creating aCleanupfor the given object using the other provided information.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
cleaner
Sets a specific cleaner to be used. Otherwise the default cleaner will be used.- Parameters:
cleaner- The custom cleaner to be used for clean-up.- Returns:
- This builder.
-
descriptor
Sets the designated string that meaningfully describes this task when used for logging etc. Otherwise the class name of the registered object will be used.- Parameters:
descriptor- The custom descriptor to be used for logging.- Returns:
- This builder.
-
logger
Sets the logger for messages and/or problems, e. g. unexpected exceptions. Otherwise the default logger will be used.- Parameters:
logger- The custom logger to be used for logging.- Returns:
- This builder.
-
register
Finishes creating aCleanupfor the given object using the other provided information. There will be no transparent pass-through for a checked exception inCleanup.clean().- Parameters:
object- The object for which to register post-mortem clean-up.- Returns:
- A new
Cleanupallowing to perform post-mortem clean-up.
-
register
Finishes creating aCleanupfor the given object using the other provided information. There will be transparent pass-through for the provided checked exception type inCleanup.clean().- Parameters:
object- The object for which to register post-mortem clean-up.checkedExceptionType- The exception that is expected by the clean-up. This will be forwarded when manually triggering clean-up.- Returns:
- A new
Cleanupallowing to perform post-mortem clean-up.
-