当前位置: 首页>>代码示例>>Java>>正文


Java Qualifier类代码示例

本文整理汇总了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();
}
 
开发者ID:DomKing,项目名称:busi-support,代码行数:21,代码来源:BusinessDatabaseConfig.java

示例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;
}
 
开发者ID:omacarena,项目名称:only-short-poc,代码行数:17,代码来源:MySqlSource1Config.java

示例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;
}
 
开发者ID:ranji1221,项目名称:lemcloud,代码行数:19,代码来源:ShiroConfig.java

示例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();
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:21,代码来源:BusinessDatabaseConfig.java

示例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;
}
 
开发者ID:JonkiPro,项目名称:REST-Web-Services,代码行数:27,代码来源:MovieContributionPersistenceServiceImpl.java

示例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;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:22,代码来源:CasValidationConfiguration.java

示例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);
}
 
开发者ID:scionaltera,项目名称:emergentmud,代码行数:25,代码来源:NoiseMap.java

示例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();
}
 
开发者ID:Lengchuan,项目名称:SpringBoot-Study,代码行数:31,代码来源:Read1DruidDataSourceConfig.java

示例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();
}
 
开发者ID:roybailey,项目名称:research-graphql,代码行数:18,代码来源:ManualGraphQLQuerySchema.java

示例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();
}
 
开发者ID:SnackMen,项目名称:DanmuChat,代码行数:8,代码来源:DataSourceConfig.java

示例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();
}
 
开发者ID:viakiba,项目名称:springboot,代码行数:9,代码来源:MasterDataSourceConfig.java

示例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());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-gcp,代码行数:13,代码来源:StackdriverTraceAutoConfiguration.java

示例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;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:11,代码来源:SurrogateWebflowEventResolutionConfiguration.java

示例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;
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:10,代码来源:UaaWebSecurityConfiguration.java

示例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);
}
 
开发者ID:Zigin,项目名称:MonitorPlatform,代码行数:8,代码来源:O2iConfigRedisConfig.java


注:本文中的org.springframework.beans.factory.annotation.Qualifier类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。