org.springframework.batch.core.repository.dao
Class XStreamExecutionContextStringSerializer

java.lang.Object
  extended by org.springframework.batch.core.repository.dao.XStreamExecutionContextStringSerializer
All Implemented Interfaces:
ExecutionContextSerializer, org.springframework.beans.factory.InitializingBean, org.springframework.core.serializer.Deserializer, org.springframework.core.serializer.Serializer

public class XStreamExecutionContextStringSerializer
extends Object
implements ExecutionContextSerializer, org.springframework.beans.factory.InitializingBean

Implementation that uses XStream and Jettison to provide serialization.

Since:
2.0
Author:
Thomas Risberg, Michael Minella
See Also:
ExecutionContextSerializer

Constructor Summary
XStreamExecutionContextStringSerializer()
           
 
Method Summary
 void afterPropertiesSet()
           
 Object deserialize(InputStream in)
          Deserializes the supplied input stream into a new execution context.
 void init()
           
 void serialize(Object context, OutputStream out)
          Serializes the passed execution context to the supplied OutputStream.
 void setHierarchicalStreamDriver(com.thoughtworks.xstream.io.HierarchicalStreamDriver hierarchicalStreamDriver)
           
 void setReflectionProvider(com.thoughtworks.xstream.converters.reflection.ReflectionProvider reflectionProvider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStreamExecutionContextStringSerializer

public XStreamExecutionContextStringSerializer()
Method Detail

setReflectionProvider

public void setReflectionProvider(com.thoughtworks.xstream.converters.reflection.ReflectionProvider reflectionProvider)

setHierarchicalStreamDriver

public void setHierarchicalStreamDriver(com.thoughtworks.xstream.io.HierarchicalStreamDriver hierarchicalStreamDriver)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

init

public void init()
          throws Exception
Throws:
Exception

serialize

public void serialize(Object context,
                      OutputStream out)
               throws IOException
Serializes the passed execution context to the supplied OutputStream.

Specified by:
serialize in interface org.springframework.core.serializer.Serializer
Parameters:
context -
out -
Throws:
IOException
See Also:
Serializer.serialize(Object, OutputStream)

deserialize

public Object deserialize(InputStream in)
                   throws IOException
Deserializes the supplied input stream into a new execution context.

Specified by:
deserialize in interface org.springframework.core.serializer.Deserializer
Parameters:
in -
Returns:
a reconstructed execution context
Throws:
IOException
See Also:
Deserializer.deserialize(InputStream)


Copyright © 2013 SpringSource. All Rights Reserved.