Java Code Examples for org.springframework.beans.factory.config.CustomScopeConfigurer#addScope()

The following examples show how to use org.springframework.beans.factory.config.CustomScopeConfigurer#addScope() . 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: TestConfig.java    From tutorials with MIT License 7 votes vote down vote up
@Bean
public CustomScopeConfigurer customScopeConfigurer() {
    CustomScopeConfigurer configurer = new CustomScopeConfigurer();
    configurer.addScope("session", new SimpleThreadScope());
    return configurer;
}
 
Example 2
Source File: ViewScopeAutoConfiguration.java    From joinfaces with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnProperty(value = "joinfaces.view-scope.enabled", havingValue = "true", matchIfMissing = true)
public static CustomScopeConfigurer viewScopeConfigurer() {
	CustomScopeConfigurer customScopeConfigurer = new CustomScopeConfigurer();
	customScopeConfigurer.addScope(ViewScope.SCOPE_VIEW, new ViewScope());
	return customScopeConfigurer;
}
 
Example 3
Source File: ViewScopeDestructionCallbackIT.java    From joinfaces with Apache License 2.0 5 votes vote down vote up
@Bean
public static CustomScopeConfigurer testScopeConfigurer() {
	CustomScopeConfigurer customScopeConfigurer = new CustomScopeConfigurer();

	customScopeConfigurer.addScope("test", new TestScope());

	return customScopeConfigurer;
}
 
Example 4
Source File: DolphinPlatformSpringTestBootstrap.java    From dolphin-platform with Apache License 2.0 5 votes vote down vote up
@Bean(name = "customScopeConfigurer")
public static CustomScopeConfigurer createClientScope(final ClientSession clientSession) {
    Assert.requireNonNull(clientSession, "clientSession");
    CustomScopeConfigurer configurer = new CustomScopeConfigurer();
    configurer.addScope(ClientScopeImpl.CLIENT_SCOPE, new TestClientScope(clientSession));
    return configurer;
}
 
Example 5
Source File: TenantConfiguration.java    From fiware-cepheus with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Declare the "tenant" scope.
 */
@Bean
public static CustomScopeConfigurer customScopeConfigurer (TenantScope tenantScope) {
    CustomScopeConfigurer configurer = new CustomScopeConfigurer ();
    configurer.addScope("tenant", tenantScope);
    return configurer;
}
 
Example 6
Source File: WebSocketMessageBrokerConfigurationSupport.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Bean
public static CustomScopeConfigurer webSocketScopeConfigurer() {
	CustomScopeConfigurer configurer = new CustomScopeConfigurer();
	configurer.addScope("websocket", new SimpSessionScope());
	return configurer;
}
 
Example 7
Source File: WebSocketMessageBrokerConfigurationSupport.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public static CustomScopeConfigurer webSocketScopeConfigurer() {
	CustomScopeConfigurer configurer = new CustomScopeConfigurer();
	configurer.addScope("websocket", new SimpSessionScope());
	return configurer;
}
 
Example 8
Source File: WebSocketMessageBrokerConfigurationSupport.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public static CustomScopeConfigurer webSocketScopeConfigurer() {
	CustomScopeConfigurer configurer = new CustomScopeConfigurer();
	configurer.addScope("websocket", new SimpSessionScope());
	return configurer;
}
 
Example 9
Source File: SpringBeanFactory.java    From dolphin-platform with Apache License 2.0 4 votes vote down vote up
@Bean(name = "customScopeConfigurer")
public static CustomScopeConfigurer createClientScope() {
    final CustomScopeConfigurer configurer = new CustomScopeConfigurer();
    configurer.addScope(ClientScopeImpl.CLIENT_SCOPE, new ClientScopeImpl());
    return configurer;
}