T
- public abstract class ConcurrentInitialize<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Thread |
creator |
private java.lang.Exception |
exception |
private java.util.concurrent.atomic.AtomicBoolean |
initializer |
private java.util.concurrent.CountDownLatch |
resolved |
private T |
value |
Constructor and Description |
---|
ConcurrentInitialize() |
Modifier and Type | Method and Description |
---|---|
abstract T |
create()
Override to create the actual object
|
T |
get()
Get the value or wait until it is created.
|
private final java.util.concurrent.atomic.AtomicBoolean initializer
private final java.util.concurrent.CountDownLatch resolved
private java.lang.Thread creator
private T value
private java.lang.Exception exception
public T get() throws java.lang.Exception
java.lang.Exception
public abstract T create() throws java.lang.Exception
java.lang.Exception
- if the creation failed this is the exception that was
thrown