org.ehcache.transactions.xa
Class SoftLockValueCombinedSerializer<T>
java.lang.Object
org.ehcache.transactions.xa.SoftLockValueCombinedSerializer<T>
- All Implemented Interfaces:
- java.io.Closeable, Serializer<SoftLock<T>>
public class SoftLockValueCombinedSerializer<T>
- extends java.lang.Object
- implements Serializer<SoftLock<T>>
The Serializer
that is responsible for serializing a SoftLock
containing a value.
Method Summary |
void |
close()
|
boolean |
equals(SoftLock<T> object,
java.nio.ByteBuffer binary)
Checks if the given instance and serial form are representations of the same instance. |
SoftLock<T> |
read(java.nio.ByteBuffer binary)
Reconstructs an instance from the given serial form. |
java.nio.ByteBuffer |
serialize(SoftLock<T> softLock)
Transforms the given instance into its serial form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SoftLockValueCombinedSerializer
public SoftLockValueCombinedSerializer(java.util.concurrent.atomic.AtomicReference<Serializer<SoftLock<T>>> softLockSerializerRef,
Serializer<T> valueSerializer)
serialize
public java.nio.ByteBuffer serialize(SoftLock<T> softLock)
throws SerializerException
- Description copied from interface:
Serializer
- Transforms the given instance into its serial form.
- Specified by:
serialize
in interface Serializer<SoftLock<T>>
- Parameters:
softLock
- the instance to serialize
- Returns:
- the binary representation of the serial form
- Throws:
SerializerException
- if serialization fails
read
public SoftLock<T> read(java.nio.ByteBuffer binary)
throws java.lang.ClassNotFoundException,
SerializerException
- Description copied from interface:
Serializer
- Reconstructs an instance from the given serial form.
- Specified by:
read
in interface Serializer<SoftLock<T>>
- Parameters:
binary
- the binary representation of the serial form
- Returns:
- the de-serialized instance
- Throws:
java.lang.ClassNotFoundException
- if the type to de-serialize to cannot be found
SerializerException
- if reading the byte buffer fails
equals
public boolean equals(SoftLock<T> object,
java.nio.ByteBuffer binary)
throws java.lang.ClassNotFoundException,
SerializerException
- Description copied from interface:
Serializer
- Checks if the given instance and serial form are representations of the same instance.
- Specified by:
equals
in interface Serializer<SoftLock<T>>
- Parameters:
object
- the instance to checkbinary
- the serial form to check
- Returns:
true
if both parameters represent the same instance, false
otherwise
- Throws:
java.lang.ClassNotFoundException
- if the type to de-serialize to cannot be found
SerializerException
- if reading the byte buffer fails
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Throws:
java.io.IOException