Class NonStopWriteBehind
- java.lang.Object
-
- net.sf.ehcache.writer.writebehind.NonStopWriteBehind
-
- All Implemented Interfaces:
WriteBehind
public class NonStopWriteBehind extends java.lang.Object implements WriteBehind
Non stop class for write behind- Author:
- npurwar
-
-
Constructor Summary
Constructors Constructor Description NonStopWriteBehind()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(CacheEntry entry)Add a delete operation for the given cache entrylonggetQueueSize()Gets the best estimate for items in the queue still awaiting processing.voidinit(WriteBehind writeBehind)voidsetOperationsFilter(OperationsFilter filter)Set the operations filter that should be used.voidstart(CacheWriter writerParam)Start the write behind queue with a cache writervoidstop()Stop the coordinator and all the internal data structures.voidwrite(Element element)Add a write operation for a given element.
-
-
-
Method Detail
-
init
public void init(WriteBehind writeBehind)
- Parameters:
writeBehind-
-
start
public void start(CacheWriter writerParam) throws CacheException
Description copied from interface:WriteBehindStart the write behind queue with a cache writer- Specified by:
startin interfaceWriteBehind- Parameters:
writerParam- the cache writer that should be used to process the operations- Throws:
CacheException- See Also:
WriteBehind.stop()
-
write
public void write(Element element)
Description copied from interface:WriteBehindAdd a write operation for a given element.- Specified by:
writein interfaceWriteBehind- Parameters:
element- the element for which a write operation will be added to the write behind queue
-
delete
public void delete(CacheEntry entry)
Description copied from interface:WriteBehindAdd a delete operation for the given cache entry- Specified by:
deletein interfaceWriteBehind- Parameters:
entry- the cache entry for which a delete operation will be added to the write behind queue
-
setOperationsFilter
public void setOperationsFilter(OperationsFilter filter)
Description copied from interface:WriteBehindSet the operations filter that should be used.- Specified by:
setOperationsFilterin interfaceWriteBehind- Parameters:
filter- the filter that will be used as of now
-
stop
public void stop() throws CacheExceptionDescription copied from interface:WriteBehindStop the coordinator and all the internal data structures.This stops as quickly as possible without losing any previously added items. However, no guarantees are made towards the processing of these items. It's highly likely that items are still inside the internal data structures and not processed.
- Specified by:
stopin interfaceWriteBehind- Throws:
CacheException- See Also:
WriteBehind.start(net.sf.ehcache.writer.CacheWriter)
-
getQueueSize
public long getQueueSize()
Description copied from interface:WriteBehindGets the best estimate for items in the queue still awaiting processing. Not including elements currently processed- Specified by:
getQueueSizein interfaceWriteBehind- Returns:
- the amount of elements still awaiting processing.
-
-