|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
K - Type of keys in the cache. The keys
should bahave well as map keys (most probably, the hashCode() and
equals() methods should be overriden).T - Type of the values bound to the keys in the cache.public interface CacheItemDataSource<K,T>
Basic interface when using a renewable cache item --- defines methods, which
are used to determine what values should be put to the cache. The init(Object) method
is called when a user demands a value for a key that hasn't been accessed before.
That value is then placed in the cache, and updated periodically in the background,
using the update(Object, Object) method. How often the updates happen,
depends on the settings of the RenewableCacheServiceMBean and on
settings passed when creating the cache item
(CacheItem#create(CacheItemDataSource, org.jboss.cache.Fqn, String, long)).
| Method Summary | |
|---|---|
java.lang.String |
getInfo()
|
T |
init(K key)
Called when the user demands an object which hasn't been accessed before, and thus, which hasn't been yet initialized. |
ValueChange<T> |
update(K key,
T currentObject)
Called by the service periodically to update the object held in the cache, bound to the given key. |
| Method Detail |
|---|
ValueChange<T> update(K key,
T currentObject)
key - Key of the object to update.currentObject - Current value held in the cache.
ValueChange.noChange() to indicate that the value currently held in the cache
shouldn't be changed.ValueChange.changeTo(Object) to bind a new value to the given key in
the cache.T init(K key)
key - Key of the object to initialize.
java.lang.String getInfo()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||