org.apache.jcs.utils.serialization
Class SerializationConversionUtil

java.lang.Object
  extended by org.apache.jcs.utils.serialization.SerializationConversionUtil

public class SerializationConversionUtil
extends Object

This uses a supplied Serializer to convert to and from cache elements.

Author:
Aaron Smuts

Constructor Summary
SerializationConversionUtil()
           
 
Method Summary
static
<K extends Serializable,V extends Serializable>
ICacheElement<K,V>
getDeSerializedCacheElement(ICacheElementSerialized<K,V> serialized, IElementSerializer elementSerializer)
          This returns a wrapper that has a de-serialized version of the value instead of the serialized value.
static
<K extends Serializable,V extends Serializable>
ICacheElementSerialized<K,V>
getSerializedCacheElement(ICacheElement<K,V> element, IElementSerializer elementSerializer)
          This returns a wrapper that has a serialized version of the value instead of the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializationConversionUtil

public SerializationConversionUtil()
Method Detail

getSerializedCacheElement

public static <K extends Serializable,V extends Serializable> ICacheElementSerialized<K,V> getSerializedCacheElement(ICacheElement<K,V> element,
                                                                                                                     IElementSerializer elementSerializer)
                                                                                                        throws IOException
This returns a wrapper that has a serialized version of the value instead of the value.

Parameters:
element -
elementSerializer - the serializer to be used.
Returns:
null for null;
Throws:
IOException

getDeSerializedCacheElement

public static <K extends Serializable,V extends Serializable> ICacheElement<K,V> getDeSerializedCacheElement(ICacheElementSerialized<K,V> serialized,
                                                                                                             IElementSerializer elementSerializer)
                                                                                                throws IOException,
                                                                                                       ClassNotFoundException
This returns a wrapper that has a de-serialized version of the value instead of the serialized value.

Parameters:
serialized -
elementSerializer - the serializer to be used.
Returns:
null for null;
Throws:
IOException
ClassNotFoundException


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.