Search in sources :

Example 1 with DefaultPageStore

use of org.apache.wicket.pageStore.DefaultPageStore in project wicket by apache.

the class TestApp1 method init.

@Override
protected void init() {
    getSharedResources().add("cancelButton", new DefaultButtonImageResource("Cancel"));
    setPageManagerProvider(new DefaultPageManagerProvider(this) {

        @Override
        public IPageManager get(IPageManagerContext pageManagerContext) {
            IDataStore dataStore = new HttpSessionDataStore(pageManagerContext, new PageNumberEvictionStrategy(100));
            IPageStore pageStore = new DefaultPageStore(new JavaSerializer(getApplicationKey()), dataStore, getStoreSettings().getInmemoryCacheSize());
            return new PageStoreManager(getName(), pageStore, pageManagerContext);
        }
    });
}
Also used : IPageStore(org.apache.wicket.pageStore.IPageStore) IPageManager(org.apache.wicket.page.IPageManager) PageStoreManager(org.apache.wicket.page.PageStoreManager) DefaultButtonImageResource(org.apache.wicket.markup.html.image.resource.DefaultButtonImageResource) HttpSessionDataStore(org.apache.wicket.pageStore.memory.HttpSessionDataStore) PageNumberEvictionStrategy(org.apache.wicket.pageStore.memory.PageNumberEvictionStrategy) JavaSerializer(org.apache.wicket.serialize.java.JavaSerializer) IPageManagerContext(org.apache.wicket.page.IPageManagerContext) DefaultPageManagerProvider(org.apache.wicket.DefaultPageManagerProvider) IDataStore(org.apache.wicket.pageStore.IDataStore) DefaultPageStore(org.apache.wicket.pageStore.DefaultPageStore)

Example 2 with DefaultPageStore

use of org.apache.wicket.pageStore.DefaultPageStore in project wicket by apache.

the class DefaultPageManagerProvider method newPageStore.

protected IPageStore newPageStore(IDataStore dataStore) {
    int inmemoryCacheSize = getStoreSettings().getInmemoryCacheSize();
    ISerializer pageSerializer = application.getFrameworkSettings().getSerializer();
    return new DefaultPageStore(pageSerializer, dataStore, inmemoryCacheSize);
}
Also used : ISerializer(org.apache.wicket.serialize.ISerializer) DefaultPageStore(org.apache.wicket.pageStore.DefaultPageStore)

Example 3 with DefaultPageStore

use of org.apache.wicket.pageStore.DefaultPageStore in project wicket by apache.

the class PersistentPageManagerTest method newPersistentPageManager.

private PageStoreManager newPersistentPageManager(String appName) {
    IDataStore dataStore = new InMemoryPageStore();
    IPageStore pageStore = new DefaultPageStore(new JavaSerializer(appName), dataStore, 4);
    IPageManagerContext pageManagerContext = new DummyPageManagerContext();
    return new PageStoreManager(appName, pageStore, pageManagerContext);
}
Also used : IPageStore(org.apache.wicket.pageStore.IPageStore) DummyPageManagerContext(org.apache.wicket.pageStore.memory.DummyPageManagerContext) JavaSerializer(org.apache.wicket.serialize.java.JavaSerializer) IDataStore(org.apache.wicket.pageStore.IDataStore) InMemoryPageStore(org.apache.wicket.versioning.InMemoryPageStore) DefaultPageStore(org.apache.wicket.pageStore.DefaultPageStore)

Example 4 with DefaultPageStore

use of org.apache.wicket.pageStore.DefaultPageStore in project wicket by apache.

the class PageVersioningTest method setup.

/**
 * setup()
 */
@Before
public void setup() {
    final PageVersioningApplication application = new PageVersioningApplication();
    wicketTester = new WicketTester(application) {

        /**
         * @see org.apache.wicket.util.tester.BaseWicketTester#newTestPageManagerProvider()
         */
        @Override
        protected IPageManagerProvider newTestPageManagerProvider() {
            return new IPageManagerProvider() {

                @Override
                public IPageManager apply(IPageManagerContext pageManagerContext) {
                    final IDataStore dataStore = new InMemoryPageStore();
                    final AsynchronousDataStore asyncDS = new AsynchronousDataStore(dataStore, 100);
                    final DefaultPageStore pageStore = new DefaultPageStore(new JavaSerializer(application.getApplicationKey()), asyncDS, 40);
                    return new PageStoreManager(application.getName(), pageStore, pageManagerContext);
                }
            };
        }
    };
}
Also used : IPageManager(org.apache.wicket.page.IPageManager) PageStoreManager(org.apache.wicket.page.PageStoreManager) AsynchronousDataStore(org.apache.wicket.pageStore.AsynchronousDataStore) WicketTester(org.apache.wicket.util.tester.WicketTester) IPageManagerProvider(org.apache.wicket.IPageManagerProvider) JavaSerializer(org.apache.wicket.serialize.java.JavaSerializer) IPageManagerContext(org.apache.wicket.page.IPageManagerContext) IDataStore(org.apache.wicket.pageStore.IDataStore) DefaultPageStore(org.apache.wicket.pageStore.DefaultPageStore) Before(org.junit.Before)

Example 5 with DefaultPageStore

use of org.apache.wicket.pageStore.DefaultPageStore in project wicket by apache.

the class TestApp2 method init.

@Override
protected void init() {
    getSharedResources().add("cancelButton", new DefaultButtonImageResource("Cancel"));
    setPageManagerProvider(new DefaultPageManagerProvider(this) {

        @Override
        public IPageManager get(IPageManagerContext pageManagerContext) {
            IDataStore dataStore = new HttpSessionDataStore(pageManagerContext, new PageNumberEvictionStrategy(100));
            IPageStore pageStore = new DefaultPageStore(new JavaSerializer(getApplicationKey()), dataStore, getStoreSettings().getInmemoryCacheSize());
            return new PageStoreManager(getName(), pageStore, pageManagerContext);
        }
    });
}
Also used : IPageStore(org.apache.wicket.pageStore.IPageStore) IPageManager(org.apache.wicket.page.IPageManager) PageStoreManager(org.apache.wicket.page.PageStoreManager) DefaultButtonImageResource(org.apache.wicket.markup.html.image.resource.DefaultButtonImageResource) HttpSessionDataStore(org.apache.wicket.pageStore.memory.HttpSessionDataStore) PageNumberEvictionStrategy(org.apache.wicket.pageStore.memory.PageNumberEvictionStrategy) JavaSerializer(org.apache.wicket.serialize.java.JavaSerializer) IPageManagerContext(org.apache.wicket.page.IPageManagerContext) DefaultPageManagerProvider(org.apache.wicket.DefaultPageManagerProvider) IDataStore(org.apache.wicket.pageStore.IDataStore) DefaultPageStore(org.apache.wicket.pageStore.DefaultPageStore)

Aggregations

DefaultPageStore (org.apache.wicket.pageStore.DefaultPageStore)6 JavaSerializer (org.apache.wicket.serialize.java.JavaSerializer)5 IPageManager (org.apache.wicket.page.IPageManager)4 IPageManagerContext (org.apache.wicket.page.IPageManagerContext)4 PageStoreManager (org.apache.wicket.page.PageStoreManager)4 IDataStore (org.apache.wicket.pageStore.IDataStore)4 IPageStore (org.apache.wicket.pageStore.IPageStore)4 DefaultPageManagerProvider (org.apache.wicket.DefaultPageManagerProvider)2 IPageManagerProvider (org.apache.wicket.IPageManagerProvider)2 DefaultButtonImageResource (org.apache.wicket.markup.html.image.resource.DefaultButtonImageResource)2 HttpSessionDataStore (org.apache.wicket.pageStore.memory.HttpSessionDataStore)2 PageNumberEvictionStrategy (org.apache.wicket.pageStore.memory.PageNumberEvictionStrategy)2 WicketTester (org.apache.wicket.util.tester.WicketTester)2 InMemoryPageStore (org.apache.wicket.versioning.InMemoryPageStore)2 Before (org.junit.Before)2 MockApplication (org.apache.wicket.mock.MockApplication)1 AsynchronousDataStore (org.apache.wicket.pageStore.AsynchronousDataStore)1 DummyPageManagerContext (org.apache.wicket.pageStore.memory.DummyPageManagerContext)1 ISerializer (org.apache.wicket.serialize.ISerializer)1