Top Description Methods
net.sf.ehcache.writer.writebehind.operations

public Interface SingleOperation

extends KeyBasedOperation
Known Direct Implementers
net.sf.ehcache.writer.writebehind.operations.WriteOperation, net.sf.ehcache.writer.writebehind.operations.DeleteOperation
Imports
net.sf.ehcache.writer.CacheWriter, java.util.List

Interface to implement single operations that are performed with write-behind
Author
Geert Bevin
Version
$Id: SingleOperation.java 10789 2018-04-26 02:08:13Z adahanne $

Method Summary

Modifier and TypeMethod and Description
public BatchOperation

Returns:

the created batch operation
createBatchOperation
(List<? extends SingleOperation>
the single operations that need to be regrouped in the batch operation
operations
)

Creates a batch operation that corresponds to the operation type of this single operation.

public SingleOperationType

Returns:

the identifier for this operation type
getType
()

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

public void
performSingleOperation(CacheWriter
the cache writer this operation should be performed upon
cacheWriter
)

Perform this operation as a single execution with the provided cache writer

public void
throwAway(final CacheWriter
the CacheWriter to delegate to
cacheWriter
,
RuntimeException
the last exception encountered
e
)

Called when all retries have failed

Inherited from net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation:
getCreationTimegetKey

Method Detail

createBatchOperationback to summary
public 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:List<? extends SingleOperation>

the single operations that need to be regrouped in the batch operation

Returns:BatchOperation

the created batch operation

getTypeback to summary
public 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:SingleOperationType

the identifier for this operation type

performSingleOperationback to summary
public void performSingleOperation(CacheWriter cacheWriter)

Perform this operation as a single execution with the provided cache writer

Parameters
cacheWriter:CacheWriter

the cache writer this operation should be performed upon

throwAwayback to summary
public void throwAway(final CacheWriter cacheWriter, RuntimeException e)

Called when all retries have failed

Parameters
cacheWriter:CacheWriter

the CacheWriter to delegate to

e:RuntimeException

the last exception encountered