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


Java ConfigurationProperties类代码示例

本文整理汇总了Java中org.springframework.boot.context.properties.ConfigurationProperties的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationProperties类的具体用法?Java ConfigurationProperties怎么用?Java ConfigurationProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConfigurationProperties类属于org.springframework.boot.context.properties包,在下文中一共展示了ConfigurationProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: oauth2ClientDetails

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties(prefix = "security.oauth2.client")
public BaseClientDetails oauth2ClientDetails() {
	BaseClientDetails details = new BaseClientDetails();
	if (this.client.getClientId() == null) {
		this.client.setClientId(UUID.randomUUID().toString());
	}
	details.setClientId(this.client.getClientId());
	details.setClientSecret(this.client.getClientSecret());
	details.setAuthorizedGrantTypes(Arrays.asList("authorization_code",
			"password", "client_credentials", "implicit", "refresh_token"));
	details.setAuthorities(
			AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER"));
	details.setRegisteredRedirectUri(Collections.<String>emptySet());
	return details;
}
 
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:17,代码来源:OAuth2AuthorizationServerConfiguration.java

示例2: druidServlet

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties(DruidServletProperties.DRUID_SERVLET_PREFIX)
public ServletRegistrationBean druidServlet(DruidServletProperties properties) {
    ServletRegistrationBean reg = new ServletRegistrationBean();
    reg.setServlet(new StatViewServlet());
    reg.addUrlMappings(properties.getUrlMappings());
    if(properties.getAllow() !=null){
        reg.addInitParameter("allow", properties.getAllow());  // IP白名单 (没有配置或者为空,则允许所有访问)
    }
    if(properties.getDeny() !=null){
        reg.addInitParameter("deny", properties.getDeny()); //IP黑名单 (存在共同时,deny优先于allow)
    }
    if(properties.getLoginUsername() !=null){
        reg.addInitParameter("loginUsername", properties.getLoginUsername()); //用户名
    }
    if(properties.getLoginPassword() !=null){
        reg.addInitParameter("loginPassword", properties.getLoginPassword()); // 密码
    }
    if(properties.getResetEnable() !=null){
        reg.addInitParameter("resetEnable", properties.getResetEnable().toString());// 禁用HTML页面上的“Reset All”功能
    }
    return reg;
}
 
开发者ID:cuisongliu,项目名称:druid-boot-starter,代码行数:24,代码来源:DruidServletAutoConfiguration.java

示例3: blueKitEditProfilePolicy

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean("blueKitEditProfilePolicy")
@ConditionalOnBean(EditProfilePolicy.class)
@ConditionalOnProperty(prefix = "blue-kit.b2c.policy.edit-profile", value = {"name", "redirect-url"})
@ConfigurationProperties("blue-kit.b2c.policy.edit-profile")
public EditProfilePolicy blueKitEditProfilePolicy(){

    return new EditProfilePolicy();
}
 
开发者ID:Xitikit,项目名称:xitikit-blue,代码行数:9,代码来源:B2CPolicyAutoConfiguration.java

示例4: applicationAliveEndpoint

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(AliveHealthEndpoint.class)
@ConfigurationProperties("extended.health.alive")
public AliveHealthEndpoint applicationAliveEndpoint() {

    return new AliveHealthEndpoint("alive", new OrderedHealthAggregator());
}
 
开发者ID:dm-drogeriemarkt,项目名称:extended-actuator-health-endpoints,代码行数:8,代码来源:ExtendedHealthEndpointAutoConfiguration.java

示例5: getDatasource

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
/**
 * Get data source.
 *
 * @return Data source
 */
@Primary
@Bean
@ConfigurationProperties(prefix="spring.datasource")
public DataSource getDatasource() {
    return DataSourceBuilder.create().build();
}
 
开发者ID:JonkiPro,项目名称:REST-Web-Services,代码行数:12,代码来源:WebDatasourceConfig.java

示例6: writeDataSource

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean(name="writeDataSource", destroyMethod = "close", initMethod="init")
@Primary
@ConfigurationProperties(prefix = "spring.datasource")
public DataSource writeDataSource() {
    logger.info("初始化写入数据源……");
    return DataSourceBuilder.create().type(dataSourceType).build();
}
 
开发者ID:jinping125,项目名称:read-write-sever,代码行数:8,代码来源:DatabaseConfig.java

示例7: getConnectionFactory

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties(prefix = "spring.redis")
public JedisConnectionFactory getConnectionFactory() {
    JedisConnectionFactory factory = new JedisConnectionFactory();
    JedisPoolConfig config = getRedisConfig();
    factory.setPoolConfig(config);
    logger.info("JedisConnectionFactory bean init success.");
    return factory;
}
 
开发者ID:1991wangliang,项目名称:sds,代码行数:10,代码来源:RedisConfig.java

示例8: contentNegotiationManager

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties("spring.mvc.viewManager")
public ContentNegotiationManager contentNegotiationManager() {
	// 声明contentNegotiationManagerFactory工厂实例,并根据配置参数填充对象。
	ContentNegotiationManagerFactoryBean contentNegotiationManagerFactory = new ContentNegotiationManagerFactoryBean();
	// 手动填充mediaTypes参数
	Map<String, MediaType> mediaTypes = new HashMap<String, MediaType>();
	mediaTypes.put("json", MediaType.APPLICATION_JSON_UTF8);
	mediaTypes.put("xml", MediaType.APPLICATION_XML);
	contentNegotiationManagerFactory.addMediaTypes(mediaTypes);
	// 返回contentNegotiationManager对象
	return contentNegotiationManagerFactory.getObject();
}
 
开发者ID:phoenix-varus,项目名称:jeeWe,代码行数:14,代码来源:MvcViewConfiguration.java

示例9: blueKitSignInPolicy

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean("blueKitSignInPolicy")
@ConditionalOnBean(SignInPolicy.class)
@ConditionalOnProperty(prefix = "blue-kit.b2c.policy.sign-in", value = {"name", "redirect-url"})
@ConfigurationProperties("blue-kit.b2c.policy.sign-in")
public SignInPolicy blueKitSignInPolicy(){

    return new SignInPolicy();
}
 
开发者ID:Xitikit,项目名称:xitikit-blue,代码行数:9,代码来源:B2CPolicyAutoConfiguration.java

示例10: detailHealthEndpoint

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(DetailHealthEndpoint.class)
@ConfigurationProperties("extended.health.detail")
public DetailHealthEndpoint detailHealthEndpoint() {

    return new DetailHealthEndpoint("detail", new OrderedHealthAggregator());
}
 
开发者ID:dm-drogeriemarkt,项目名称:extended-actuator-health-endpoints,代码行数:8,代码来源:ExtendedHealthEndpointAutoConfiguration.java

示例11: dataSource

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@Primary
@ConfigurationProperties(prefix = "spring.datasource")
public DataSource dataSource() {
	ConnectionData conData = getDbUrl();
	return DataSourceBuilder
			.create()
			.url(conData.getUrl() + "?sslmode=require")
			.username(conData.getUser())
			.password(conData.getPassword())
			.driverClassName("org.postgresql.Driver")
			.build();
}
 
开发者ID:Arquisoft,项目名称:participationSystem3a,代码行数:14,代码来源:DataSourceBean.java

示例12: getConfigurationPropertiesBeans

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
private Map<String, Object> getConfigurationPropertiesBeans(
        ApplicationContext context,
        ConfigurationBeanFactoryMetaData beanFactoryMetaData) {
    Map<String, Object> beans = new LinkedHashMap<String, Object>();
    beans.putAll(context.getBeansWithAnnotation(ConfigurationProperties.class));
    if (beanFactoryMetaData != null) {
        beans.putAll(beanFactoryMetaData
                .getBeansWithFactoryAnnotation(ConfigurationProperties.class));
    }
    return beans;
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:12,代码来源:Gatherer.java

示例13: dataSource

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Primary
@Bean(name= "dataSource", destroyMethod= "close", initMethod="init")
   @ConfigurationProperties(prefix="spring.dataSource")
   public DataSource dataSource() {
	logger.debug("Configruing DataSource");
	return new DruidDataSource();
   }
 
开发者ID:lemon-china,项目名称:lemon-dubbo-message,代码行数:8,代码来源:DatabaseConfiguration.java

示例14: writeDataSource

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
/**
 * 主库配置(负责写)
 * @return
 */
@Bean(name="masterDataSource")
@Primary
@ConfigurationProperties(prefix = "spring.datasource")
public DataSource writeDataSource() {
    log.info("-------------------- Master DataSource init ---------------------");
    return DataSourceBuilder.create().type(dataSourceType).build();
}
 
开发者ID:MIYAOW,项目名称:MI-S,代码行数:12,代码来源:DataBaseConfiguration.java

示例15: typeProxyCreator

import org.springframework.boot.context.properties.ConfigurationProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties(DruidStatProperties.DRUID_STAT_PREFIX)
public BeanTypeAutoProxyCreator typeProxyCreator(DruidStatProperties properties){
    if (properties.getTargetBeanType() == null){
        throw new IllegalStateException(DruidStatProperties.DRUID_STAT_PREFIX+".target-bean-type must  not null.");
    }
    BeanTypeAutoProxyCreator creator = new BeanTypeAutoProxyCreator();
    creator.setTargetBeanType(properties.getTargetBeanType());
    creator.setProxyTargetClass(proxyTargetClass);
    creator.setInterceptorNames(DruidStatProperties.DRUID_STAT_INTERCEPTOR_NAME);
    return  creator;
}
 
开发者ID:cuisongliu,项目名称:druid-boot-starter,代码行数:13,代码来源:DruidTypeAopAutoConfiguration.java


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