|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.cache.serialization.DsoSerializationStrategy<T>
T - value typepublic class DsoSerializationStrategy<T>
A clusterable serialization strategy.
| Nested Class Summary | |
|---|---|
protected static class |
DsoSerializationStrategy.OIS
|
protected static class |
DsoSerializationStrategy.OOS
|
| Field Summary | |
|---|---|
protected static byte |
HIGH_BIT
|
protected ObjectStreamClassSerializer |
oscSerializer
|
| Constructor Summary | |
|---|---|
DsoSerializationStrategy()
Construct a fully locking clusterable serialization strategy. |
|
DsoSerializationStrategy(boolean internalLocking)
Constructs an optionally locked clusterable serialization strategy. |
|
| Method Summary | |
|---|---|
protected static int |
decodeInt(InputStream is)
|
T |
deserialize(byte[] data)
Deserialize the serialized value returning a new representation. |
T |
deserialize(byte[] data,
ClassLoader loader)
Deserialize the serialized value using the specified loader, and returning a new representation. |
protected static void |
encodeInt(OutputStream os,
int value)
|
String |
generateStringKeyFor(Object key)
Convert the given key into a portable String form. |
byte[] |
serialize(T value)
Serialize the given value into a detached, portable form. |
T |
unsafelyDeserialize(byte[] data)
|
T |
unsafelyDeserialize(byte[] value,
ClassLoader classLoader)
|
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 |
|---|
protected static final byte HIGH_BIT
protected final ObjectStreamClassSerializer oscSerializer
| Constructor Detail |
|---|
public DsoSerializationStrategy()
public DsoSerializationStrategy(boolean internalLocking)
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.
internalLocking - true if internal locking should be applied| Method Detail |
|---|
public T deserialize(byte[] data)
throws IOException,
ClassNotFoundException
SerializationStrategy
deserialize in interface SerializationStrategy<T>data - serialized form
IOException - if deserialization fails
ClassNotFoundException - if a required class is not found
public T deserialize(byte[] data,
ClassLoader loader)
throws IOException,
ClassNotFoundException
SerializationStrategy
deserialize in interface SerializationStrategy<T>data - serialized formloader - to use during deserialization
IOException - if deserialization fails
ClassNotFoundException - if a required class is not found
public byte[] serialize(T value)
throws IOException
SerializationStrategy
serialize in interface SerializationStrategy<T>value - value to serialize
IOException - if serialization fails
public String generateStringKeyFor(Object key)
throws IOException
SerializationStrategyString form.
generateStringKeyFor in interface SerializationStrategy<T>key - key to serialize
String key
IOException - if serialization fails
protected void writeStringKey(Object key,
ObjectOutputStream oos)
throws IOException
IOException
protected static final int decodeInt(InputStream is)
throws IOException
IOException
protected static final void encodeInt(OutputStream os,
int value)
throws IOException
IOException
public T unsafelyDeserialize(byte[] value,
ClassLoader classLoader)
throws IOException,
ClassNotFoundException
unsafelyDeserialize in interface UnsafeSerializationStrategy<T>IOException
ClassNotFoundException
public T unsafelyDeserialize(byte[] data)
throws IOException,
ClassNotFoundException
unsafelyDeserialize in interface UnsafeSerializationStrategy<T>IOException
ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||