Class SerializedFlowExecutionSnapshot

java.lang.Object
org.springframework.webflow.execution.repository.snapshot.FlowExecutionSnapshot
org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot
All Implemented Interfaces:
Externalizable, Serializable

public class SerializedFlowExecutionSnapshot extends FlowExecutionSnapshot implements Externalizable
A snapshot implementation that is based on standard Java serialization, created by a SerializedFlowExecutionSnapshotFactory.
Author:
Keith Donald, Erwin Vervaet
See Also:
  • Constructor Details

    • SerializedFlowExecutionSnapshot

      public SerializedFlowExecutionSnapshot()
      Default constructor necessary for Externalizable custom serialization semantics. Should not be called by application code.
    • SerializedFlowExecutionSnapshot

      public SerializedFlowExecutionSnapshot(FlowExecution flowExecution, boolean compress) throws SnapshotCreationException
      Creates a new serialized flow execution snapshot.
      Parameters:
      flowExecution - the flow execution
      compress - whether or not to apply compression during snapshotting
      Throws:
      SnapshotCreationException
  • Method Details

    • isCompressed

      public boolean isCompressed()
      Returns whether or not the flow execution data in this snapshot is compressed.
    • unmarshal

      public FlowExecution unmarshal(ClassLoader classLoader) throws SnapshotUnmarshalException
      Unmarshal the flow execution from this snapshot's data.
      Parameters:
      classLoader - the classloader to use to resolve types during execution deserialization
      Returns:
      the unmarashalled flow execution
      Throws:
      SnapshotUnmarshalException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • getFlowExecutionData

      protected byte[] getFlowExecutionData() throws IOException
      Return the flow execution data in its raw byte[] form. Will decompress if necessary.
      Returns:
      the byte array
      Throws:
      IOException - a problem occured with decompression
    • serialize

      protected byte[] serialize(FlowExecution flowExecution) throws IOException
      Internal helper method to serialize given flow execution. Override if a custom serialization method is used.
      Parameters:
      flowExecution - flow execution to serialize
      Returns:
      serialized flow flow execution data
      Throws:
      IOException - when something goes wrong during during serialization
    • deserialize

      protected FlowExecution deserialize(byte[] data, ClassLoader classLoader) throws IOException, ClassNotFoundException
      Internal helper method to deserialize given flow execution data. Override if a custom serialization method is used.
      Parameters:
      data - serialized flow flow execution data
      classLoader - the class loader to use to resolve classes during deserialization
      Returns:
      deserialized flow execution
      Throws:
      IOException - when something goes wrong during deserialization
      ClassNotFoundException - when required classes cannot be loaded
    • compress

      protected byte[] compress(byte[] dataToCompress) throws IOException
      Internal helper method to compress given flow execution data using GZIP compression. Override if custom compression is desired.
      Throws:
      IOException
    • decompress

      protected byte[] decompress(byte[] dataToDecompress) throws IOException
      Internal helper method to decompress given flow execution data using GZIP decompression. Override if custom decompression is desired.
      Throws:
      IOException