|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.foundation.ERXLazyValue<T>
T
- the type of the lazy valuepublic class ERXLazyValue<T>
ERXLazyValue provides a way to model lazy-loaded values that invalidate with different methods. This is very useful for storing expensive values that are returned from bound component methods as well as values that are cached that are influenced by different areas of a single page (i.e. ajax operations on one part of the page that need to invalidate a cache on another part of the page).
Nested Class Summary | |
---|---|
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. |
Field Summary | |
---|---|
static org.apache.log4j.Logger |
log
|
Constructor Summary | |
---|---|
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(java.lang.Object target,
java.lang.String keyPath)
Constructs a new ERXLazyValue with a shortcut for a KVCSource and a NeverInvalidator, which behaves like a "once" lazy value. |
|
ERXLazyValue(java.lang.Object target,
java.lang.String keyPath,
ERXLazyValue.Invalidator invalidator)
Constructs a new ERXLazyValue with a shortcut for a KVCSource and an invalidator. |
Method Summary | |
---|---|
void |
invalidate()
Forecfully 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static org.apache.log4j.Logger log
Constructor Detail |
---|
public ERXLazyValue(ERXLazyValue.Source<T> dataSource)
dataSource
- the data source for the lazy valuepublic ERXLazyValue(java.lang.Object target, java.lang.String keyPath)
target
- the target of the KVCSourcekeyPath
- the keypath of the KVCSourcepublic ERXLazyValue(java.lang.Object target, java.lang.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 useMethod Detail |
---|
public void invalidate()
public T value()
public void setValue(T value)
value
- the new value
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |