public interface Destroyable
Component
in order to provide
destroy facilities. No exception is thrown as destroy must work always!
The "decompose()" method Decomposeable.decompose()
differs from the
"destroy()" method 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 destroy()
method)
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 Component
,
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
refcodes-component artifact.
Modifier and Type | Interface and Description |
---|---|
static interface |
Destroyable.DestroyAutomaton
The
Destroyable.DestroyAutomaton interface defines those methods related to
the destroy life-cycle. |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys the component.
|
void destroy()
Component
has been destroyed, then invoking any of that
Component
instance's methods (except the destroy()
method) must throw an IllegalStateException
as by definition a
once destroyed Component
is in the state of being destroyed which
is irreversible.Copyright © 2016. All rights reserved.