|
||||||||||
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(java.lang.Object object)
Converts a page representation to an instance of IManageablePage |
protected IManageablePage |
deserializePage(byte[] data)
|
void |
destroy()
Destroy the store. |
IManageablePage |
getPage(java.lang.String sessionId,
int id)
Restores a page from the persistent layer. |
protected byte[] |
getPageData(java.lang.String sessionId,
int pageId)
|
java.io.Serializable |
prepareForSerialization(java.lang.String sessionId,
java.lang.Object object)
Process the page before the it gets serialized. |
void |
removePage(java.lang.String sessionId,
int id)
Removes a page from the persistent layer. |
protected void |
removePageData(java.lang.String sessionId)
|
protected void |
removePageData(java.lang.String sessionId,
int pageId)
|
java.lang.Object |
restoreAfterSerialization(java.io.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(java.lang.String sessionId,
IManageablePage page)
|
protected boolean |
storeAfterSessionReplication()
|
void |
storePage(java.lang.String sessionId,
IManageablePage page)
Stores the page to a persistent layer. |
protected void |
storePageData(java.lang.String sessionId,
int pageId,
byte[] data)
|
void |
unbind(java.lang.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(java.lang.String sessionId, int pageId)
sessionId
- pageId
-
IDataStore.getData(String, int)
protected void removePageData(java.lang.String sessionId, int pageId)
sessionId
- pageId
- IDataStore.removeData(String, int)
protected void removePageData(java.lang.String sessionId)
sessionId
- IDataStore.removeData(String)
protected void storePageData(java.lang.String sessionId, int pageId, byte[] data)
sessionId
- pageId
- data
- IDataStore.storeData(String, int, byte[])
public IManageablePage getPage(java.lang.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(java.lang.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(java.lang.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(java.lang.String sessionId)
IPageStore
unbind
in interface IPageStore
sessionId
- The session of the page that must be removedpublic IManageablePage convertToPage(java.lang.Object object)
IPageStore
IManageablePage
convertToPage
in interface IPageStore
object
- some kind of page representation
public java.io.Serializable prepareForSerialization(java.lang.String sessionId, java.lang.Object object)
IPageStore
IPageStore.restoreAfterSerialization(Serializable)
.
prepareForSerialization
in interface IPageStore
sessionId
- The session of the page that must be removed
protected boolean storeAfterSessionReplication()
public java.lang.Object restoreAfterSerialization(java.io.Serializable serializable)
IPageStore
IPageStore.convertToPage(Object)
.
restoreAfterSerialization
in interface IPageStore
protected DefaultPageStore.SerializedPage serializePage(java.lang.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 |