Package org.springframework.batch.core.repository.dao

# Class DefaultExecutionContextSerializer

java.lang.Object
org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer

All Implemented Interfaces:
  `ExecutionContextSerializer`, `org.springframework.core.serializer.Deserializer<Map<String,Object>>`, `org.springframework.core.serializer.Serializer<Map<String,Object>>`

public class DefaultExecutionContextSerializer extends Object implements ExecutionContextSerializer
An implementation of the `ExecutionContextSerializer` using the default serialization implementations from Spring (`DefaultSerializer` and `DefaultDeserializer`).

Since:
  2.2
Author:
  Michael Minella

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultExecutionContextSerializer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<String,Object>`
  `deserialize(InputStream inputStream)`
  Deserializes an execution context from the provided `InputStream`.
  `void`
  `serialize(Map<String,Object> context, OutputStream out)`
  Serializes an execution context to the provided `OutputStream`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.springframework.core.serializer.Deserializer

  `deserializeFromByteArray`

  ### Methods inherited from interface org.springframework.core.serializer.Serializer

  `serializeToByteArray`

- ## Constructor Details

  - ### DefaultExecutionContextSerializer

    public DefaultExecutionContextSerializer()

- ## Method Details

  - ### serialize

    public void serialize(Map<String,Object> context, OutputStream out) throws IOException
    Serializes an execution context to the provided `OutputStream`. The stream is not closed prior to it's return.
    Specified by:
      `serialize` in interface `org.springframework.core.serializer.Serializer<Map<String,Object>>`
    Parameters:
      `context` - `Map` contents of the `ExecutionContext`.
      `out` - `OutputStream` where the serialized context information will be written.
    Throws:
      `IOException`

  - ### deserialize

    public Map<String,Object> deserialize(InputStream inputStream) throws IOException
    Deserializes an execution context from the provided `InputStream`.
    Specified by:
      `deserialize` in interface `org.springframework.core.serializer.Deserializer<Map<String,Object>>`
    Parameters:
      `inputStream` - `InputStream` containing the information to be deserialized.
    Returns:
      the object serialized in the provided `InputStream`
    Throws:
      `IOException`