public class DefaultPageStore extends AbstractCachingPageStore<DefaultPageStore.SerializedPage>
IPageStore that converts IManageablePage instances to DefaultPageStore.SerializedPages
before passing them to the IDataStore to store them and the same in the opposite
direction when loading DefaultPageStore.SerializedPage from the data store.| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultPageStore.SerializedPage
A representation of
IManageablePage that knows additionally the id of the http
session in which this IManageablePage instance is used. |
pagesCachedataStore, pageSerializer| Constructor and Description |
|---|
DefaultPageStore(ISerializer pageSerializer,
IDataStore dataStore,
int cacheSize)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
IManageablePage |
convertToPage(Object object)
Converts a page representation to an instance of
IManageablePage |
protected DefaultPageStore.SerializedPage |
createSerializedPage(String sessionId,
IManageablePage page) |
Serializable |
prepareForSerialization(String sessionId,
Serializable page)
Process the page before the it gets serialized.
|
Object |
restoreAfterSerialization(Serializable serializable)
This method should restore the serialized page to intermediate object that can be converted
to real page instance using
IPageStore.convertToPage(Object). |
protected boolean |
storeAfterSessionReplication() |
void |
storePage(String sessionId,
IManageablePage page)
Stores the page to a persistent layer.
|
destroy, getPage, removePage, unbinddeserializePage, getPageData, removePageData, removePageData, serializePage, storePageDatapublic DefaultPageStore(ISerializer pageSerializer, IDataStore dataStore, int cacheSize)
pageSerializer - the ISerializer that will be used to convert pages from/to byte arraysdataStore - the IDataStore that actually stores the pagescacheSize - the number of pages to cache in memory before passing them to
IDataStore.storeData(String, int, byte[])public void storePage(String sessionId, IManageablePage page)
IPageStorestorePage in interface IPageStorestorePage in class AbstractCachingPageStore<DefaultPageStore.SerializedPage>sessionId - The session of the page that must be removedpage - The page to storepublic IManageablePage convertToPage(Object object)
IPageStoreIManageablePageobject - some kind of page representationpublic Serializable prepareForSerialization(String sessionId, Serializable page)
IPageStoreIPageStore.restoreAfterSerialization(Serializable).prepareForSerialization in interface IPageStoreprepareForSerialization in class AbstractPageStoresessionId - The session of the page that must be removedprotected boolean storeAfterSessionReplication()
public Object restoreAfterSerialization(Serializable serializable)
IPageStoreIPageStore.convertToPage(Object).restoreAfterSerialization in interface IPageStorerestoreAfterSerialization in class AbstractPageStoreprotected DefaultPageStore.SerializedPage createSerializedPage(String sessionId, IManageablePage page)
sessionId - page - Copyright © 2006–2021 Apache Software Foundation. All rights reserved.