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 Summary
ConstructorDescriptionDefault constructor necessary forExternalizable
custom serialization semantics.SerializedFlowExecutionSnapshot
(FlowExecution flowExecution, boolean compress) Creates a new serialized flow execution snapshot. -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]
compress
(byte[] dataToCompress) Internal helper method to compress given flow execution data using GZIP compression.protected byte[]
decompress
(byte[] dataToDecompress) Internal helper method to decompress given flow execution data using GZIP decompression.protected FlowExecution
deserialize
(byte[] data, ClassLoader classLoader) Internal helper method to deserialize given flow execution data.boolean
protected byte[]
Return the flow execution data in its raw byte[] form.int
hashCode()
boolean
Returns whether or not the flow execution data in this snapshot is compressed.void
protected byte[]
serialize
(FlowExecution flowExecution) Internal helper method to serialize given flow execution.unmarshal
(ClassLoader classLoader) Unmarshal the flow execution from this snapshot's data.void
-
Constructor Details
-
SerializedFlowExecutionSnapshot
public SerializedFlowExecutionSnapshot()Default constructor necessary forExternalizable
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 executioncompress
- 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
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
-
hashCode
public int hashCode() -
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
getFlowExecutionData
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
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 dataclassLoader
- the class loader to use to resolve classes during deserialization- Returns:
- deserialized flow execution
- Throws:
IOException
- when something goes wrong during deserializationClassNotFoundException
- when required classes cannot be loaded
-
compress
Internal helper method to compress given flow execution data using GZIP compression. Override if custom compression is desired.- Throws:
IOException
-
decompress
Internal helper method to decompress given flow execution data using GZIP decompression. Override if custom decompression is desired.- Throws:
IOException
-