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