com.atlassian.confluence.util
Class LazyComponentReference

java.lang.Object
  extended by com.atlassian.confluence.util.LazyComponentReference

public class LazyComponentReference
extends Object

Lazily loads the component from the ContainerManager and memoize the result.


Constructor Summary
LazyComponentReference()
           
 
Method Summary
static
<T> com.atlassian.util.concurrent.Supplier<T>
containerComponent(String name)
          Static factory that takes the component name and the type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyComponentReference

public LazyComponentReference()
Method Detail

containerComponent

public static <T> com.atlassian.util.concurrent.Supplier<T> containerComponent(String name)
Static factory that takes the component name and the type.

Note this is unsafe as it doesn't actually cast until the usage site due to erasure.

Type Parameters:
T - the component type
Parameters:
name - the name of the component
Returns:
the accessed component or any exception encountered when trying to retrieve it


Copyright © 2003-2013 Atlassian. All Rights Reserved.