Search in sources :

Example 6 with Profile

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;
}
Also used : PropertySourcesPlaceholderConfigurer(org.springframework.context.support.PropertySourcesPlaceholderConfigurer) ClassPathResource(org.springframework.core.io.ClassPathResource) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 7 with Profile

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;
}
Also used : ExternalConfiguration(alfio.manager.system.ExternalConfiguration) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 8 with Profile

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;
}
Also used : SimpleServiceLevelAssessor(com.thinkbiganalytics.metadata.sla.spi.core.SimpleServiceLevelAssessor) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 9 with Profile

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;
}
Also used : ObservationManager(javax.jcr.observation.ObservationManager) RepositoryException(javax.jcr.RepositoryException) JcrIndexService(com.thinkbiganalytics.metadata.modeshape.service.JcrIndexService) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean) ConditionalOnProperty(org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)

Example 10 with Profile

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;
}
Also used : DriverManagerDataSource(org.springframework.jdbc.datasource.DriverManagerDataSource) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

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