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 |
---|---|---|
|
public void |
doInit() do initialization |
|
public boolean |
isInitialized() Check if the object is initialized. |
|
public void |
lazyInit() |
|
public void |
setInitialized(boolean initialized) Mark the object initialized. |