org.terracotta.modules.ehcache.writebehind.operations
Interface SingleAsyncOperation

All Superinterfaces:
Serializable
All Known Implementing Classes:
DeleteAsyncOperation, WriteAsyncOperation

public interface SingleAsyncOperation
extends Serializable

Interface to implement single operations that are performed in the write behind implementation that using an AsyncCoordinator underneath

Author:
Abhishek Maheshwari

Method Summary
 long getCreationTime()
          Retrieves the moment when the operation was created.
 Element getElement()
           
 Object getKey()
          Retrieves the key for this operation.
 void performSingleOperation(CacheWriter cacheWriter)
          Perform this operation as a single execution with the provided cache writer
 void throwAwayElement(CacheWriter cacheWriter, RuntimeException e)
          This method will be called to throw the item away.
 

Method Detail

performSingleOperation

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

Parameters:
cacheWriter - the cache writer this operation should be performed upon
serializationStrategy - the strategy that should be used to serialize and deserialize, if needed
Throws:
ClassNotFoundException
IOException

getKey

Object getKey()
Retrieves the key for this operation.

Parameters:
serializationStrategy - the serialization strategy that should be used to create the key
Returns:
this operation's key

getElement

Element getElement()

getCreationTime

long getCreationTime()
Retrieves the moment when the operation was created.

Returns:
the creation time in milliseconds

throwAwayElement

void throwAwayElement(CacheWriter cacheWriter,
                      RuntimeException e)
This method will be called to throw the item away.

Parameters:
cacheWriter -
serializationStrategy -
e -
Throws:
ClassNotFoundException
IOException


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