de.javakaffee.web.msm.serializer.javolution
Class JavolutionTranscoder

java.lang.Object
  extended by de.javakaffee.web.msm.serializer.javolution.JavolutionTranscoder
All Implemented Interfaces:
SessionAttributesTranscoder

public class JavolutionTranscoder
extends Object
implements SessionAttributesTranscoder

A net.spy.memcached.transcoders.Transcoder that serializes catalina StandardSessions using Javolutions xml data binding facilities.

Objects are serialized to/from xml using javolutions built in XMLFormats for standard types, custom/user types are bound using the ReflectionFormat.

Additionally it's worth to note that cyclic dependencies are supported.

Author:
Martin Grotzke

Constructor Summary
JavolutionTranscoder(ClassLoader classLoader, boolean copyCollectionsForSerialization, CustomXMLFormat<?>... customFormats)
          Constructor.
JavolutionTranscoder(org.apache.catalina.Manager manager)
          Constructor.
JavolutionTranscoder(org.apache.catalina.Manager manager, boolean copyCollectionsForSerialization, CustomXMLFormat<?>... customFormats)
          Constructor.
 
Method Summary
 Map<String,Object> deserializeAttributes(byte[] in)
          Get the object represented by the given serialized bytes.
 byte[] serializeAttributes(MemcachedBackupSession session, Map<String,Object> attributes)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavolutionTranscoder

public JavolutionTranscoder(org.apache.catalina.Manager manager)
Constructor.

Parameters:
manager - the manager

JavolutionTranscoder

public JavolutionTranscoder(org.apache.catalina.Manager manager,
                            boolean copyCollectionsForSerialization,
                            CustomXMLFormat<?>... customFormats)
Constructor.

Parameters:
manager - the manager
copyCollectionsForSerialization - specifies, if iterating over collection elements shall be done on a copy of the collection or on the collection itself
customFormats - a list of CustomXMLFormats or null.

JavolutionTranscoder

public JavolutionTranscoder(ClassLoader classLoader,
                            boolean copyCollectionsForSerialization,
                            CustomXMLFormat<?>... customFormats)
Constructor.

Parameters:
classLoader - the classLoader
copyCollectionsForSerialization - specifies, if iterating over collection elements shall be done on a copy of the collection or on the collection itself
customFormats - a list of CustomXMLFormats or null.
Method Detail

serializeAttributes

public byte[] serializeAttributes(MemcachedBackupSession session,
                                  Map<String,Object> attributes)

Specified by:
serializeAttributes in interface SessionAttributesTranscoder

deserializeAttributes

public Map<String,Object> deserializeAttributes(byte[] in)
Get the object represented by the given serialized bytes.

Specified by:
deserializeAttributes in interface SessionAttributesTranscoder
Parameters:
in - the bytes to deserialize
Returns:
the resulting object


Copyright © 2009-2012. All Rights Reserved.