T
- public abstract class ConcurrentInitialize<T>
extends java.lang.Object
lock
that oeprates a state machine.Modifier and Type | Class and Description |
---|---|
(package private) static class |
ConcurrentInitialize.State |
Modifier and Type | Field and Description |
---|---|
private java.lang.Thread |
creatingThread |
private java.lang.Exception |
exception |
private java.lang.Object |
lock |
private ConcurrentInitialize.State |
state |
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 void |
set(T value,
java.lang.Exception e,
ConcurrentInitialize.State state) |
private ConcurrentInitialize.State state
private T value
private java.lang.Object lock
private java.lang.Thread creatingThread
private java.lang.Exception exception
public T get() throws java.lang.Exception
java.lang.Exception
private void set(T value, java.lang.Exception e, ConcurrentInitialize.State state)
public abstract T create() throws java.lang.Exception
java.lang.Exception
- if the creation failed this is the exception that was
thrown