use of org.springframework.context.annotation.Primary in project faf-java-server by FAForever.
the class OAuthJwtConfig method tokenServices.
@Bean
@Primary
public DefaultTokenServices tokenServices(TokenStore tokenStore) {
DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore);
defaultTokenServices.setSupportRefreshToken(true);
return defaultTokenServices;
}
use of org.springframework.context.annotation.Primary in project Spring-5.0-By-Example by PacktPublishing.
the class RedisConfiguration method mapper.
@Bean
@Primary
public ObjectMapper mapper() {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.registerModule(new JavaTimeModule());
return mapper;
}
use of org.springframework.context.annotation.Primary in project FP-PSP-SERVER by FundacionParaguaya.
the class AuthServerOAuth2Config method defaultTokenServices.
@Bean
@Primary
public DefaultTokenServices defaultTokenServices() {
final DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore());
defaultTokenServices.setTokenEnhancer(tokenEnhancer());
defaultTokenServices.setSupportRefreshToken(true);
defaultTokenServices.setClientDetailsService(clientDetailsService());
return defaultTokenServices;
}
use of org.springframework.context.annotation.Primary in project tutorials by eugenp.
the class UserConfig method userEntityManager.
//
@Primary
@Bean
public LocalContainerEntityManagerFactoryBean userEntityManager() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(userDataSource());
em.setPackagesToScan(new String[] { "org.baeldung.persistence.multiple.model.user" });
final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
final HashMap<String, Object> properties = new HashMap<String, Object>();
properties.put("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
properties.put("hibernate.dialect", env.getProperty("hibernate.dialect"));
em.setJpaPropertyMap(properties);
return em;
}
use of org.springframework.context.annotation.Primary in project tutorials by eugenp.
the class UserConfig method userDataSource.
@Primary
@Bean
public DataSource userDataSource() {
final DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName")));
dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("user.jdbc.url")));
dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user")));
dataSource.setPassword(Preconditions.checkNotNull(env.getProperty("jdbc.pass")));
return dataSource;
}
Aggregations