Top Description Fields Constructors Methods
net.sf.ehcache.store.compound

public Class ReadWriteSerializationCopyStrategy

extends Object
implements ReadWriteCopyStrategy<Element>
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.store.compound.ReadWriteCopyStrategy, java.io.Serializable
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .ObjectInputStream, .ObjectOutputStream, net.sf.ehcache.CacheException, .Element, .ElementIdHelper, net.sf.ehcache.util.PreferredLoaderObjectInputStream

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
Authors
Alex Snaps, Ludovic Orban

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Element

Returns:

the original object
copyForRead
(Element
the storage-ready copy
storedValue
,
ClassLoader loader)

Implements net.sf.ehcache.store.compound.ReadWriteCopyStrategy.copyForRead.

Reconstruct an object from its storage-ready copy.
public Element

Returns:

the storage-ready copy
copyForWrite
(Element
the value to copy
value
,
ClassLoader loader)

Implements net.sf.ehcache.store.compound.ReadWriteCopyStrategy.copyForWrite.

Deep copies some object and returns an internal storage-ready copy
public Element

Returns:

the duplicated element
duplicateElementWithNewValue
(final Element
the element to duplicate
element
,
final Object
the new element's value
newValue
)

Make a duplicate of an element but using the specified value

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides net.sf.ehcache.store.compound.ReadWriteCopyStrategy.serialVersionUID.

Constructor Detail

ReadWriteSerializationCopyStrategyback to summary
public ReadWriteSerializationCopyStrategy()

Method Detail

copyForReadback to summary
public Element copyForRead(Element storedValue, ClassLoader loader)

Implements net.sf.ehcache.store.compound.ReadWriteCopyStrategy.copyForRead.

Reconstruct an object from its storage-ready copy.

Parameters
storedValue:Element

the storage-ready copy

Returns:Element

the original object

copyForWriteback to summary
public Element copyForWrite(Element value, ClassLoader loader)

Implements net.sf.ehcache.store.compound.ReadWriteCopyStrategy.copyForWrite.

Deep copies some object and returns an internal storage-ready copy

Parameters
value:Element

the value to copy

Returns:Element

the storage-ready copy

duplicateElementWithNewValueback to summary
public Element duplicateElementWithNewValue(final Element element, final Object newValue)

Make a duplicate of an element but using the specified value

Parameters
element:Element

the element to duplicate

newValue:Object

the new element's value

Returns:Element

the duplicated element