Package org.gatein.pc.portlet.impl.state
Class StateConverterV0
java.lang.Object
org.gatein.pc.portlet.impl.state.StateConverterV0
- All Implemented Interfaces:
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.
- Version:
- $Revision: 1.1 $
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<S extends Serializable>
Smarshall(org.gatein.pc.api.PortletStateType<S> stateType, PortletState state) Marshall the producer state as a byte array.byte[]marshall(PortletState state) unmarshall(byte[] marshalledState) <S extends Serializable>
PortletStateunmarshall(org.gatein.pc.api.PortletStateType<S> stateType, S marshalledState) Unmarshall the producer state from a byte array.
-
Constructor Details
-
StateConverterV0
public StateConverterV0()
-
-
Method Details
-
marshall
public <S extends Serializable> S marshall(org.gatein.pc.api.PortletStateType<S> stateType, PortletState state) throws StateConversionException, IllegalArgumentException Description copied from interface:StateConverterMarshall the producer state as a byte array.- Specified by:
marshallin interfaceStateConverter- Parameters:
stateType- the state typestate- the producer state- Returns:
- the marshalled state
- Throws:
StateConversionException- if marshalling cannot be performedIllegalArgumentException- if the state is null
-
marshall
- Throws:
StateConversionException
-
unmarshall
public <S extends Serializable> PortletState unmarshall(org.gatein.pc.api.PortletStateType<S> stateType, S marshalledState) throws StateConversionException, IllegalArgumentException Description copied from interface:StateConverterUnmarshall the producer state from a byte array.- Specified by:
unmarshallin interfaceStateConverter- Parameters:
stateType- the state typemarshalledState- the marshalled state- Returns:
- the producer state
- Throws:
StateConversionException- if unmarshalling cannot be performedIllegalArgumentException- if the argument is null
-
unmarshall
- Throws:
StateConversionException
-