public abstract class AbstractInitializableAndDestroyable extends AbstractDestroyable implements Initializable
Abstract implementation of both Initializable and Destroyable interfaces.
This class extends AbstractDestroyable and copies all the functionality of the AbstractInitializable.
| Constructor and Description |
|---|
AbstractInitializableAndDestroyable() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertInitialized() |
protected void |
doInitialize()
This method will be called only when
initialize() is called for the first time. |
void |
initialize()
This instance should perform all the required operations that will put it into the working state,
so it can properly perform any other functionality.
|
boolean |
isInitialized()
Returns
true if this instance is already initialized and may perform any functionality. |
assertNotDestroyed, destroy, doDestroy, isDestroyedpublic final void initialize()
InitializableThis instance should perform all the required operations that will put it into the working state, so it can properly perform any other functionality.
Note: if some implementation overrides this method
it should also provide proper implementation for the Initializable.isInitialized() method!
Note: This method should not throw any exception for being called for the second (or more) time. If this instance is already initialized - method should exit without performing any actual functionality.
General contract is that if Initializable.isInitialized() returns false - this method
may and should be called at least once. If Initializable.isInitialized() returns true - this
method may be safely called - but not necessary perform any actual functionality.
initialize in interface Initializableprotected void doInitialize()
initialize() is called for the first time.public final boolean isInitialized()
InitializableReturns true if this instance is already initialized and may perform any functionality.
If this method return false - Initializable.initialize() should be called.
isInitialized in interface Initializableprotected final void assertInitialized()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if isInitialized() returns false