public interface LazyInitializable
A LazyInitializable
is an object that can be initialized lazily.
Note: the instance field initialized
of sub-class should be volatile
to avoid JVM instructions re-ordering
Type Params | Return Type | Name and description |
---|---|---|
|
void |
doInit() do initialization |
|
boolean |
isInitialized() Check if the object is initialized. |
|
void |
lazyInit() |
|
void |
setInitialized(boolean initialized) Mark the object initialized. |