ehcache

net.sf.ehcache.store.compound
Class ReadWriteSerializationCopyStrategy

java.lang.Object
  extended by net.sf.ehcache.store.compound.ReadWriteSerializationCopyStrategy
All Implemented Interfaces:
Serializable, ReadWriteCopyStrategy<Element>

public class ReadWriteSerializationCopyStrategy
extends Object
implements ReadWriteCopyStrategy<Element>

A copy strategy that can use partial (if both copy on read and copy on write are set) or full Serialization to copy the object graph

Author:
Alex Snaps, Ludovic Orban
See Also:
Serialized Form

Constructor Summary
ReadWriteSerializationCopyStrategy()
           
 
Method Summary
 Element copyForRead(Element storedValue, ClassLoader loader)
          Reconstruct an object from its storage-ready copy.
 Element copyForWrite(Element value, ClassLoader loader)
          Deep copies some object and returns an internal storage-ready copy
 Element duplicateElementWithNewValue(Element element, Object newValue)
          Make a duplicate of an element but using the specified value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadWriteSerializationCopyStrategy

public ReadWriteSerializationCopyStrategy()
Method Detail

copyForWrite

public Element copyForWrite(Element value,
                            ClassLoader loader)
Description copied from interface: ReadWriteCopyStrategy
Deep copies some object and returns an internal storage-ready copy

Specified by:
copyForWrite in interface ReadWriteCopyStrategy<Element>
Parameters:
value - the value to copy
Returns:
the storage-ready copy

copyForRead

public Element copyForRead(Element storedValue,
                           ClassLoader loader)
Description copied from interface: ReadWriteCopyStrategy
Reconstruct an object from its storage-ready copy.

Specified by:
copyForRead in interface ReadWriteCopyStrategy<Element>
Parameters:
storedValue - the storage-ready copy
Returns:
the original object

duplicateElementWithNewValue

public Element duplicateElementWithNewValue(Element element,
                                            Object newValue)
Make a duplicate of an element but using the specified value

Parameters:
element - the element to duplicate
newValue - the new element's value
Returns:
the duplicated element

ehcache

Copyright 2001-2016, Terracotta, Inc.