org.terracotta.cache.serialization
Class DsoSerializationStrategy<T>

java.lang.Object
  extended by org.terracotta.cache.serialization.DsoSerializationStrategy<T>
All Implemented Interfaces:
com.tc.object.bytecode.NotClearable, SerializationStrategy<T>
Direct Known Subclasses:
ElementSerializationStrategy

public class DsoSerializationStrategy<T>
extends Object
implements SerializationStrategy<T>, com.tc.object.bytecode.NotClearable


Nested Class Summary
protected static class DsoSerializationStrategy.OIS
           
protected static class DsoSerializationStrategy.OOS
           
 
Field Summary
protected static byte HIGH_BIT
           
protected  org.terracotta.cache.serialization.ObjectStreamClassSerializer oscSerializer
           
 
Constructor Summary
DsoSerializationStrategy()
           
DsoSerializationStrategy(boolean internalLocking)
           
 
Method Summary
protected static int decodeInt(InputStream is)
           
 T deserialize(byte[] data)
           
 T deserialize(byte[] data, ClassLoader loader)
           
protected static void encodeInt(OutputStream os, int value)
           
 String generateStringKeyFor(Object key)
           
 byte[] serialize(T value)
           
protected  void writeStringKey(Object key, ObjectOutputStream oos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIGH_BIT

protected static final byte HIGH_BIT
See Also:
Constant Field Values

oscSerializer

protected final org.terracotta.cache.serialization.ObjectStreamClassSerializer oscSerializer
Constructor Detail

DsoSerializationStrategy

public DsoSerializationStrategy()

DsoSerializationStrategy

public DsoSerializationStrategy(boolean internalLocking)
Method Detail

deserialize

public T deserialize(byte[] data)
              throws IOException,
                     ClassNotFoundException
Specified by:
deserialize in interface SerializationStrategy<T>
Throws:
IOException
ClassNotFoundException

deserialize

public T deserialize(byte[] data,
                     ClassLoader loader)
              throws IOException,
                     ClassNotFoundException
Specified by:
deserialize in interface SerializationStrategy<T>
Throws:
IOException
ClassNotFoundException

serialize

public byte[] serialize(T value)
                 throws IOException
Specified by:
serialize in interface SerializationStrategy<T>
Throws:
IOException

generateStringKeyFor

public String generateStringKeyFor(Object key)
                            throws IOException
Specified by:
generateStringKeyFor in interface SerializationStrategy<T>
Throws:
IOException

writeStringKey

protected void writeStringKey(Object key,
                              ObjectOutputStream oos)
                       throws IOException
Throws:
IOException

decodeInt

protected static final int decodeInt(InputStream is)
                              throws IOException
Throws:
IOException

encodeInt

protected static final void encodeInt(OutputStream os,
                                      int value)
                               throws IOException
Throws:
IOException


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