本文整理汇总了Java中org.springframework.beans.factory.annotation.Qualifier类的典型用法代码示例。如果您正苦于以下问题:Java Qualifier类的具体用法?Java Qualifier怎么用?Java Qualifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Qualifier类属于org.springframework.beans.factory.annotation包,在下文中一共展示了Qualifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: businessSqlSessionFactory
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean
@Primary
public SqlSessionFactory businessSqlSessionFactory(@Qualifier("businessDataSource") DruidDataSource businessDataSource) throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(businessDataSource);
//mybatis分页
PageHelper pageHelper = new PageHelper();
Properties props = new Properties();
props.setProperty("dialect", "mysql");
props.setProperty("reasonable", "true");
props.setProperty("supportMethodsArguments", "true");
props.setProperty("returnPageInfo", "check");
props.setProperty("params", "count=countSql");
pageHelper.setProperties(props);
//添加插件
sqlSessionFactoryBean.setPlugins(new Interceptor[]{pageHelper});
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
sqlSessionFactoryBean.setMapperLocations(resolver.getResources(MAPPERXML_LOCATION));
return sqlSessionFactoryBean.getObject();
}
示例2: entityManagerFactory
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean(EntityManagerFactoryBeanName)
@Primary
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
@Qualifier(DataSourceBeanName) DataSource dataSource,
@Qualifier(JpaVendorAdapterBeanName) JpaVendorAdapter vendorAdapter) {
LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setDataSource(dataSource);
entityManagerFactoryBean.setJpaVendorAdapter(vendorAdapter);
entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
entityManagerFactoryBean.setPersistenceUnitName("mysqlsource1");
entityManagerFactoryBean.afterPropertiesSet();
return entityManagerFactoryBean;
}
示例3: shiroFilter
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean(name="shiroFilter")
public ShiroFilterFactoryBean shiroFilter(@Qualifier("securityManager")SecurityManager manager) {
ShiroFilterFactoryBean bean=new ShiroFilterFactoryBean();
bean.setSecurityManager(manager);
//配置登录的url和登录成功的url
bean.setLoginUrl("/login");
bean.setSuccessUrl("/home");
//配置访问权限
LinkedHashMap<String, String> filterChainDefinitionMap=new LinkedHashMap<>();
filterChainDefinitionMap.put("/login", "anon"); //表示可以匿名访问
filterChainDefinitionMap.put("/common/**", "anon");
filterChainDefinitionMap.put("/js/**","anon");
filterChainDefinitionMap.put("/druid/**","anon");
filterChainDefinitionMap.put("/captcha","anon");
filterChainDefinitionMap.put("/**", "authc");//表示需要认证才可以访问
bean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return bean;
}
示例4: businessSqlSessionFactory
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean
@Primary
public SqlSessionFactory businessSqlSessionFactory(@Qualifier("businessDataSource") DruidDataSource businessDataSource) throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(businessDataSource);
//mybatis分页
Properties props = new Properties();
props.setProperty("dialect", "mysql");
props.setProperty("reasonable", "true");
props.setProperty("supportMethodsArguments", "true");
props.setProperty("returnPageInfo", "check");
props.setProperty("params", "count=countSql");
PageHelper pageHelper = new PageHelper();
pageHelper.setProperties(props);
//添加插件
sqlSessionFactoryBean.setPlugins(new Interceptor[]{pageHelper});
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
sqlSessionFactoryBean.setMapperLocations(resolver.getResources(MAPPERXML_LOCATION));
return sqlSessionFactoryBean.getObject();
}
示例5: MovieContributionPersistenceServiceImpl
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
/**
* Constructor.
*
* @param movieRepository The movie repository to use
* @param movieInfoRepository The movie info repository to use
* @param contributionRepository The contribution repository to use
* @param userRepository The user repository to use
* @param moviePersistenceService The movie persistence service to use
* @param storageService The storage service to use
*/
@Autowired
public MovieContributionPersistenceServiceImpl(
@NotNull final MovieRepository movieRepository,
@NotNull final MovieInfoRepository movieInfoRepository,
@NotNull final ContributionRepository contributionRepository,
@NotNull final UserRepository userRepository,
@NotNull final MoviePersistenceService moviePersistenceService,
@Qualifier("googleStorageService") @NotNull final StorageService storageService
) {
this.movieRepository = movieRepository;
this.movieInfoRepository = movieInfoRepository;
this.contributionRepository = contributionRepository;
this.userRepository = userRepository;
this.moviePersistenceService = moviePersistenceService;
this.storageService = storageService;
}
示例6: v3ProxyValidateController
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Autowired
@Bean
@ConditionalOnMissingBean(name = "v3ProxyValidateController")
public V3ProxyValidateController v3ProxyValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor,
@Qualifier("defaultAuthenticationSystemSupport")
final AuthenticationSystemSupport authenticationSystemSupport) {
final V3ProxyValidateController c = new V3ProxyValidateController();
c.setValidationSpecification(cas20ProtocolValidationSpecification);
c.setSuccessView(cas3ServiceSuccessView());
c.setFailureView(cas3ServiceFailureView);
c.setProxyHandler(proxy20Handler);
c.setAuthenticationSystemSupport(authenticationSystemSupport);
c.setServicesManager(servicesManager);
c.setCentralAuthenticationService(centralAuthenticationService);
c.setArgumentExtractor(argumentExtractor);
c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
c.setAuthenticationContextValidator(authenticationContextValidator);
c.setJsonView(cas3ServiceJsonView());
c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
return c;
}
示例7: NoiseMap
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Inject
public NoiseMap(@Qualifier("worldSeedElevation") long seedElevation,
@Qualifier("worldSeedMoisture") long seedMoisture,
@Qualifier("worldExtent") int worldExtent,
@Qualifier("worldScale") double worldScale,
@Qualifier("worldOctaves") int worldOctaves) {
WORLD_EXTENT = worldExtent;
HYPOTENUSE = Math.sqrt(Math.pow(WORLD_EXTENT / 2, 2) + Math.pow(WORLD_EXTENT / 2, 2));
Noise2D noiseElevation = new SimplexNoise();
Noise2D noiseMoisture = new SimplexNoise();
((SimplexNoise)noiseElevation).setSeed(seedElevation);
((SimplexNoise)noiseMoisture).setSeed(seedMoisture);
elevation = new Fbm2D(noiseElevation);
elevation.setFrequency(worldScale);
elevation.setOctaves(worldOctaves);
moisture = new Fbm2D(noiseMoisture);
moisture.setFrequency(worldScale);
moisture.setOctaves(worldOctaves);
}
示例8: read1SqlSessionFactory
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
/**
* SqlSessionFactory配置
*
* @return
* @throws Exception
*/
@Bean(name = "read1SqlSessionFactory")
public SqlSessionFactory read1SqlSessionFactory(
@Qualifier("read1DataSource") DataSource dataSource
) throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSource);
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
// 配置mapper文件位置
sqlSessionFactoryBean.setMapperLocations(resolver.getResources(read1MapperLocations));
//配置分页插件
PageHelper pageHelper = new PageHelper();
Properties properties = new Properties();
properties.setProperty("reasonable", "true");
properties.setProperty("supportMethodsArguments", "true");
properties.setProperty("returnPageInfo", "check");
properties.setProperty("params", "count=countSql");
pageHelper.setProperties(properties);
//设置插件
sqlSessionFactoryBean.setPlugins(new Interceptor[]{pageHelper});
return sqlSessionFactoryBean.getObject();
}
示例9: getOrderItemType
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean
@Qualifier("OrderItemType")
public GraphQLObjectType getOrderItemType() {
return newObject()
.name("OrderItemDto")
.field(newFieldDefinition()
.name("productId")
.type(GraphQLString))
.field(newFieldDefinition()
.name("quantity")
.type(GraphQLInt))
.field(newFieldDefinition()
.name("product")
.type(getProductType())
.dataFetcher(new OrderItemProductFetcher(productAdaptor)))
.build();
}
示例10: sqlSessionFactory
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean
public SqlSessionFactory sqlSessionFactory(@Qualifier("dataSource") DataSource dataSource) throws Exception{
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSource);
//bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/mapper/test1/*.xml"));
return sqlSessionFactoryBean.getObject();
}
示例11: masterSqlSessionFactory
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean(name = "masterSqlSessionFactory")
@Primary
public SqlSessionFactory masterSqlSessionFactory(@Qualifier("masterDataSource") DataSource masterDataSource) throws Exception{
final SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(masterDataSource);
sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(MasterDataSourceConfig.MAPPER_LOCATION));
return sqlSessionFactoryBean.getObject();
}
示例12: traceServiceClient
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public TraceServiceClient traceServiceClient(
@Qualifier("traceExecutorProvider") ExecutorProvider executorProvider)
throws IOException {
return TraceServiceClient.create(
TraceServiceSettings.newBuilder()
.setCredentialsProvider(
StackdriverTraceAutoConfiguration.this.finalCredentialsProvider)
.setExecutorProvider(executorProvider)
.build());
}
示例13: surrogateWebflowEventResolver
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean
public CasWebflowEventResolver surrogateWebflowEventResolver(@Qualifier("defaultAuthenticationSystemSupport")
final AuthenticationSystemSupport authenticationSystemSupport) {
final CasWebflowEventResolver r = new SurrogateWebflowEventResolver(authenticationSystemSupport, centralAuthenticationService,
servicesManager, ticketRegistrySupport, warnCookieGenerator,
authenticationRequestServiceSelectionStrategies,
selector, surrogateAuthenticationService);
this.initialAuthenticationAttemptWebflowEventResolver.addDelegate(r);
return r;
}
示例14: UaaWebSecurityConfiguration
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
public UaaWebSecurityConfiguration(UserDetailsService userDetailsService,
AuthenticationManagerBuilder authenticationManagerBuilder,
@Qualifier("authenticationProviderResolver") AuthenticationProviderResolver authenticationProviderResolver,
@Lazy PasswordEncoder passwordEncoder) {
this.userDetailsService = userDetailsService;
this.authenticationManagerBuilder = authenticationManagerBuilder;
this.authenticationProviderResolver = authenticationProviderResolver;
this.passwordEncoder = passwordEncoder;
}
示例15: getJedisPool
import org.springframework.beans.factory.annotation.Qualifier; //导入依赖的package包/类
@Bean(name="o2iConfigJedisPool")
public JedisPool getJedisPool(@Qualifier("o2iConfigJedisPoolConfig") JedisPoolConfig config,
@Value("${spring.redis.o2iConfig.host}")String host,
@Value("${spring.redis.o2iConfig.port}")int port,
@Value("${spring.redis.o2iConfig.timeOut}")int timeOut) {
return new JedisPool(config, host, port, timeOut);
}