org.qi4j.api.composite
Class CompositeContext<T extends TransientComposite>

java.lang.Object
  extended by java.lang.ThreadLocal<T>
      extended by org.qi4j.api.composite.CompositeContext<T>

public class CompositeContext<T extends TransientComposite>
extends ThreadLocal<T>

Thread-associated composites. This is basically a ThreadLocal which maintains a reference to a TransientComposite instance for each thread. This can be used to implement various context patterns without having to pass the context explicitly as a parameter to methods.


Constructor Summary
CompositeContext(TransientBuilder<T> builder)
           
 
Method Summary
protected  T initialValue()
           
 T proxy()
           
 
Methods inherited from class java.lang.ThreadLocal
get, remove, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeContext

public CompositeContext(TransientBuilder<T> builder)
Method Detail

initialValue

protected T initialValue()
Overrides:
initialValue in class ThreadLocal<T extends TransientComposite>

proxy

public T proxy()