Java Code Examples for org.apache.wicket.protocol.http.WebApplication#setPageManagerProvider()

The following examples show how to use org.apache.wicket.protocol.http.WebApplication#setPageManagerProvider() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataStoreRedisConfig.java    From wicket-spring-boot with Apache License 2.0 6 votes vote down vote up
@Override
public void init(WebApplication webApplication) {
	
	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		protected IDataStore newDataStore() {
			IRedisSettings settings = new RedisSettings();
			settings.setHostname(prop.getHostname());
			settings.setPort(prop.getPort());
			settings.setRecordTtl(TypeParser.parse(prop.getRecordTtl(), prop.getRecordTtlUnit()));
			
			RedisDataStore redisDataStore = new RedisDataStore(settings );
			return new SessionQuotaManagingDataStore(redisDataStore, TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
		}
	});

	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", prop)
			.build());
	
}
 
Example 2
Source File: DataStoreHazelcastConfig.java    From wicket-spring-boot with Apache License 2.0 6 votes vote down vote up
@Override
public void init(WebApplication webApplication) {
	
	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		@Override
		protected IDataStore newDataStore() {
			HazelcastDataStore hazelcastDataStore = new HazelcastDataStore(hazelcastInstance);
			return new SessionQuotaManagingDataStore(hazelcastDataStore, TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
		}
	});
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", prop)
			.build());

}
 
Example 3
Source File: DataStoreCassandraConfig.java    From wicket-spring-boot with Apache License 2.0 6 votes vote down vote up
@Override
public void init(WebApplication webApplication) {
	final ICassandraSettings settings = new CassandraSettings();
	settings.getContactPoints().addAll(prop.getContactPoints());
	settings.setTableName(prop.getTableName());
	settings.setKeyspaceName(prop.getKeyspaceName());
	settings.setRecordTtl(TypeParser.parse(prop.getRecordTtl(), prop.getRecordTtlUnit()));

	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		@Override
		protected IDataStore newDataStore() {
			return new SessionQuotaManagingDataStore(new CassandraDataStore(settings),
					TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
		}
	});
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", prop)
			.build());
}
 
Example 4
Source File: DataStoreMemcachedConfig.java    From wicket-spring-boot with Apache License 2.0 5 votes vote down vote up
@Override
public void init(WebApplication webApplication) {
	
	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		protected IDataStore newDataStore() {
			IMemcachedSettings settings = new MemcachedSettings();
			settings.setExpirationTime(prop.getExpirationTime());
			settings.setPort(prop.getPort());
			settings.setServerNames(prop.getServerNames());
			settings.setShutdownTimeout(TypeParser.parse(prop.getShutdownTimeout(), prop.getShutdownTimeoutUnit()));
			MemcachedDataStore memcachedDataStore;
			
			try {
				memcachedDataStore = new MemcachedDataStore(settings);
			} catch (IOException e) {
				throw new WicketSpringBootException(e);
			}
			
			return new SessionQuotaManagingDataStore(memcachedDataStore, TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
		}
	});
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", prop)
			.build());

}
 
Example 5
Source File: DiskStoreBrowserConfig.java    From wicket-spring-boot with Apache License 2.0 5 votes vote down vote up
@Override
public void init(WebApplication webApplication) {
	DebugPageManagerProvider pageManager = new DebugPageManagerProvider(webApplication);
	webApplication.setPageManagerProvider(pageManager);
	webApplication.mountPage(properties.getMountPage(), DiskStoreBrowserPage.class);
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", properties)
			.build());
}
 
Example 6
Source File: DataStoreHttpSessionConfig.java    From wicket-spring-boot with Apache License 2.0 5 votes vote down vote up
@Override
public void init(WebApplication webApplication) {

	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		@Override
		protected IDataStore newDataStore() {
			return new HttpSessionDataStore(new DefaultPageManagerContext(), new PageNumberEvictionStrategy(props.getPagesNumber()));
		}
	});
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", props)
			.build());

}