Interface Destroyable
-
- All Known Subinterfaces:
Component
,CompositeComponent
,CompositeComponent.ExtendedCompositeComponent<CTX,CON>
,ConfigurableComponent<CTX>
,ConfigurableLifeCycleComponent<CTX>
,ConfigurableLifeCycleComponent.ConfigurableLifeCycleAutomaton<CTX>
,Destroyable.DestroyAutomaton
,DigesterComponent<J>
,InitializableComponent
,LifeCycleComponent
,LifeCycleComponent.LifeCycleAutomaton
,LifeCycleComponent.UncheckedLifeCycleComponent
- All Known Implementing Classes:
CompositeComponentImpl
,CompositeComponentImpl.ExtendedCompositeComponentImpl
,ConfigurableLifeCycleAutomatonImpl
,LifeCycleAutomatonImpl
,LifeCycleAutomatonImpl.ManualLifeCycleAutomatonImpl
public interface Destroyable
This mixin might be implemented by aComponent
in order to provide destroy facilities. No exception is thrown as destroy must work always!The "decompose()" method
Decomposeable.decompose()
differs from the "destroy()" methoddestroy()
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 thatComponent
instance's methods (except thedestroy()
method) must throw anIllegalStateException
as by definition a once destroyedComponent
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 matureComponent
, then please just implement theDisposable
interface from the refcodes-mixin artifact. This semantically underlines your intentions more clearly (not being aComponent
and reduces dependencies to the refcodes-component artifact.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Destroyable.DestroyAutomaton
TheDestroyable.DestroyAutomaton
interface defines those methods related to the destroy life-cycle.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
destroy()
Destroys the component.
-
-
-
Method Detail
-
destroy
void destroy()
Destroys the component. External resources might stay untouched! This should always be possible and must not throw any exception. In case aComponent
has been destroyed, then invoking any of thatComponent
instance's methods (except thedestroy()
method) must throw anIllegalStateException
as by definition a once destroyedComponent
is in the state of being destroyed which is irreversible.
-
-