public final class ThreadLocalized<T> extends AbstractBehavior<T>
ComponentAdapter that realizes a ThreadLocal component instance.
The adapter creates proxy instances, that will create the necessary instances on-the-fly invoking the methods of the
instance. Use this adapter, if you are instantiating your components in a single thread, but should be different when
accessed from different threads. See ThreadLocalizing for details.
Note: Because this implementation uses a Proxy, you can only access the methods exposed by the implemented
interfaces of your component.
ComponentAdapter.NOTHINGdelegate| Constructor and Description |
|---|
ThreadLocalized(ComponentAdapter<T> delegate)
Construct a ThreadLocalized using
Proxy instances. |
ThreadLocalized(ComponentAdapter<T> delegate,
ProxyFactory proxyFactory)
Construct a ThreadLocalized.
|
| Modifier and Type | Method and Description |
|---|---|
T |
getComponentInstance(PicoContainer pico,
Type into) |
String |
getDescriptor() |
accept, changeMonitor, componentHasLifecycle, currentMonitor, dispose, dispose, findAdapterOfType, getComponentImplementation, getComponentInstance, getComponentKey, getDelegate, hasLifecycle, isLazy, isStarted, start, start, stop, stop, toString, verifypublic ThreadLocalized(ComponentAdapter<T> delegate, ProxyFactory proxyFactory) throws PicoCompositionException
delegate - The ComponentAdapter to delegate.proxyFactory - The ProxyFactory to use.PicoCompositionException - Thrown if the component does not implement any interface.public ThreadLocalized(ComponentAdapter<T> delegate) throws PicoCompositionException
Proxy instances.delegate - The ComponentAdapter to delegate.PicoCompositionException - Thrown if the component does not implement any interface.public T getComponentInstance(PicoContainer pico, Type into) throws PicoCompositionException
getComponentInstance in interface ComponentAdapter<T>getComponentInstance in class AbstractBehavior<T>PicoCompositionExceptionpublic String getDescriptor()
Copyright © 2003-2014 Codehaus. All Rights Reserved.