T
- the type of the lazy valuepublic class ERXLazyValue<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ERXLazyValue.AjaxPageUserInfoCacheKeyInvalidator
AjaxPageUserInfoCacheKeyInvalidator triggers a cache invalidation when
the value of the specified key changes in the ERXResponseRewriter's
ajaxPageUserInfo.
|
static class |
ERXLazyValue.AlwaysInvalidator
Returns true from shouldInvalidate, causing the cache to always refresh.
|
static class |
ERXLazyValue.CacheKeyInvalidator
The base class for any invalidator that is triggered by the change in a
cache key.
|
static class |
ERXLazyValue.ConstantSource<T>
ConstantSource provides a Source implementation on top of a fixed value.
|
static interface |
ERXLazyValue.Invalidator
Invalidator provides an mechanism for selectively invalidating the cached
lazy value.
|
static class |
ERXLazyValue.KVCSource<T>
KVCSource provides a wrapper around a KVC binding, which is very useful
in components.
|
static class |
ERXLazyValue.MutableCacheKeyInvalidator
The base class for any invalidator that is triggered by the change in a
cache key with support for changing the value.
|
static class |
ERXLazyValue.NeverInvalidator
Returns false from shouldInvalidate, causing the cache to never refresh.
|
static class |
ERXLazyValue.PageUserInfoCacheKeyInvalidator
PageUserInfoCacheKeyInvalidator triggers a cache invalidation when the
value of the specified key changes in the ERXResponseRewriter's
pageUserInfo.
|
static interface |
ERXLazyValue.Source<T>
A source provides the undelying value (which is usually uncached) to a
lazy value.
|
static class |
ERXLazyValue.ThreadStorageCacheKeyInvalidator
ThreadStorageCacheKeyInvalidator triggers a cache invalidation when the
value of the specified key changes in the ERXThreadStorage.
|
static class |
ERXLazyValue.TimedInvalidator
TimedInvalidator specifies that the cached value should be invalidated
after a specified duration.
|
Constructor and Description |
---|
ERXLazyValue(ERXLazyValue.Source<T> dataSource)
Constructs a new ERXLazyValue with a data source and a NeverInvalidator,
which behaves like a "once" lazy value.
|
ERXLazyValue(ERXLazyValue.Source<T> dataSource,
ERXLazyValue.Invalidator invalidator)
Constructs a new ERXLazyValue with a data source and an invalidator.
|
ERXLazyValue(Object target,
String keyPath)
Constructs a new ERXLazyValue with a shortcut for a KVCSource and a
NeverInvalidator, which behaves like a "once" lazy value.
|
ERXLazyValue(Object target,
String keyPath,
ERXLazyValue.Invalidator invalidator)
Constructs a new ERXLazyValue with a shortcut for a KVCSource and an
invalidator.
|
Modifier and Type | Method and Description |
---|---|
void |
invalidate()
Forcefully invalidates the lazy value, regardless of the state of the
invalidator.
|
void |
setValue(T value)
Sets the backging value for this lazy value, which will always call
through to the underlying data source.
|
T |
value()
Returns the backing value for this lazy value, which will only sometimes
trigger a call through to the data source.
|
public ERXLazyValue(ERXLazyValue.Source<T> dataSource)
dataSource
- the data source for the lazy valuepublic ERXLazyValue(Object target, String keyPath)
target
- the target of the KVCSourcekeyPath
- the keypath of the KVCSourcepublic ERXLazyValue(Object target, String keyPath, ERXLazyValue.Invalidator invalidator)
target
- the target of the KVCSourcekeyPath
- the keypath of the KVCSourceinvalidator
- the invalidator to usepublic ERXLazyValue(ERXLazyValue.Source<T> dataSource, ERXLazyValue.Invalidator invalidator)
dataSource
- the data source for the lazy valueinvalidator
- the invalidator to usepublic void invalidate()
public T value()
public void setValue(T value)
value
- the new valueCopyright © 2002 – 2020 Project Wonder.