Package org.apache.wicket.pageStore
Class InMemoryPageStore
- java.lang.Object
-
- org.apache.wicket.pageStore.AbstractPersistentPageStore
-
- org.apache.wicket.pageStore.InMemoryPageStore
-
- All Implemented Interfaces:
IPageStore,IPersistentPageStore
public class InMemoryPageStore extends AbstractPersistentPageStore implements IPersistentPageStore
A storage of pages in memory.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
AbstractPersistentPageStore.PersistedPage
-
-
Constructor Summary
Constructors Constructor Description InMemoryPageStore(java.lang.String applicationName, int maxPages)KeepmaxPagesfor each session.InMemoryPageStore(java.lang.String applicationName, org.apache.wicket.util.lang.Bytes maxBytes)Keep page up tomaxBytesfor each session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddPersistedPage(java.lang.String sessionIdentifier, IManageablePage page)Add a page.protected IManageablePagegetPersistedPage(java.lang.String sessionIdentifier, int id)java.util.List<IPersistedPage>getPersistedPages(java.lang.String sessionIdentifier)Get information about all persisted pages with the given session identifier.java.util.Set<java.lang.String>getSessionIdentifiers()Get the identifiers for all stored sessions.protected longgetSize(IManageablePage page)Get the size of the given page.org.apache.wicket.util.lang.BytesgetTotalSize()Get total size of all pages stored in all contexts.protected voidremoveAllPersistedPages(java.lang.String sessionIdentifier)protected voidremovePersistedPage(java.lang.String sessionIdentifier, IManageablePage page)booleansupportsVersioning()Versioning is not supported.-
Methods inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
addPage, canBeAsynchronous, createSessionIdentifier, destroy, getPage, getSessionIdentifier, removeAllPages, removePage
-
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
addPage, canBeAsynchronous, destroy, detach, getPage, removeAllPages, removePage
-
Methods inherited from interface org.apache.wicket.pageStore.IPersistentPageStore
getSessionIdentifier
-
-
-
-
Constructor Detail
-
InMemoryPageStore
public InMemoryPageStore(java.lang.String applicationName, int maxPages)KeepmaxPagesfor each session.- Parameters:
applicationName-Application.getName()maxPages- max pages per session
-
InMemoryPageStore
public InMemoryPageStore(java.lang.String applicationName, org.apache.wicket.util.lang.Bytes maxBytes)Keep page up tomaxBytesfor each session.All pages added to this store must be
SerializedPages. You can achieve this by letting aSerializingPageStoredelegate to this store.- Parameters:
applicationName-Application.getName()maxBytes- maximum bytes to keep in session
-
-
Method Detail
-
supportsVersioning
public boolean supportsVersioning()
Versioning is not supported.- Specified by:
supportsVersioningin interfaceIPageStore
-
getPersistedPage
protected IManageablePage getPersistedPage(java.lang.String sessionIdentifier, int id)
- Specified by:
getPersistedPagein classAbstractPersistentPageStore
-
removePersistedPage
protected void removePersistedPage(java.lang.String sessionIdentifier, IManageablePage page)- Specified by:
removePersistedPagein classAbstractPersistentPageStore
-
removeAllPersistedPages
protected void removeAllPersistedPages(java.lang.String sessionIdentifier)
- Specified by:
removeAllPersistedPagesin classAbstractPersistentPageStore
-
addPersistedPage
protected void addPersistedPage(java.lang.String sessionIdentifier, IManageablePage page)Description copied from class:AbstractPersistentPageStoreAdd a page.- Specified by:
addPersistedPagein classAbstractPersistentPageStore- Parameters:
sessionIdentifier- identifier of sessionpage- page to add
-
getSessionIdentifiers
public java.util.Set<java.lang.String> getSessionIdentifiers()
Description copied from interface:IPersistentPageStoreGet the identifiers for all stored sessions.- Specified by:
getSessionIdentifiersin interfaceIPersistentPageStore- Returns:
- the identifiers of all session.
-
getPersistedPages
public java.util.List<IPersistedPage> getPersistedPages(java.lang.String sessionIdentifier)
Description copied from interface:IPersistentPageStoreGet information about all persisted pages with the given session identifier.- Specified by:
getPersistedPagesin interfaceIPersistentPageStore- Returns:
- all persisted pages
-
getTotalSize
public org.apache.wicket.util.lang.Bytes getTotalSize()
Description copied from interface:IPersistentPageStoreGet total size of all pages stored in all contexts.Optional operation, may return
null.- Specified by:
getTotalSizein interfaceIPersistentPageStore- Returns:
- total size or
null
-
getSize
protected long getSize(IManageablePage page)
Get the size of the given page.
-
-