public class WriteBehindManager extends Object implements CacheWriterManager
WriterManager that writes elements to a queue first and in the background sends the to the CacheWriter.| Constructor and Description |
|---|
WriteBehindManager(Cache cache)
Create using the given cache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Cleans up the resources of the cache writer manager.
|
long |
getQueueSize()
Gets the best estimate for items in the queue still awaiting processing.
|
void |
init(Cache cache)
Initialize the cache writer manager.
|
void |
put(Element element)
Schedule a put operation for this element in the CacheWriterManager, which will call the CacheWriter when appropriate.
|
void |
remove(CacheEntry entry)
Schedule a remove operation for this key in the CacheWriterManager, which will call the CacheWriter when appropriate.
|
public WriteBehindManager(Cache cache)
cache - cachepublic void init(Cache cache) throws CacheException
This method is called when the cache writer manager is registered to a cache.
init in interface CacheWriterManagercache - the cache with which the writer managerCacheException - when an exception occurs during the initialisation of the cachepublic void put(Element element) throws CacheException
put in interface CacheWriterManagerelement - the element that should be used for the operationCacheException - when an exception occurs during the writing of the elementpublic void remove(CacheEntry entry) throws CacheException
remove in interface CacheWriterManagerentry - the entry that should be used for the operationCacheException - when an exception occurs during the removal of the elementpublic void dispose()
This method is called when the manager is unregistered from a cache.
dispose in interface CacheWriterManagerpublic long getQueueSize()
Copyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.