Search in sources :

Example 1 with ConfigurationProperties

use of org.springframework.boot.context.properties.ConfigurationProperties in project spring-boot-admin by codecentric.

the class DiscoveryClientConfiguration method applicationDiscoveryListener.

@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = "spring.boot.admin.discovery")
public ApplicationDiscoveryListener applicationDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter) {
    ApplicationDiscoveryListener listener = new ApplicationDiscoveryListener(discoveryClient, registry);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
Also used : ApplicationDiscoveryListener(de.codecentric.boot.admin.discovery.ApplicationDiscoveryListener) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with ConfigurationProperties

use of org.springframework.boot.context.properties.ConfigurationProperties in project spring-boot by spring-projects.

the class SampleOpenTsdbExportApplication method openTsdbMetricWriter.

@Bean
@ConfigurationProperties("metrics.export")
@ExportMetricWriter
public GaugeWriter openTsdbMetricWriter() {
    OpenTsdbGaugeWriter writer = new OpenTsdbGaugeWriter();
    writer.setNamingStrategy(namingStrategy());
    return writer;
}
Also used : OpenTsdbGaugeWriter(org.springframework.boot.actuate.metrics.opentsdb.OpenTsdbGaugeWriter) ExportMetricWriter(org.springframework.boot.actuate.autoconfigure.ExportMetricWriter) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) Bean(org.springframework.context.annotation.Bean)

Example 3 with ConfigurationProperties

use of org.springframework.boot.context.properties.ConfigurationProperties in project spring-boot by spring-projects.

the class BitronixJtaConfiguration method bitronixConfiguration.

@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = "spring.jta.bitronix.properties")
public bitronix.tm.Configuration bitronixConfiguration() {
    bitronix.tm.Configuration config = TransactionManagerServices.getConfiguration();
    if (StringUtils.hasText(this.jtaProperties.getTransactionManagerId())) {
        config.setServerId(this.jtaProperties.getTransactionManagerId());
    }
    File logBaseDir = getLogBaseDir();
    config.setLogPart1Filename(new File(logBaseDir, "part1.btm").getAbsolutePath());
    config.setLogPart2Filename(new File(logBaseDir, "part2.btm").getAbsolutePath());
    config.setDisableJmx(true);
    return config;
}
Also used : File(java.io.File) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ConfigurationProperties (org.springframework.boot.context.properties.ConfigurationProperties)3 Bean (org.springframework.context.annotation.Bean)3 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)2 ApplicationDiscoveryListener (de.codecentric.boot.admin.discovery.ApplicationDiscoveryListener)1 File (java.io.File)1 ExportMetricWriter (org.springframework.boot.actuate.autoconfigure.ExportMetricWriter)1 OpenTsdbGaugeWriter (org.springframework.boot.actuate.metrics.opentsdb.OpenTsdbGaugeWriter)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1