public class StateConverterV0 extends Object implements StateConverter
An implementation that relies on the DataInputStream and DataOutputStream to marshall
and unmarshall the producer state. The marshalled value starts with a magic value and a version id to ensure future
backward compatibility.
It is an important matter because a migrated producer will probably have to take care of consumers that hold a previous version of the producer state.
| Constructor and Description |
|---|
StateConverterV0() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
marshall(PortletState state) |
<S extends Serializable> |
marshall(PortletStateType<S> stateType,
PortletState state)
Marshall the producer state as a byte array.
|
PortletState |
unmarshall(byte[] marshalledState) |
<S extends Serializable> |
unmarshall(PortletStateType<S> stateType,
S marshalledState)
Unmarshall the producer state from a byte array.
|
public <S extends Serializable> S marshall(PortletStateType<S> stateType, PortletState state) throws StateConversionException, IllegalArgumentException
StateConvertermarshall in interface StateConverterstateType - the state typestate - the producer stateStateConversionException - if marshalling cannot be performedIllegalArgumentException - if the state is nullpublic byte[] marshall(PortletState state) throws StateConversionException
StateConversionExceptionpublic <S extends Serializable> PortletState unmarshall(PortletStateType<S> stateType, S marshalledState) throws StateConversionException, IllegalArgumentException
StateConverterunmarshall in interface StateConverterstateType - the state typemarshalledState - the marshalled stateStateConversionException - if unmarshalling cannot be performedIllegalArgumentException - if the argument is nullpublic PortletState unmarshall(byte[] marshalledState) throws StateConversionException
StateConversionExceptionCopyright © 2003-2017 GateIn. All Rights Reserved.