List of usage examples for org.springframework.beans.factory.config CustomScopeConfigurer addScope
public void addScope(String scopeName, Scope scope)
From source file:com.orange.cepheus.cep.tenant.TenantConfiguration.java
/** * Declare the "tenant" scope.//w w w .j a v a 2 s.c o m */ @Bean public static CustomScopeConfigurer customScopeConfigurer(TenantScope tenantScope) { CustomScopeConfigurer configurer = new CustomScopeConfigurer(); configurer.addScope("tenant", tenantScope); return configurer; }
From source file:guru.qas.martini.MartiniConfiguration.java
@Bean @Lazy/*from w w w .j a v a 2 s . co m*/ public static CustomScopeConfigurer customScopeConfigurer(ScenarioScope scope) { CustomScopeConfigurer configurer = new CustomScopeConfigurer(); configurer.addScope("scenario", scope); return configurer; }
From source file:ch.rasc.wampspring.config.DefaultWampConfiguration.java
@Bean public static CustomScopeConfigurer webSocketScopeConfigurer(ConfigurableListableBeanFactory beanFactory) { beanFactory.registerResolvableDependency(WebSocketSession.class, new WampSessionScope.WebSocketSessionObjectFactory()); beanFactory.registerResolvableDependency(WampSession.class, new WampSessionScope.WampSessionObjectFactory()); CustomScopeConfigurer configurer = new CustomScopeConfigurer(); configurer.addScope("wampsession", new WampSessionScope()); return configurer; }
From source file:devbury.threadscope.ThreadScopeConfiguration.java
@Bean public CustomScopeConfigurer threadCustomScopeConfigurer(ThreadScopeManager threadScopeManager, ConfigurableEnvironment environment) { CustomScopeConfigurer customScopeConfigurer = new CustomScopeConfigurer(); // ConfigurationProperties not configured yet. Use ConfigurableEnvironment to get properties. String scopeName = environment.getProperty(SCOPE_NAME_PROPERTY, ThreadScopeProperties.DEFAULT_SCOPE_NAME); logger.info("Thread scope name set to {}", scopeName); customScopeConfigurer.addScope(scopeName, threadScopeManager); return customScopeConfigurer; }