Search in sources :

Example 21 with Profile

use of org.springframework.context.annotation.Profile in project hono by eclipse.

the class AppConfiguration method messagingKafkaConsumerConfig.

/**
 * Exposes Kafka consumer configuration properties as a Spring bean.
 *
 * @param commonKafkaClientConfig The common Kafka client configuration.
 * @return The properties.
 */
@ConfigurationProperties(prefix = "hono.kafka.consumer")
@Profile("kafka")
@Bean
public MessagingKafkaConsumerConfigProperties messagingKafkaConsumerConfig(final CommonKafkaClientConfigProperties commonKafkaClientConfig) {
    final MessagingKafkaConsumerConfigProperties configProperties = new MessagingKafkaConsumerConfigProperties();
    configProperties.setCommonClientConfig(commonKafkaClientConfig);
    return configProperties;
}
Also used : MessagingKafkaConsumerConfigProperties(org.eclipse.hono.client.kafka.consumer.MessagingKafkaConsumerConfigProperties) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 22 with Profile

use of org.springframework.context.annotation.Profile in project books by aidanwhiteley.

the class ThreadPoolConfig method asyncExecutor.

@Bean(name = "threadPoolExecutor")
@Profile(value = "!ci")
public Executor asyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(booksThreadPool1CoreSize);
    executor.setMaxPoolSize(booksThreadPool1MaxSize);
    executor.setQueueCapacity(booksThreadPool1QueueCapacity);
    executor.setThreadNamePrefix(booksThreadPool1ThreadPrefix);
    executor.initialize();
    return executor;
}
Also used : ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 23 with Profile

use of org.springframework.context.annotation.Profile in project irida by phac-nml.

the class AnalysisExecutionServiceTestConfig method analysisTaskExecutor.

/**
 * Builds a new Executor for analysis tasks.
 *
 * @return A new Executor for analysis tasks.
 */
@Profile({ "test", "it" })
@Bean
public Executor analysisTaskExecutor() {
    ScheduledExecutorService delegateExecutor = Executors.newSingleThreadScheduledExecutor();
    SecurityContext schedulerContext = createSchedulerSecurityContext();
    return new DelegatingSecurityContextScheduledExecutorService(delegateExecutor, schedulerContext);
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) DelegatingSecurityContextScheduledExecutorService(org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService) DelegatingSecurityContextScheduledExecutorService(org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService) SecurityContext(org.springframework.security.core.context.SecurityContext) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 24 with Profile

use of org.springframework.context.annotation.Profile in project nzbhydra2 by theotherp.

the class WebDriverConfiguration method getPhantomJsWebDriver.

@Bean
@Profile("!dev")
public WebDriver getPhantomJsWebDriver() {
    logger.info("Creating PhantomJS web driver");
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setJavascriptEnabled(true);
    caps.setCapability("takesScreenshot", true);
    String phantomJsPath = PHANTJOMJS;
    if (System.getenv("PHANTOMJSBIN") != null) {
        phantomJsPath = System.getenv("PHANTOMJSBIN");
        logger.info("Using phantomJs bin {} from environment", phantomJsPath);
    } else {
        logger.info("Using default phantomJs bin {}", phantomJsPath);
    }
    caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, phantomJsPath);
    WebDriverConfiguration.webDriver = new PhantomJSDriver(caps);
    return WebDriverConfiguration.webDriver;
}
Also used : PhantomJSDriver(org.openqa.selenium.phantomjs.PhantomJSDriver) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 25 with Profile

use of org.springframework.context.annotation.Profile in project nzbhydra2 by theotherp.

the class WebDriverConfiguration method initializeChromeDriver.

@Bean
@Profile("dev")
protected ChromeDriver initializeChromeDriver() {
    logger.info("Creating chrome web driver");
    System.setProperty("webdriver.chrome.driver", CHROMEDRIVER);
    ChromeDriver webDriver = new ChromeDriver();
    WebDriverConfiguration.webDriver = webDriver;
    return webDriver;
}
Also used : ChromeDriver(org.openqa.selenium.chrome.ChromeDriver) 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