|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ref.Reference<T>
java.lang.ref.WeakReference<T>
com.atlassian.util.concurrent.LazyReference<T>
com.atlassian.spring.container.LazyComponentReference<T>
T - public class LazyComponentReference<T>
Lazily loaded reference to a component that is not constructed until required. This class is not an alternative to correctly using dependency injection but is a replacement for the necessary evil of loading components in places such as servlets where all sense of best practices breaks down.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.atlassian.util.concurrent.LazyReference |
|---|
com.atlassian.util.concurrent.LazyReference.InitializationException |
| Constructor Summary | |
|---|---|
LazyComponentReference(java.lang.String key)
|
|
| Method Summary | |
|---|---|
protected T |
create()
Calls ContainerManager.getComponent(String) |
| Methods inherited from class com.atlassian.util.concurrent.LazyReference |
|---|
cancel, get, getInterruptibly, isInitialized |
| Methods inherited from class java.lang.ref.Reference |
|---|
clear, enqueue, isEnqueued |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LazyComponentReference(java.lang.String key)
key - of the component| Method Detail |
|---|
protected T create()
throws java.lang.Exception
ContainerManager.getComponent(String)
create in class com.atlassian.util.concurrent.LazyReference<T>java.lang.IllegalStateException - if container is not yet setup
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||