public class DefaultPageStore extends AbstractCachingPageStore<DefaultPageStore.SerializedPage>
IPageStore
that converts IManageablePage
instances to DefaultPageStore.SerializedPage
s
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. |
pagesCache
dataStore, pageSerializer
Constructor and Description |
---|
DefaultPageStore(ISerializer pageSerializer,
IDataStore dataStore,
int cacheSize)
Construct.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBeAsynchronous() |
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, unbind
deserializePage, getPageData, removePageData, removePageData, serializePage, storePageData
public 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)
IPageStore
storePage
in interface IPageStore
storePage
in class AbstractCachingPageStore<DefaultPageStore.SerializedPage>
sessionId
- The session of the page that must be removedpage
- The page to storepublic IManageablePage convertToPage(Object object)
IPageStore
IManageablePage
object
- some kind of page representationpublic Serializable prepareForSerialization(String sessionId, Serializable page)
IPageStore
IPageStore.restoreAfterSerialization(Serializable)
.prepareForSerialization
in interface IPageStore
prepareForSerialization
in class AbstractPageStore
sessionId
- The session of the page that must be removedprotected boolean storeAfterSessionReplication()
public Object restoreAfterSerialization(Serializable serializable)
IPageStore
IPageStore.convertToPage(Object)
.restoreAfterSerialization
in interface IPageStore
restoreAfterSerialization
in class AbstractPageStore
protected DefaultPageStore.SerializedPage createSerializedPage(String sessionId, IManageablePage page)
sessionId
- page
- public boolean canBeAsynchronous()
AsynchronousPageStore
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.