use of org.apache.wicket.pageStore.AsynchronousDataStore in project wicket by apache.
the class DefaultPageManagerProvider method apply.
@Override
public IPageManager apply(IPageManagerContext pageManagerContext) {
IDataStore dataStore = newDataStore();
StoreSettings storeSettings = getStoreSettings();
IPageStore pageStore;
if (dataStore.canBeAsynchronous() && storeSettings.isAsynchronous()) {
int capacity = storeSettings.getAsynchronousQueueCapacity();
dataStore = new AsynchronousDataStore(dataStore, capacity);
pageStore = newPageStore(dataStore);
if (pageStore.canBeAsynchronous()) {
pageStore = new AsynchronousPageStore(pageStore, capacity);
}
} else {
pageStore = newPageStore(dataStore);
}
return new PageStoreManager(application.getName(), pageStore, pageManagerContext);
}
use of org.apache.wicket.pageStore.AsynchronousDataStore 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);
}
};
}
};
}
Aggregations