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;
}
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;
}
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;
}
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));
}
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;
}
Aggregations