Package org.apache.wicket.pageStore
Class InSessionPageStore
- java.lang.Object
-
- org.apache.wicket.pageStore.DelegatingPageStore
-
- org.apache.wicket.pageStore.InSessionPageStore
-
- All Implemented Interfaces:
IPageStore
public class InSessionPageStore extends DelegatingPageStore
A store keeping a configurable maximum of pages in the session.This store is used by
DefaultPageManagerProvider
as a cache in front of a persistent store.
-
-
Constructor Summary
Constructors Constructor Description InSessionPageStore(IPageStore delegate, int maxPages)
KeepmaxPages
in each session.InSessionPageStore(IPageStore delegate, int maxPages, ISerializer serializer)
KeepmaxPages
in each session.InSessionPageStore(IPageStore delegate, org.apache.wicket.util.lang.Bytes maxBytes)
Keep page up tomaxBytes
in each session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPage(IPageContext context, IManageablePage page)
Stores the page-IManageablePage
getPage(IPageContext context, int id)
Restores a page from storage.void
removeAllPages(IPageContext context)
All pages should be removed from storage for the given context.void
removePage(IPageContext context, IManageablePage page)
Removes a page from storage.-
Methods inherited from class org.apache.wicket.pageStore.DelegatingPageStore
destroy, detach, getDelegate, supportsVersioning
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.pageStore.IPageStore
canBeAsynchronous
-
-
-
-
Constructor Detail
-
InSessionPageStore
public InSessionPageStore(IPageStore delegate, int maxPages)
KeepmaxPages
in each session.If the container serializes sessions to disk, any non-
SerializedPage
added to this store will be dropped.- Parameters:
delegate
- store to delegate tomaxPages
- maximum pages to keep in session
-
InSessionPageStore
public InSessionPageStore(IPageStore delegate, int maxPages, ISerializer serializer)
KeepmaxPages
in each session.If the container serializes sessions to disk, any non-
SerializedPage
added to this store will be automatically serialized.- Parameters:
delegate
- store to delegate tomaxPages
- maximum pages to keep in sessionserializer
- optional serializer of pages in the session
-
InSessionPageStore
public InSessionPageStore(IPageStore delegate, org.apache.wicket.util.lang.Bytes maxBytes)
Keep page up tomaxBytes
in each session.All pages added to this store must be
SerializedPage
s. You can achieve this by letting aSerializingPageStore
delegate to this store.- Parameters:
delegate
- store to delegate tomaxBytes
- maximum bytes to keep in session
-
-
Method Detail
-
getPage
public IManageablePage getPage(IPageContext context, int id)
Description copied from interface:IPageStore
Restores a page from storage.- Specified by:
getPage
in interfaceIPageStore
- Overrides:
getPage
in classDelegatingPageStore
- Parameters:
context
- the context of the pageid
- the id of the page.- Returns:
- the page
-
addPage
public void addPage(IPageContext context, IManageablePage page)
Description copied from interface:IPageStore
Stores the page-- Specified by:
addPage
in interfaceIPageStore
- Overrides:
addPage
in classDelegatingPageStore
- Parameters:
context
- the context of the page
-
removePage
public void removePage(IPageContext context, IManageablePage page)
Description copied from interface:IPageStore
Removes a page from storage.- Specified by:
removePage
in interfaceIPageStore
- Overrides:
removePage
in classDelegatingPageStore
- Parameters:
context
- the context of the page
-
removeAllPages
public void removeAllPages(IPageContext context)
Description copied from interface:IPageStore
All pages should be removed from storage for the given context.- Specified by:
removeAllPages
in interfaceIPageStore
- Overrides:
removeAllPages
in classDelegatingPageStore
- Parameters:
context
- the context of the pages
-
-