public class Cached<T> extends Stored<T>
ComponentAdapter
implementation that caches the component instance.
This adapter supports components with a lifecycle, as it is a
lifecycle manager
which will apply the delegate's
lifecycle strategy
to the cached
component instance. The lifecycle state is maintained so that the component
instance behaves in the expected way: it can't be started if already started,
it can't be started or stopped if disposed, it can't be stopped if not
started, it can't be disposed if already disposed.
Stored.Instance<T>
ComponentAdapter.NOTHING
delegate
Constructor and Description |
---|
Cached(ComponentAdapter delegate) |
Cached(ComponentAdapter delegate,
ObjectReference<Stored.Instance<T>> instanceReference) |
Modifier and Type | Method and Description |
---|---|
String |
getDescriptor()
Get a string key descriptor of the component adapter for use in toString()
|
componentHasLifecycle, dispose, flush, getComponentInstance, getLifecycleDescriptor, getStoredObject, isStarted, start, stop
accept, changeMonitor, currentMonitor, dispose, findAdapterOfType, getComponentImplementation, getComponentInstance, getComponentKey, getDelegate, hasLifecycle, isLazy, start, stop, toString, verify
public Cached(ComponentAdapter delegate)
public Cached(ComponentAdapter delegate, ObjectReference<Stored.Instance<T>> instanceReference)
public String getDescriptor()
ComponentAdapter
getDescriptor
in interface ComponentAdapter<T>
getDescriptor
in class Stored<T>
Copyright © 2003–2016 Codehaus. All rights reserved.