T - public abstract class AbstractCache<T> extends Object implements Cache<T>
Cache implementations. It provides events DisposableCacheValue management.| Modifier and Type | Field and Description |
|---|---|
protected EventListenerList |
cacheEntryListeners
The list of listener to called when events appends on a cache entry.
|
protected CacheConfiguration |
configuration
The configuration used to create the cache.
|
| Constructor and Description |
|---|
AbstractCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCacheEntryListener(CacheEntryListener<T> listener)
Add the provided listener to the cache to catch events on entries like add, remove etc.
|
void |
dispose()
Release all the resources this cache use.
|
protected void |
disposeCacheValue(T value)
Dispose the value being removed from the cache.
|
void |
removeCacheEntryListener(CacheEntryListener<T> listener)
Remove the provided listener from the list of listeners.
|
protected void |
sendEntryAddedEvent(CacheEntryEvent<T> event)
Helper method to send event when a new cache entry is inserted.
|
protected void |
sendEntryModifiedEvent(CacheEntryEvent<T> event)
Helper method to send event when a cache entry is modified.
|
protected void |
sendEntryRemovedEvent(CacheEntryEvent<T> event)
Helper method to send event when an existing cache entry is removed.
|
protected CacheConfiguration configuration
protected final EventListenerList cacheEntryListeners
public void dispose()
Cachepublic void addCacheEntryListener(CacheEntryListener<T> listener)
CacheaddCacheEntryListener in interface Cache<T>listener - the implemented listener.public void removeCacheEntryListener(CacheEntryListener<T> listener)
CacheremoveCacheEntryListener in interface Cache<T>listener - the implemented listener.protected void sendEntryAddedEvent(CacheEntryEvent<T> event)
event - the event to send.protected void sendEntryRemovedEvent(CacheEntryEvent<T> event)
event - the event to send.protected void sendEntryModifiedEvent(CacheEntryEvent<T> event)
event - the event to send.protected void disposeCacheValue(T value)
value - the value to disposeCopyright © 2004–2015 XWiki. All rights reserved.