org.terracotta.modules.ehcache.writebehind
Class CacheWriterProcessor

java.lang.Object
  extended by org.terracotta.modules.ehcache.writebehind.CacheWriterProcessor
All Implemented Interfaces:
ItemProcessor<SingleAsyncOperation>

public class CacheWriterProcessor
extends Object
implements ItemProcessor<SingleAsyncOperation>

An implementation of ItemProcessor that delegates the processing to a CacheWriter instance

Instances of this class will be used when items are processed one by one. Note that CacheWriter instances will not be shared across a Terracotta DSO cluster and are intended to be local on a node. They are tied to an individual write behind queue. You're thus free to use local resources in an CacheWriter, like database connections or file handles.

Author:
Abhishek Maheshwari

Constructor Summary
CacheWriterProcessor(CacheWriter cacheWriter)
          Creates a new item processor for a specific cache writer.
 
Method Summary
 void process(Collection<SingleAsyncOperation> items)
           
 void process(SingleAsyncOperation item)
           
 void throwAway(SingleAsyncOperation item, RuntimeException runtimeException)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheWriterProcessor

public CacheWriterProcessor(CacheWriter cacheWriter)
Creates a new item processor for a specific cache writer.

Parameters:
cacheWriter - the cache writer for which the wrapper has to be created
serializationStrategy - the strategy that should be used to serialize and deserialize, if needed
Method Detail

process

public void process(SingleAsyncOperation item)
Specified by:
process in interface ItemProcessor<SingleAsyncOperation>

process

public void process(Collection<SingleAsyncOperation> items)
Specified by:
process in interface ItemProcessor<SingleAsyncOperation>

throwAway

public void throwAway(SingleAsyncOperation item,
                      RuntimeException runtimeException)
Specified by:
throwAway in interface ItemProcessor<SingleAsyncOperation>


Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.