Top Description Fields Constructors Methods
net.sf.ehcache.writer.writebehind

public Class NonStopWriteBehind

extends Object
implements WriteBehind
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.writer.writebehind.WriteBehind
Imports
java.util.concurrent.locks.ReentrantReadWriteLock, net.sf.ehcache.CacheEntry, .CacheException, .Element, net.sf.ehcache.writer.CacheWriter

Non stop class for write behind
Author
npurwar

Field Summary

Modifier and TypeField and Description
private WriteBehind
private OperationsFilter<T>
private boolean
private boolean
private final ReentrantReadWriteLock
private CacheWriter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
delete(CacheEntry
the cache entry for which a delete operation will be added to the write behind queue
entry
)

Implements net.sf.ehcache.writer.writebehind.WriteBehind.delete.

Add a delete operation for the given cache entry
public long
getQueueSize()

Implements net.sf.ehcache.writer.writebehind.WriteBehind.getQueueSize.

Gets the best estimate for items in the queue still awaiting processing.
public void
init(WriteBehind writeBehind)

public void
setOperationsFilter(OperationsFilter<T>
the filter that will be used as of now
filter
)

Implements net.sf.ehcache.writer.writebehind.WriteBehind.setOperationsFilter.

Set the operations filter that should be used.
public void
start(CacheWriter
the cache writer that should be used to process the operations
writerParam
)

Implements net.sf.ehcache.writer.writebehind.WriteBehind.start.

Start the write behind queue with a cache writer
public void
stop()

Implements net.sf.ehcache.writer.writebehind.WriteBehind.stop.

Stop the coordinator and all the internal data structures.
public void
write(Element
the element for which a write operation will be added to the write behind queue
element
)

Implements net.sf.ehcache.writer.writebehind.WriteBehind.write.

Add a write operation for a given element.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private WriteBehind delegate
filterback to summary
private OperationsFilter<T> filter
isStartedback to summary
private boolean isStarted
isStoppedback to summary
private boolean isStopped
lockback to summary
private final ReentrantReadWriteLock lock
writerback to summary
private CacheWriter writer

Constructor Detail

NonStopWriteBehindback to summary
public NonStopWriteBehind()

Method Detail

deleteback to summary
public void delete(CacheEntry entry)

Implements net.sf.ehcache.writer.writebehind.WriteBehind.delete.

Doc from net.sf.ehcache.writer.writebehind.WriteBehind.delete.

Add a delete operation for the given cache entry

Parameters
entry:CacheEntry

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

Annotations
@Override
getQueueSizeback to summary
public long getQueueSize()

Implements net.sf.ehcache.writer.writebehind.WriteBehind.getQueueSize.

Doc from net.sf.ehcache.writer.writebehind.WriteBehind.getQueueSize.

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

Returns:long

the amount of elements still awaiting processing.

Annotations
@Override
initback to summary
public void init(WriteBehind writeBehind)
setOperationsFilterback to summary
public void setOperationsFilter(OperationsFilter<T> filter)

Implements net.sf.ehcache.writer.writebehind.WriteBehind.setOperationsFilter.

Doc from net.sf.ehcache.writer.writebehind.WriteBehind.setOperationsFilter.

Set the operations filter that should be used.

Parameters
filter:OperationsFilter<T>

the filter that will be used as of now

Annotations
@Override
startback to summary
public void start(CacheWriter writerParam) throws CacheException

Implements net.sf.ehcache.writer.writebehind.WriteBehind.start.

Doc from net.sf.ehcache.writer.writebehind.WriteBehind.start.

Start the write behind queue with a cache writer

Parameters
writerParam:CacheWriter

the cache writer that should be used to process the operations

Annotations
@Override
stopback to summary
public void stop() throws CacheException

Implements net.sf.ehcache.writer.writebehind.WriteBehind.stop.

Doc from net.sf.ehcache.writer.writebehind.WriteBehind.stop.

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.

Annotations
@Override
writeback to summary
public void write(Element element)

Implements net.sf.ehcache.writer.writebehind.WriteBehind.write.

Doc from net.sf.ehcache.writer.writebehind.WriteBehind.write.

Add a write operation for a given element.

Parameters
element:Element

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

Annotations
@Override