Example usage for org.apache.wicket.pageStore DiskDataStore DiskDataStore

List of usage examples for org.apache.wicket.pageStore DiskDataStore DiskDataStore

Introduction

In this page you can find the example usage for org.apache.wicket.pageStore DiskDataStore DiskDataStore.

Prototype

public DiskDataStore(final String applicationName, final File fileStoreFolder, final Bytes maxSizePerSession) 

Source Link

Document

Construct.

Usage

From source file:de.alpharogroup.wicket.base.application.BaseWebApplication.java

License:Apache License

/**
 * Factory method that can be overwritten to provide an application data store. Here the default
 * will be returned.//  www .j av  a  2 s.co  m
 *
 * For instance:
 *
 * <pre>
 * public void init() {
 * ...
 * getStoreSettings().setInmemoryCacheSize(30);
 *
 * setPageManagerProvider(new DefaultPageManagerProvider(this)
 * {
 *    &#064;Override
 *    protected IDataStore newDataStore()
 *    {
 *       return newApplicationDataStore();
 *    }
 * });
 * ...
 * }
 * </pre>
 *
 * @return the IDataStore.
 */
protected IDataStore newApplicationDataStore() {
    final StoreSettings storeSettings = getStoreSettings();
    final Bytes maxSizePerSession = storeSettings.getMaxSizePerSession();
    final File fileStoreFolder = storeSettings.getFileStoreFolder();
    return new DiskDataStore(this.getName(), fileStoreFolder, maxSizePerSession);
}