If multiple threads call the {@code get()} method when the object has not yetbeen created, they are blocked until initialization completes. The algorithm guarantees that only a single instance of the wrapped object class is created, which is passed to all callers. Once initialized, calls to the {@code get()} method are pretty fast because no synchronization is needed(only an access to a volatile member field).
@author Apache Software Foundation @version $Id: LazyInitializer.java 929189 2010-03-30 16:49:22Z oheger $ @param < T> the type of the object managed by this initializer class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|