Package org.apache.wicket.pageStore
Class CachingPageStore
- java.lang.Object
-
- org.apache.wicket.pageStore.DelegatingPageStore
-
- org.apache.wicket.pageStore.CachingPageStore
-
- All Implemented Interfaces:
IPageStore
public class CachingPageStore extends DelegatingPageStore
A store of pages that uses anIPageStore
as a cache in front of another store to delegate to.
-
-
Constructor Summary
Constructors Constructor Description CachingPageStore(IPageStore delegate, IPageStore cache)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPage(IPageContext context, IManageablePage page)
Stores the page-void
destroy()
Destroy the store.void
detach(IPageContext context)
Detach from the current context.IPageStore
getCache()
Get the store used a cache.IManageablePage
getPage(IPageContext context, int id)
Get the page from cache first.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.void
revertPage(IPageContext context, IManageablePage page)
Revert adding a page - optional operation.-
Methods inherited from class org.apache.wicket.pageStore.DelegatingPageStore
end, 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
-
CachingPageStore
public CachingPageStore(IPageStore delegate, IPageStore cache)
Constructor.- Parameters:
delegate
- store to delegate tocache
- store to use as cache
-
-
Method Detail
-
getCache
public IPageStore getCache()
Get the store used a cache.- Returns:
- store
-
getPage
public IManageablePage getPage(IPageContext context, int id)
Get the page from cache first.- 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 pagepage
- 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 pagepage
- 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
-
revertPage
public void revertPage(IPageContext context, IManageablePage page)
Description copied from interface:IPageStore
Revert adding a page - optional operation.- Specified by:
revertPage
in interfaceIPageStore
- Overrides:
revertPage
in classDelegatingPageStore
page
- the page that should be reverted
-
detach
public void detach(IPageContext context)
Description copied from interface:IPageStore
Detach from the current context.- Specified by:
detach
in interfaceIPageStore
- Overrides:
detach
in classDelegatingPageStore
- Parameters:
context
- the context of the pages
-
destroy
public void destroy()
Description copied from interface:IPageStore
Destroy the store.- Specified by:
destroy
in interfaceIPageStore
- Overrides:
destroy
in classDelegatingPageStore
-
-