static class SegmentCacheManager.CompositeSegmentCache extends Object implements SegmentCache
SegmentCacheWorker objects (each of which
 is backed by a SegmentCache appear to be a SegmentCache.
 For most operations, it is easier to operate on a single cache.
 It is usually clear whether operations should quit when finding the first
 match, or to operate on all workers. (For example, remove(mondrian.spi.SegmentHeader) tries
 to remove the segment header from all workers, and returns whether it
 was removed from any of them.) This class just does what seems
 most typical. If you want another behavior for a particular operation,
 operate on the workers directly.
SegmentCache.SegmentCacheInjector, SegmentCache.SegmentCacheListener| Modifier and Type | Field and Description | 
|---|---|
(package private) List<SegmentCacheWorker> | 
workers  | 
| Constructor and Description | 
|---|
CompositeSegmentCache(List<SegmentCacheWorker> workers)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addListener(SegmentCache.SegmentCacheListener listener)
Adds a listener to this segment cache implementation. 
 | 
SegmentBody | 
get(SegmentHeader header)
Returns a SegmentBody once the
 cache has returned any results, or null if no
 segment corresponding to the header could be found. 
 | 
List<SegmentHeader> | 
getSegmentHeaders()
Returns a list of all segments present in the cache. 
 | 
boolean | 
put(SegmentHeader header,
   SegmentBody body)
Stores a segment data in the cache. 
 | 
boolean | 
remove(SegmentHeader header)
Removes a segment from the cache. 
 | 
void | 
removeListener(SegmentCache.SegmentCacheListener listener)
Unregisters a listener from this segment cache implementation. 
 | 
boolean | 
supportsRichIndex()
Tells Mondrian whether this segment cache uses the  
SegmentHeader
 objects as an index, thus preserving them in a serialized state, or if
 it uses its identification number only. | 
void | 
tearDown()
Tear down and clean up the cache. 
 | 
final List<SegmentCacheWorker> workers
public CompositeSegmentCache(List<SegmentCacheWorker> workers)
public SegmentBody get(SegmentHeader header)
SegmentCacheCache implementations are at liberty to 'forget' segments. Therefore it is allowable for this method to return null at any time
get in interface SegmentCacheheader - The header of the segment to find.
 Consider this as a key.null
 if no corresponding segment could be found in cache.public List<SegmentHeader> getSegmentHeaders()
SegmentCachegetSegmentHeaders in interface SegmentCachepublic boolean put(SegmentHeader header, SegmentBody body)
SegmentCacheput in interface SegmentCacheheader - The header of the segment.body - The segment body to cache.public boolean remove(SegmentHeader header)
SegmentCacheremove in interface SegmentCacheheader - The header of the segment we want to remove.public void tearDown()
SegmentCachetearDown in interface SegmentCachepublic void addListener(SegmentCache.SegmentCacheListener listener)
SegmentCacheSegmentCache.SegmentCacheListener.SegmentCacheEvent instances.addListener in interface SegmentCachelistener - The listener to attach to this cache.public void removeListener(SegmentCache.SegmentCacheListener listener)
SegmentCacheremoveListener in interface SegmentCachelistener - The listener to remove.public boolean supportsRichIndex()
SegmentCacheSegmentHeader
 objects as an index, thus preserving them in a serialized state, or if
 it uses its identification number only.
 Not using a rich index prevents Mondrian from doing partial cache invalidation.
It is assumed that this method returns fairly quickly, and for a given cache always returns the same value.
supportsRichIndex in interface SegmentCache