Interface Disposable
- All Superinterfaces:
Serializable
Wrapper for a resource to be deleted.
dispose()
is called periodically on the resource until
Disposable.State.PURGED
is returned. Exception thrown by the method will be
kept and reported to the administrator.
Implementation should report success even in case the resource got disposed
externally. This is expected in case resource get disposed by administrator
after failed attempts was reported.
In case the resource is external to Jenkins and can survive Jenkins restart,
The implementation needs to be able to correctly locate the resource once deserialized.
As long as the Disposable is used by AsyncResourceDisposer
only, it is
guaranteed to never run in more than one thread at a time.- Author:
- ogondza
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondispose()
Dispose the resource.Text description of the disposable.
-
Method Details
-
dispose
Dispose the resource.- Returns:
- State of the resource after the attempt.
Disposable.State.PURGED
in case the resource do not need to be tracked any longer. - Throws:
Throwable
- Problem disposing the resource. The exception thrown will be reported as a reason the dispose attempt failed.
-
getDisplayName
Text description of the disposable.- Returns:
- String providing enough of a hint for admin to know the resource kind and identity. Ex.: "Docker container my/tag"
-