use of org.springframework.context.annotation.Profile in project alf.io by alfio-event.
the class ApplicationPropertiesConfiguration method propertyPlaceholder.
@Bean
@Profile("!" + Initializer.PROFILE_SPRING_BOOT)
public static PropertySourcesPlaceholderConfigurer propertyPlaceholder() {
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setLocation(new ClassPathResource("application.properties"));
return configurer;
}
use of org.springframework.context.annotation.Profile in project alf.io by alfio-event.
the class BaseTestConfiguration method externalConfiguration.
@Bean
@Profile(Initializer.PROFILE_INTEGRATION_TEST)
public ExternalConfiguration externalConfiguration() {
ExternalConfiguration externalConfiguration = new ExternalConfiguration();
externalConfiguration.setSettings(Map.of(ConfigurationKeys.BASE_URL.name(), "http://localhost:8080"));
return externalConfiguration;
}
use of org.springframework.context.annotation.Profile in project kylo by Teradata.
the class ServerConfiguration method slaAssessor.
@Bean
@Profile("metadata.memory-only")
public ServiceLevelAssessor slaAssessor() {
SimpleServiceLevelAssessor assr = new SimpleServiceLevelAssessor();
assr.registerMetricAssessor(datasetUpdatedSinceMetricAssessor());
assr.registerMetricAssessor(feedExecutedSinceFeedMetricAssessor());
assr.registerMetricAssessor(feedExecutedSinceScheduleMetricAssessor());
assr.registerMetricAssessor(datasourceUpdatedSinceFeedExecutedAssessor());
assr.registerMetricAssessor(withinScheduleAssessor());
return assr;
}
use of org.springframework.context.annotation.Profile in project kylo by Teradata.
the class MetadataJcrConfig method indexService.
// should not run during upgrade
@Bean
@ConditionalOnProperty(prefix = "config", value = "search.engine")
@Profile("!kyloUpgrade")
public JcrIndexService indexService(final Search search, final DatasourceProvider datasourceProvider, final MetadataAccess metadataAccess, final Repository repository) {
final JcrIndexService indexService = new JcrIndexService(search, datasourceProvider, metadataAccess);
try {
final ObservationManager observationManager = repository.login().getWorkspace().getObservationManager();
observationManager.addEventListener(indexService, Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED, EntityUtil.pathForDerivedDatasource(), true, null, null, false);
} catch (final RepositoryException e) {
throw new MetadataRepositoryException("Failed to register index service: " + e, e);
}
return indexService;
}
use of org.springframework.context.annotation.Profile in project tutorials by eugenp.
the class H2TestProfileJPAConfig method dataSource.
@Bean
@Profile("test")
public DataSource dataSource() {
final DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("org.h2.Driver");
dataSource.setUrl("jdbc:h2:mem:db;DB_CLOSE_DELAY=-1");
dataSource.setUsername("sa");
dataSource.setPassword("sa");
return dataSource;
}
Aggregations