Package org.apache.wicket
Class DefaultPageManagerProvider
- java.lang.Object
-
- org.apache.wicket.DefaultPageManagerProvider
-
- All Implemented Interfaces:
java.util.function.Supplier<IPageManager>,IPageManagerProvider
public class DefaultPageManagerProvider extends java.lang.Object implements IPageManagerProvider
A provider of aPageManagermanaging @link IManageablePage}s with a default chain ofIPageStores:RequestPageStorecaching pages until end of the requestInSessionPageStorekeeping the last accessed page in the sessionAsynchronousPageStoremoving storage of pages to an asynchronous worker thread (enabled by default withStoreSettings.isAsynchronous())SerializingPageStoreserializing all pages (so they are available for back-button)CryptingPageStoreencrypting all pages (disabled by default inStoreSettings.isEncrypted())DiskPageStorepersisting all pages, configured according toStoreSettings
RequestPageStorecaching pages until end of the requestInSessionPageStorekeeping the last accessed page in the sessionAsynchronousPageStoremoving storage of pages to a worker threadSerializingPageStoreserializing all pages (so they are available for back-button)InMemoryPageStorekeeping all pages in memory
RequestPageStorecaching pages until end of the requestInSessionPageStorekeeping a limited count of pages in the session, e.g. 10NoopPageStorediscarding all exceeding pages
RequestPageStore, buffering all adding of pages until the end of the request. Several stores acceptSerializedPageonly, these have to be preceded by aSerializingPageStore.For back-button support at least one store in the chain must create copies of stored pages (usually through serialization), otherwise any following request will work on an identical page instance and the previous state of page is no longer accessible.
Other stores be may inserted ad libitum, e.g.
GroupingPageStoregroups pages, e.g. to limit storage size on a per-group basisFilePageStoreas an alternative to the trustedDiskPageStore- other implementations from wicketstuff-datastores
-
-
Field Summary
Fields Modifier and Type Field Description protected Applicationapplication
-
Constructor Summary
Constructors Constructor Description DefaultPageManagerProvider(Application application)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IPageManagerget()protected ISerializergetSerializer()Get theISerializerto use for serializing of pages.protected IPageStorenewAsynchronousStore(IPageStore pageStore)Store pages asynchronously into the persistent store, if enabled inStoreSettings.isAsynchronous().protected IPageStorenewCryptingStore(IPageStore pageStore)Crypt all pages, if enabled inStoreSettings.isEncrypted().protected IPageStorenewPersistentStore()Keep persistent copies of all pages on disk.protected IPageStorenewRequestStore(IPageStore pageStore)Cache pages in the request until it is finished.protected IPageStorenewSerializingStore(IPageStore pageStore)Serialize pages.protected IPageStorenewSessionStore(IPageStore pageStore)Cache last page in the session for fast access.
-
-
-
Field Detail
-
application
protected final Application application
-
-
Constructor Detail
-
DefaultPageManagerProvider
public DefaultPageManagerProvider(Application application)
Constructor.- Parameters:
application- The application instance
-
-
Method Detail
-
get
public IPageManager get()
- Specified by:
getin interfacejava.util.function.Supplier<IPageManager>
-
getSerializer
protected ISerializer getSerializer()
Get theISerializerto use for serializing of pages.By default the serializer of the applications
FrameworkSettings.- Returns:
- how to serialize pages if needed for any
IPageStore - See Also:
FrameworkSettings.getSerializer()
-
newRequestStore
protected IPageStore newRequestStore(IPageStore pageStore)
Cache pages in the request until it is finished.- See Also:
RequestPageStore
-
newSessionStore
protected IPageStore newSessionStore(IPageStore pageStore)
Cache last page in the session for fast access.- See Also:
InSessionPageStore
-
newAsynchronousStore
protected IPageStore newAsynchronousStore(IPageStore pageStore)
Store pages asynchronously into the persistent store, if enabled inStoreSettings.isAsynchronous().- See Also:
AsynchronousPageStore
-
newSerializingStore
protected IPageStore newSerializingStore(IPageStore pageStore)
Serialize pages.- See Also:
SerializingPageStore
-
newCryptingStore
protected IPageStore newCryptingStore(IPageStore pageStore)
Crypt all pages, if enabled inStoreSettings.isEncrypted().- See Also:
CryptingPageStore
-
newPersistentStore
protected IPageStore newPersistentStore()
Keep persistent copies of all pages on disk.
-
-