下面列出了org.springframework.beans.factory.config.CustomScopeConfigurer#addScope ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@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;
}
@Bean
public static CustomScopeConfigurer testScopeConfigurer() {
CustomScopeConfigurer customScopeConfigurer = new CustomScopeConfigurer();
customScopeConfigurer.addScope("test", new TestScope());
return customScopeConfigurer;
}
@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;
}
/**
* Declare the "tenant" scope.
*/
@Bean
public static CustomScopeConfigurer customScopeConfigurer (TenantScope tenantScope) {
CustomScopeConfigurer configurer = new CustomScopeConfigurer ();
configurer.addScope("tenant", tenantScope);
return configurer;
}
@Bean
public static CustomScopeConfigurer webSocketScopeConfigurer() {
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
configurer.addScope("websocket", new SimpSessionScope());
return configurer;
}
@Bean
public static CustomScopeConfigurer webSocketScopeConfigurer() {
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
configurer.addScope("websocket", new SimpSessionScope());
return configurer;
}
@Bean
public static CustomScopeConfigurer webSocketScopeConfigurer() {
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
configurer.addScope("websocket", new SimpSessionScope());
return configurer;
}
@Bean(name = "customScopeConfigurer")
public static CustomScopeConfigurer createClientScope() {
final CustomScopeConfigurer configurer = new CustomScopeConfigurer();
configurer.addScope(ClientScopeImpl.CLIENT_SCOPE, new ClientScopeImpl());
return configurer;
}
@Bean
public CustomScopeConfigurer customScopeConfigurer() {
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
configurer.addScope("session", new SimpleThreadScope());
return configurer;
}