|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.pageStore.DefaultPageStore
public class DefaultPageStore
The 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.
Nested Class Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
DefaultPageStore(ISerializer pageSerializer,
IDataStore dataStore,
int cacheSize)
Construct. |
Method Summary | |
---|---|
IManageablePage |
convertToPage(Object object)
Converts a page representation to an instance of IManageablePage |
protected IManageablePage |
deserializePage(byte[] data)
|
void |
destroy()
Destroy the store. |
IManageablePage |
getPage(String sessionId,
int id)
Restores a page from the persistent layer. |
protected byte[] |
getPageData(String sessionId,
int pageId)
|
Serializable |
prepareForSerialization(String sessionId,
Object object)
Process the page before the it gets serialized. |
void |
removePage(String sessionId,
int id)
Removes a page from the persistent layer. |
protected void |
removePageData(String sessionId)
|
protected void |
removePageData(String sessionId,
int pageId)
|
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 DefaultPageStore.SerializedPage |
serializePage(String sessionId,
IManageablePage page)
|
protected boolean |
storeAfterSessionReplication()
|
void |
storePage(String sessionId,
IManageablePage page)
Stores the page to a persistent layer. |
protected void |
storePageData(String sessionId,
int pageId,
byte[] data)
|
void |
unbind(String sessionId)
The page store should cleanup all the pages for that sessionid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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[])
Method Detail |
---|
public void destroy()
IPageStore
destroy
in interface IPageStore
IPageStore.destroy()
protected byte[] getPageData(String sessionId, int pageId)
sessionId
- pageId
-
IDataStore.getData(String, int)
protected void removePageData(String sessionId, int pageId)
sessionId
- pageId
- IDataStore.removeData(String, int)
protected void removePageData(String sessionId)
sessionId
- IDataStore.removeData(String)
protected void storePageData(String sessionId, int pageId, byte[] data)
sessionId
- pageId
- data
- IDataStore.storeData(String, int, byte[])
public IManageablePage getPage(String sessionId, int id)
IPageStore
getPage
in interface IPageStore
sessionId
- The session of the page that must be removedid
- The id of the page.
public void removePage(String sessionId, int id)
IPageStore
removePage
in interface IPageStore
sessionId
- The session of the page that must be removedid
- The id of the page.public void storePage(String sessionId, IManageablePage page)
IPageStore
storePage
in interface IPageStore
sessionId
- The session of the page that must be removedpage
- The page to storepublic void unbind(String sessionId)
IPageStore
unbind
in interface IPageStore
sessionId
- The session of the page that must be removedpublic IManageablePage convertToPage(Object object)
IPageStore
IManageablePage
convertToPage
in interface IPageStore
object
- some kind of page representation
public Serializable prepareForSerialization(String sessionId, Object object)
IPageStore
IPageStore.restoreAfterSerialization(Serializable)
.
prepareForSerialization
in interface IPageStore
sessionId
- The session of the page that must be removed
protected boolean storeAfterSessionReplication()
public Object restoreAfterSerialization(Serializable serializable)
IPageStore
IPageStore.convertToPage(Object)
.
restoreAfterSerialization
in interface IPageStore
protected DefaultPageStore.SerializedPage serializePage(String sessionId, IManageablePage page)
sessionId
- page
-
protected IManageablePage deserializePage(byte[] data)
data
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |