Search in sources :

Example 11 with Profile

use of org.springframework.context.annotation.Profile in project nakadi by zalando.

the class RepositoriesConfig method featureToggleServiceLocal.

@Profile({ "acceptanceTest", "local" })
@Bean
public FeatureToggleService featureToggleServiceLocal(final ZooKeeperHolder zooKeeperHolder, final FeaturesConfig featuresConfig) {
    final FeatureToggleService featureToggleService = new FeatureToggleServiceZk(zooKeeperHolder);
    if (featuresConfig.containsDefaults()) {
        final Set<String> features = featuresConfig.getFeaturesWithDefaultState();
        for (final String feature : features) {
            LOG.info("Setting feature {} to {}", feature, featuresConfig.getDefaultState(feature));
            featureToggleService.setFeature(new FeatureToggleService.FeatureWrapper(FeatureToggleService.Feature.valueOf(feature), featuresConfig.getDefaultState(feature)));
        }
    }
    return featureToggleService;
}
Also used : FeatureToggleServiceZk(org.zalando.nakadi.service.FeatureToggleServiceZk) FeatureToggleService(org.zalando.nakadi.service.FeatureToggleService) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 12 with Profile

use of org.springframework.context.annotation.Profile in project pivotal-cla by pivotalsoftware.

the class SessionConfig method cloudRedisConnectionFactory.

@Profile(GitHubClaProfiles.CLOUDFOUNDRY)
@Bean
public RedisConnectionFactory cloudRedisConnectionFactory() {
    CloudFactory cloudFactory = new CloudFactory();
    Cloud cloud = cloudFactory.getCloud();
    RedisConnectionFactory connectionFactory = cloud.getSingletonServiceConnector(RedisConnectionFactory.class, null);
    if (connectionFactory instanceof LettuceConnectionFactory) {
        ((LettuceConnectionFactory) connectionFactory).setShutdownTimeout(0);
    }
    return connectionFactory;
}
Also used : CloudFactory(org.springframework.cloud.CloudFactory) Cloud(org.springframework.cloud.Cloud) LettuceConnectionFactory(org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Profile(org.springframework.context.annotation.Profile) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 13 with Profile

use of org.springframework.context.annotation.Profile in project av-service by dvoraka.

the class CoreConfig method mbeanExporter.

/**
 * Special MBeanExporter bean for integration tests.
 *
 * @return MBeanExporter with a different registration strategy
 */
@Bean
@Profile("itest")
public MBeanExporter mbeanExporter() {
    MBeanExporter exporter = new MBeanExporter();
    exporter.setRegistrationPolicy(RegistrationPolicy.REPLACE_EXISTING);
    return exporter;
}
Also used : MBeanExporter(org.springframework.jmx.export.MBeanExporter) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 14 with Profile

use of org.springframework.context.annotation.Profile in project dhis2-core by dhis2.

the class FlywayConfig method flyway.

@Bean(value = "flyway", initMethod = "migrate")
@Profile("!test-h2")
@DependsOn("dataSource")
public Flyway flyway(DhisConfigurationProvider configurationProvider, DataSource dataSource) {
    ClassicConfiguration classicConfiguration = new ClassicConfiguration();
    classicConfiguration.setDataSource(dataSource);
    classicConfiguration.setBaselineOnMigrate(true);
    classicConfiguration.setOutOfOrder(configurationProvider.isEnabled(FLYWAY_OUT_OF_ORDER_MIGRATION));
    classicConfiguration.setIgnoreMissingMigrations(true);
    classicConfiguration.setIgnoreFutureMigrations(false);
    classicConfiguration.setGroup(true);
    classicConfiguration.setLocations(new Location(FLYWAY_MIGRATION_FOLDER));
    classicConfiguration.setMixed(true);
    return new DhisFlyway(classicConfiguration, configurationProvider.isEnabled(FLYWAY_REPAIR_BEFORE_MIGRATION));
}
Also used : ClassicConfiguration(org.flywaydb.core.api.configuration.ClassicConfiguration) Location(org.flywaydb.core.api.Location) DependsOn(org.springframework.context.annotation.DependsOn) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 15 with Profile

use of org.springframework.context.annotation.Profile in project webanno by webanno.

the class WebAnnoSecurity method internalAuthenticationProvider.

@Bean(name = "authenticationProvider")
@Profile("auto-mode-builtin")
@Autowired
public DaoAuthenticationProvider internalAuthenticationProvider(UserDetailsManager aUserDetailsService, PasswordEncoder aPasswordEncoder) {
    DaoAuthenticationProvider authProvider = new WebAnnoDaoAuthenticationProvider();
    authProvider.setUserDetailsService(aUserDetailsService);
    authProvider.setPasswordEncoder(aPasswordEncoder);
    return authProvider;
}
Also used : WebAnnoDaoAuthenticationProvider(de.tudarmstadt.ukp.clarin.webanno.security.WebAnnoDaoAuthenticationProvider) DaoAuthenticationProvider(org.springframework.security.authentication.dao.DaoAuthenticationProvider) WebAnnoDaoAuthenticationProvider(de.tudarmstadt.ukp.clarin.webanno.security.WebAnnoDaoAuthenticationProvider) Autowired(org.springframework.beans.factory.annotation.Autowired) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)27 Profile (org.springframework.context.annotation.Profile)27 ObjectFactoryCreatingFactoryBean (org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean)5 ArrayList (java.util.ArrayList)2 ConfigurationProperties (org.springframework.boot.context.properties.ConfigurationProperties)2 Scope (org.springframework.context.annotation.Scope)2 DaoAuthenticationProvider (org.springframework.security.authentication.dao.DaoAuthenticationProvider)2 ExternalConfiguration (alfio.manager.system.ExternalConfiguration)1 AWS4Signer (com.amazonaws.auth.AWS4Signer)1 AWSRequestSigningApacheInterceptor (com.amazonaws.http.AWSRequestSigningApacheInterceptor)1 ReportPortalRepositoryFactoryBean (com.epam.ta.reportportal.database.dao.ReportPortalRepositoryFactoryBean)1 RepositoriesFactoryBean (com.epam.ta.reportportal.database.support.RepositoriesFactoryBean)1 JcrIndexService (com.thinkbiganalytics.metadata.modeshape.service.JcrIndexService)1 SimpleServiceLevelAssessor (com.thinkbiganalytics.metadata.sla.spi.core.SimpleServiceLevelAssessor)1 WebAnnoDaoAuthenticationProvider (de.tudarmstadt.ukp.clarin.webanno.security.WebAnnoDaoAuthenticationProvider)1 ShibbolethRequestHeaderAuthenticationFilter (de.tudarmstadt.ukp.clarin.webanno.security.preauth.ShibbolethRequestHeaderAuthenticationFilter)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 SQLException (java.sql.SQLException)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1