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

java.lang.Object
  extended by org.terracotta.cache.serialization.DsoSerializationStrategy<T>
      extended by org.terracotta.cache.serialization.DsoSerializationStrategy2<T>
Type Parameters:
T - value type
All Implemented Interfaces:
SerializationStrategy<T>, SerializationStrategy2<T>, UnsafeSerializationStrategy<T>
Direct Known Subclasses:
DsoSerializationStrategy3

public class DsoSerializationStrategy2<T>
extends DsoSerializationStrategy<T>
implements SerializationStrategy2<T>

V2 DsoSerializationStrategy


Nested Class Summary
 
Nested classes/interfaces inherited from class org.terracotta.cache.serialization.DsoSerializationStrategy
DsoSerializationStrategy.OIS, DsoSerializationStrategy.OOS
 
Field Summary
 
Fields inherited from class org.terracotta.cache.serialization.DsoSerializationStrategy
HIGH_BIT, oscSerializer
 
Constructor Summary
DsoSerializationStrategy2()
          Construct a fully locking clusterable serialization strategy.
DsoSerializationStrategy2(boolean internalLocking)
          Constructs an optionally locked clusterable serialization strategy.
 
Method Summary
 Object deserializeStringKey(String key)
          Deserialize a given key object into the "real" key object.
 Object deserializeStringKey(String key, ClassLoader loader)
          Deserialize a given key object into the "real" key object.
 String generateStringKeyFor(Object key)
          Convert the given key into a portable String form.
protected  Object readStringKey(ObjectInputStream ois)
           
 
Methods inherited from class org.terracotta.cache.serialization.DsoSerializationStrategy
decodeInt, deserialize, deserialize, encodeInt, serialize, unsafelyDeserialize, unsafelyDeserialize, writeStringKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.terracotta.cache.serialization.SerializationStrategy
deserialize, deserialize, serialize
 

Constructor Detail

DsoSerializationStrategy2

public DsoSerializationStrategy2()
Construct a fully locking clusterable serialization strategy.


DsoSerializationStrategy2

public DsoSerializationStrategy2(boolean internalLocking)
Constructs an optionally locked clusterable serialization strategy.

Non-locked instances can be used to provider tighter over lock scoping, and associated transaction scoping when serialization strategies are being used within operations that are intended to be atomic.

Parameters:
internalLocking - true if internal locking should be applied
Method Detail

generateStringKeyFor

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

Specified by:
generateStringKeyFor in interface SerializationStrategy<T>
Overrides:
generateStringKeyFor in class DsoSerializationStrategy<T>
Parameters:
key - key to serialize
Returns:
a portable String key
Throws:
IOException - if serialization fails

deserializeStringKey

public Object deserializeStringKey(String key,
                                   ClassLoader loader)
                            throws IOException,
                                   ClassNotFoundException
Description copied from interface: SerializationStrategy2
Deserialize a given key object into the "real" key object. This method assumes it is passed Strings created from generateStringKeyFor() on this class

Specified by:
deserializeStringKey in interface SerializationStrategy2<T>
Parameters:
key - key to deserialize
loader - classloader to use
Returns:
the deserialized key object
Throws:
IOException
ClassNotFoundException

deserializeStringKey

public Object deserializeStringKey(String key)
                            throws IOException,
                                   ClassNotFoundException
Description copied from interface: SerializationStrategy2
Deserialize a given key object into the "real" key object. This method assumes it is passed Strings created from generateStringKeyFor() on this class

Specified by:
deserializeStringKey in interface SerializationStrategy2<T>
Parameters:
key - key to deserialize
Returns:
the deserialized key object
Throws:
IOException
ClassNotFoundException

readStringKey

protected Object readStringKey(ObjectInputStream ois)
                        throws IOException,
                               ClassNotFoundException
Throws:
IOException
ClassNotFoundException


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