ehcache

net.sf.ehcache.writer.writebehind.operations
Interface SingleOperation

All Superinterfaces:
KeyBasedOperation
All Known Implementing Classes:
DeleteOperation, WriteOperation

public interface SingleOperation
extends KeyBasedOperation

Interface to implement single operations that are performed with write-behind

Version:
$Id: SingleOperation.java 10058 2015-10-13 08:28:09Z ljacomet $
Author:
Geert Bevin

Method Summary
 BatchOperation createBatchOperation(List<? extends SingleOperation> operations)
          Creates a batch operation that corresponds to the operation type of this single operation.
 SingleOperationType getType()
          Returns a stable identifier for the type this operation can be classified in.
 void performSingleOperation(CacheWriter cacheWriter)
          Perform this operation as a single execution with the provided cache writer
 void throwAway(CacheWriter cacheWriter, RuntimeException e)
          Called when all retries have failed
 
Methods inherited from interface net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation
getCreationTime, getKey
 

Method Detail

performSingleOperation

void performSingleOperation(CacheWriter cacheWriter)
Perform this operation as a single execution with the provided cache writer

Parameters:
cacheWriter - the cache writer this operation should be performed upon

createBatchOperation

BatchOperation createBatchOperation(List<? extends SingleOperation> operations)
Creates a batch operation that corresponds to the operation type of this single operation.

This batch operation will not be stored in the queue anymore and is solely used for structuring. The data from the single operation will already be processed in the final form that will be expected by the CacheWriter that will be used to execute the batch operation.

Parameters:
operations - the single operations that need to be regrouped in the batch operation
Returns:
the created batch operation

getType

SingleOperationType getType()
Returns a stable identifier for the type this operation can be classified in. This is used to group and order batched operations.

Returns:
the identifier for this operation type

throwAway

void throwAway(CacheWriter cacheWriter,
               RuntimeException e)
Called when all retries have failed

Parameters:
cacheWriter - the CacheWriter to delegate to
e - the last exception encountered

ehcache

Copyright 2001-2015, Terracotta, Inc.