Class DiskPageStore

  • All Implemented Interfaces:
    IPageStore, IPersistentPageStore

    public class DiskPageStore
    extends AbstractPersistentPageStore
    implements IPersistentPageStore
    A storage of pages on disk.

    All pages passed into this store are restricted to be SerializedPages.

    Implementation note: DiskPageStore writes pages into a single file, appending new pages while overwriting the oldest pages. Since Ajax requests do not change the id of a page, DiskPageStore offers an optimization to overwrite the most recently written page, if it has the same id as a new page to write.

    However this does not help in case of alternating requests between multiple browser windows: In this case requests are processed for different page ids and the oldests pages are constantly overwritten (this can easily happen with Ajax timers on one or more pages). This leads to pages with identical id superfluously kept in the file, while older pages are prematurely expelled. Any following request to these older pages will then fail with PageExpiredException.

    • Constructor Detail

      • DiskPageStore

        public DiskPageStore​(java.lang.String applicationName,
                             java.io.File fileStoreFolder,
                             org.apache.wicket.util.lang.Bytes maxSizePerSession)
        Create a store that supports SerializedPages only.
        Parameters:
        applicationName - name of application
        fileStoreFolder - folder to store to
        maxSizePerSession - maximum size per session
        See Also:
        SerializingPageStore
      • DiskPageStore

        public DiskPageStore​(java.lang.String applicationName,
                             java.io.File fileStoreFolder,
                             org.apache.wicket.util.lang.Bytes maxSizePerSession,
                             ISerializer serializer)
        Create a store to disk.
        Parameters:
        applicationName - name of application
        fileStoreFolder - folder to store to
        maxSizePerSession - maximum size per session
        serializer - for serialization of pages