ehcache

net.sf.ehcache.writer.writebehind
Interface WriteBehind

All Known Implementing Classes:
AbstractWriteBehindQueue, NonStopWriteBehind, WriteBehindQueueManager

public interface WriteBehind

An interface for write behind behavior.

Version:
$Id: WriteBehind.java 5594 2012-05-07 16:04:31Z cdennis $
Author:
Geert Bevin

Method Summary
 void delete(CacheEntry entry)
          Add a delete operation for the given cache entry
 long getQueueSize()
          Gets the best estimate for items in the queue still awaiting processing.
 void setOperationsFilter(OperationsFilter filter)
          Set the operations filter that should be used.
 void start(CacheWriter writer)
          Start the write behind queue with a cache writer
 void stop()
          Stop the coordinator and all the internal data structures.
 void write(Element element)
          Add a write operation for a given element.
 

Method Detail

start

void start(CacheWriter writer)
           throws CacheException
Start the write behind queue with a cache writer

Parameters:
writer - the cache writer that should be used to process the operations
Throws:
CacheException
See Also:
stop()

write

void write(Element element)
Add a write operation for a given element.

Parameters:
element - the element for which a write operation will be added to the write behind queue

delete

void delete(CacheEntry entry)
Add a delete operation for the given cache entry

Parameters:
entry - the cache entry for which a delete operation will be added to the write behind queue

setOperationsFilter

void setOperationsFilter(OperationsFilter filter)
Set the operations filter that should be used.

Parameters:
filter - the filter that will be used as of now

stop

void stop()
          throws CacheException
Stop 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.

Throws:
CacheException
See Also:
start(net.sf.ehcache.writer.CacheWriter)

getQueueSize

long getQueueSize()
Gets the best estimate for items in the queue still awaiting processing. Not including elements currently processed

Returns:
the amount of elements still awaiting processing.

ehcache

Copyright 2001-2014, Terracotta, Inc.