|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.util.DestroyableLazyInitializer<T>
public abstract class DestroyableLazyInitializer<T>
A clone of LazyInitializer, which doesn't throw any checked exception when get method is invoked. Also, it
allows to destroy the created object.
| Constructor Summary | |
|---|---|
DestroyableLazyInitializer()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Destroy the initialized object. |
T |
get()
Returns the object wrapped by this instance. |
protected abstract T |
initialize()
Creates and initializes the object managed by this LazyInitializer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DestroyableLazyInitializer()
| Method Detail |
|---|
public T get()
LazyInitializer the objectpublic final void destroy()
get() method is invoked.
protected abstract T initialize()
LazyInitializer. This method is called by get()
when the object is accessed for the first time. An implementation can focus on the creation of the object. No
synchronization is needed, as this is already handled by get().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||