Interface PortletSerializable
-
public interface PortletSerializableThis interface must be implemented byRenderStateScopedbeans in order to allow the bean portlet container to intialize the bean at the beginning of a request and passivate the bean at the end of the request.These methods are not intended to be called by application code.
A
@RenderStateScopedbean must be a valid bean; in particular, it must provide a default constructor or be constructable through an@Producesmethod or field.Note that only changes made to the bean state during
ActionMethodorEventMethodexecution are stored in the render state. Changes made duringRenderMethod,ServeResourceMethod, orHeaderMethodexecution will not be available during subsequent requests.- Since:
- 3.0
- See Also:
RenderStateScoped
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeserialize(String[] state)The bean portlet container calls this method at the beginning of every portlet request method that uses the bean.String[]serialize()The portlet bean container calls this method afterActionMethodorEventMethodexecution to obtain the bean state.
-
-
-
Method Detail
-
serialize
String[] serialize()
The portlet bean container calls this method afterActionMethodorEventMethodexecution to obtain the bean state.The bean developer should take care to include all internal bean data in the returned state that is necessary for properly initializing the bean when the portlet bean container calls the
deserializemethod.If no bean data has been set, this method should return an empty array or
nullin order to avoid setting extraneous parameters.- Returns:
- The bean state as a string array.
-
deserialize
void deserialize(String[] state)
The bean portlet container calls this method at the beginning of every portlet request method that uses the bean.The string array render state data is the same array provided to the container by the
serializemethod. The bean should reconstruct its internal state during execution of this method.If no data is available for the portlet, for example because because no
ActionMethodorEventMethodhas been executed for the portlet, the state parameter will be an empty array.If the state array is empty, the bean implementation should provide approriate default values for its internal variables.
- Parameters:
state- The bean state as string array. The array will be empty if bean data has not yet been set.
-
-