public interface Destroyable
Componentin order to provide destroy facilities. No exception is thrown as destroy must work always!
The "decompose()" method
Decomposeable.decompose() differs from the
destroy() in that "destroy()" shuts
down the component in memory, whereas "decompose()" also tears down external
resources such as files or DB schemas. This means that with "decompose()" all
external data will be lost, as with "destroy()" external data will be kept
(in terms that it makes sense for the actual implementation).
In case a
Component has been destroyed, then invoking any of that
Component instance's methods (except the
must throw an
IllegalStateException as by definition a once destroyed
Component is in the state of being destroyed which is irreversible.
ATTENTION: In case you intend to provide
destroy() functionality to
a plain java class which is not intended to be a mature
then please just implement the
Disposable interface from the
refcodes-mixin artifact. This semantically underlines your intentions more
clearly (not being a
Component and reduces dependencies to the
|Modifier and Type||Interface and Description|
Componenthas been destroyed, then invoking any of that
Componentinstance's methods (except the
destroy()method) must throw an
IllegalStateExceptionas by definition a once destroyed
Componentis in the state of being destroyed which is irreversible.
Copyright © 2016. All rights reserved.