java.lang.Object
org.apache.wicket.pageStore.DelegatingPageStore
org.apache.wicket.pageStore.AsynchronousPageStore
- All Implemented Interfaces:
IPageStore
Facade for
IPageStore
moving addPage(IPageContext, IManageablePage)
to a worker thread.
Creates an AsynchronousPageStore.PendingAdd
for addPage(IPageContext, IManageablePage)
and puts ito a queue
.
Later AsynchronousPageStore.PageAddingRunnable
reads in blocking manner from queue
and performs the add.
It starts only one instance of AsynchronousPageStore.PageAddingRunnable
because all we need is to make the page
storing asynchronous. We don't want to write concurrently in the wrapped IPageStore
,
though it may happen in the extreme case when the queue is full. These cases should be avoided.
- Author:
- Matej Knopp, manuelbarzi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPage
(IPageContext context, IManageablePage page) Stores the page-void
destroy()
Destroy the store.getPage
(IPageContext context, int pageId) 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
detach, end, getDelegate, revertPage, 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 Details
-
AsynchronousPageStore
Construct.- Parameters:
delegate
- the wrappedIPageStore
that actually saved the pagecapacity
- the capacity of the queue that delays the saving
-
-
Method Details
-
destroy
Description copied from interface:IPageStore
Destroy the store.- Specified by:
destroy
in interfaceIPageStore
- Overrides:
destroy
in classDelegatingPageStore
-
getPage
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 pagepageId
- the id of the page.- Returns:
- the page
-
removePage
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.
-
addPage
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.
-
removeAllPages
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
-