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 DestroyableThis mixin might be implemented by aComponentin 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
Componenthas been destroyed, then invoking any of thatComponentinstance's methods (except thedestroy()method) must throw anIllegalStateExceptionas by definition a once destroyedComponentis 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 theDisposableinterface from the refcodes-mixin artifact. This semantically underlines your intentions more clearly (not being aComponentand reduces dependencies to the refcodes-component artifact.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceDestroyable.DestroyAutomatonTheDestroyable.DestroyAutomatoninterface defines those methods related to the destroy life-cycle.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddestroy()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 aComponenthas been destroyed, then invoking any of thatComponentinstance's methods (except thedestroy()method) must throw anIllegalStateExceptionas by definition a once destroyedComponentis in the state of being destroyed which is irreversible.
-
-