public interface Initializable
This interface adds "initialization" context to an implementing class. Any instance of the class may now be in "pre-initialized" state or "initialized" (working) state. And it may be called to initialize itself to be ready for using.
initialize(),
isInitialized(),
AbstractInitializable| Modifier and Type | Method and Description |
|---|---|
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. |
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.
Note: if some implementation overrides this method
it should also provide proper implementation for the 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 isInitialized() returns false - this method
may and should be called at least once. If isInitialized() returns true - this
method may be safely called - but not necessary perform any actual functionality.
boolean isInitialized()
Returns true if this instance is already initialized and may perform any functionality.
If this method return false - initialize() should be called.