ehcache

net.sf.ehcache.store.compound
Class LegacyCopyStrategyAdapter

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

public class LegacyCopyStrategyAdapter
extends Object
implements ReadWriteCopyStrategy<Element>

ReadWriteCopyStrategy adaptor for a legacy CopyStrategy instance

Author:
Ludovic Orban
See Also:
Serialized Form

Constructor Summary
LegacyCopyStrategyAdapter(CopyStrategy legacyCopyStrategy)
          create a LegacyCopyStrategyAdapter
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegacyCopyStrategyAdapter

public LegacyCopyStrategyAdapter(CopyStrategy legacyCopyStrategy)
create a LegacyCopyStrategyAdapter

Parameters:
legacyCopyStrategy - the legacy CopyStrategy to adapt
Method Detail

copyForWrite

public Element copyForWrite(Element value,
                            ClassLoader loader)
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)
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

ehcache

Copyright 2001-2016, Terracotta, Inc.