org.terracotta.cache.serialization
Class NonDsoSerializationStrategy

java.lang.Object
  extended by org.terracotta.cache.serialization.NonDsoSerializationStrategy
All Implemented Interfaces:
SerializationStrategy, UnsafeSerializationStrategy

public class NonDsoSerializationStrategy
extends Object
implements SerializationStrategy, UnsafeSerializationStrategy

A non-clusterable serialization strategy.


Constructor Summary
NonDsoSerializationStrategy()
           
 
Method Summary
 Object deserialize(byte[] data)
          Deserialize the serialized value returning a new representation.
 Object deserialize(byte[] data, ClassLoader loader)
          Deserialize the serialized value using the specified loader, and returning a new representation.
 String generateStringKeyFor(Object value)
          Convert the given key into a portable String form.
 byte[] serialize(Object value)
          Serialize the given value into a detached, portable form.
 Object unsafelyDeserialize(byte[] data)
           
 Object unsafelyDeserialize(byte[] value, ClassLoader classLoader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonDsoSerializationStrategy

public NonDsoSerializationStrategy()
Method Detail

deserialize

public Object deserialize(byte[] data)
                   throws IOException,
                          ClassNotFoundException
Description copied from interface: SerializationStrategy
Deserialize the serialized value returning a new representation.

Specified by:
deserialize in interface SerializationStrategy
Parameters:
data - serialized form
Returns:
a new deserialized value
Throws:
IOException - if deserialization fails
ClassNotFoundException - if a required class is not found

generateStringKeyFor

public String generateStringKeyFor(Object value)
                            throws IOException
Description copied from interface: SerializationStrategy
Convert the given key into a portable String form.

Specified by:
generateStringKeyFor in interface SerializationStrategy
Parameters:
value - key to serialize
Returns:
a portable String key
Throws:
IOException - if serialization fails

serialize

public byte[] serialize(Object value)
                 throws IOException
Description copied from interface: SerializationStrategy
Serialize the given value into a detached, portable form.

Specified by:
serialize in interface SerializationStrategy
Parameters:
value - value to serialize
Returns:
serialized form
Throws:
IOException - if serialization fails

deserialize

public Object deserialize(byte[] data,
                          ClassLoader loader)
                   throws IOException,
                          ClassNotFoundException
Description copied from interface: SerializationStrategy
Deserialize the serialized value using the specified loader, and returning a new representation.

Specified by:
deserialize in interface SerializationStrategy
Parameters:
data - serialized form
loader - to use during deserialization
Returns:
a new deserialized value
Throws:
IOException - if deserialization fails
ClassNotFoundException - if a required class is not found

unsafelyDeserialize

public Object unsafelyDeserialize(byte[] value,
                                  ClassLoader classLoader)
                           throws IOException,
                                  ClassNotFoundException
Specified by:
unsafelyDeserialize in interface UnsafeSerializationStrategy
Throws:
IOException
ClassNotFoundException

unsafelyDeserialize

public Object unsafelyDeserialize(byte[] data)
                           throws IOException,
                                  ClassNotFoundException
Specified by:
unsafelyDeserialize in interface UnsafeSerializationStrategy
Throws:
IOException
ClassNotFoundException


Copyright © 2015 Terracotta, Inc.. All Rights Reserved.