org.ehcache.transactions.xa
Class SoftLockSerializer

java.lang.Object
  extended by org.ehcache.transactions.xa.SoftLockSerializer
All Implemented Interfaces:
java.io.Closeable, Serializer<SoftLock>

public class SoftLockSerializer
extends java.lang.Object
implements Serializer<SoftLock>

The stateless Serializer used to serialize SoftLocks.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ehcache.spi.serialization.Serializer
Serializer.Persistent, Serializer.Transient
 
Constructor Summary
SoftLockSerializer(java.lang.ClassLoader classLoader)
           
 
Method Summary
 void close()
           
 boolean equals(SoftLock object, java.nio.ByteBuffer binary)
          Checks if the given instance and serial form are representations of the same instance.
 SoftLock read(java.nio.ByteBuffer entry)
          Reconstructs an instance from the given serial form.
 java.nio.ByteBuffer serialize(SoftLock object)
          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
 

Constructor Detail

SoftLockSerializer

public SoftLockSerializer(java.lang.ClassLoader classLoader)
Method Detail

serialize

public java.nio.ByteBuffer serialize(SoftLock object)
Description copied from interface: Serializer
Transforms the given instance into its serial form.

Specified by:
serialize in interface Serializer<SoftLock>
Parameters:
object - the instance to serialize
Returns:
the binary representation of the serial form

read

public SoftLock read(java.nio.ByteBuffer entry)
              throws SerializerException,
                     java.lang.ClassNotFoundException
Description copied from interface: Serializer
Reconstructs an instance from the given serial form.

Specified by:
read in interface Serializer<SoftLock>
Parameters:
entry - the binary representation of the serial form
Returns:
the de-serialized instance
Throws:
SerializerException - if reading the byte buffer fails
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found

equals

public boolean equals(SoftLock object,
                      java.nio.ByteBuffer binary)
               throws SerializerException,
                      java.lang.ClassNotFoundException
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>
Parameters:
object - the instance to check
binary - the serial form to check
Returns:
true if both parameters represent the same instance, false otherwise
Throws:
SerializerException - if reading the byte buffer fails
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found

close

public void close()
Specified by:
close in interface java.io.Closeable