use of org.springframework.context.annotation.Primary in project mots by motech-implementations.
the class TokenConfiguration method tokenServices.
/**
* Set-up CustomTokenServices with tokenStore().
* @return token services
*/
@Bean
@Primary
public CustomTokenServices tokenServices() {
TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
tokenEnhancerChain.setTokenEnhancers(Arrays.asList(tokenEnhancer(), accessTokenConverter()));
CustomTokenServices customTokenServices = new CustomTokenServices();
customTokenServices.setTokenStore(tokenStore());
customTokenServices.setTokenEnhancer(tokenEnhancerChain);
customTokenServices.setClientDetailsService(clientDetailsService);
customTokenServices.setSupportRefreshToken(true);
customTokenServices.setAccessTokenValiditySeconds(tokenValiditySeconds);
customTokenServices.setRefreshTokenValiditySeconds(tokenValiditySeconds * 2);
customTokenServices.setReuseRefreshToken(false);
return customTokenServices;
}
use of org.springframework.context.annotation.Primary in project nakadi by zalando.
the class JsonConfig method jacksonObjectMapper.
@Bean
@Primary
public ObjectMapper jacksonObjectMapper() {
final ObjectMapper objectMapper = new ObjectMapper().setPropertyNamingStrategy(CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
objectMapper.registerModule(enumModule());
objectMapper.registerModule(new Jdk8Module());
objectMapper.registerModule(new ProblemModule());
objectMapper.registerModule(new JodaModule());
objectMapper.configure(WRITE_DATES_AS_TIMESTAMPS, false);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return objectMapper;
}
use of org.springframework.context.annotation.Primary in project taskana by Taskana.
the class RestConfiguration method dataSourceProperties.
@Bean
@Primary
@ConfigurationProperties(prefix = "datasource")
public DataSourceProperties dataSourceProperties() {
DataSourceProperties props = new DataSourceProperties();
props.setUrl("jdbc:h2:mem:taskana;IGNORECASE=TRUE;LOCK_MODE=0;INIT=CREATE SCHEMA IF NOT EXISTS TASKANA");
return props;
}
use of org.springframework.context.annotation.Primary in project kylo by Teradata.
the class LivyWranglerConfig method jobTrackerService.
/**
* Creates the job tracker service.
*/
@Bean
@Primary
public JobTrackerService jobTrackerService(@Nonnull final SparkScriptEngine sparkScriptEngine, @Nonnull final SparkListenerService sparkListenerService) {
final JobTrackerService jobTrackerService = new JobTrackerService(sparkScriptEngine.getClassLoader());
sparkListenerService.addSparkListener(jobTrackerService);
return jobTrackerService;
}
use of org.springframework.context.annotation.Primary in project mybatis.flying by limeng32.
the class DataSourceConfig method dataSource1.
@Bean("dataSource1")
@Primary
public AtomikosDataSourceBean dataSource1() {
AtomikosDataSourceBean ds = new AtomikosDataSourceBean();
ds.setXaDataSource(xaDataSource1());
ds.setUniqueResourceName("testdb");
ds.setMinPoolSize(1);
ds.setMaxPoolSize(3);
ds.setMaxIdleTime(60);
return ds;
}
Aggregations