use of org.apache.wicket.page.IPageManager 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);
}
});
}
use of org.apache.wicket.page.IPageManager in project wicket by apache.
the class Page method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
final IPageManager pageManager = getSession().getPageManager();
pageManager.touchPage(this);
}
use of org.apache.wicket.page.IPageManager in project wicket by apache.
the class PageIdPoliticTest method setUp.
@Before
public void setUp() throws Exception {
application = new MockApplication();
dataStore = new InMemoryPageStore() {
@Override
public void storeData(String sessionId, int pageId, byte[] pageAsBytes) {
super.storeData(sessionId, pageId, pageAsBytes);
storeCount++;
}
};
tester = new WicketTester(application) {
@Override
protected IPageManagerProvider newTestPageManagerProvider() {
return new IPageManagerProvider() {
@Override
public IPageManager apply(IPageManagerContext pageManagerContext) {
IPageStore pageStore = new DefaultPageStore(new JavaSerializer(application.getApplicationKey()), dataStore, 4);
return new PageStoreManager(application.getName(), pageStore, pageManagerContext);
}
};
}
};
}
Aggregations