Search in sources :

Example 1 with SpringSessionDataSource

use of org.springframework.session.jdbc.config.annotation.SpringSessionDataSource in project spring-session by spring-projects.

the class JdbcHttpSessionConfiguration method setDataSource.

@Autowired
public void setDataSource(@SpringSessionDataSource ObjectProvider<DataSource> springSessionDataSource, ObjectProvider<DataSource> dataSource) {
    DataSource dataSourceToUse = springSessionDataSource.getIfAvailable();
    if (dataSourceToUse == null) {
        dataSourceToUse = dataSource.getObject();
    }
    this.dataSource = dataSourceToUse;
}
Also used : SpringSessionDataSource(org.springframework.session.jdbc.config.annotation.SpringSessionDataSource) DataSource(javax.sql.DataSource) Autowired(org.springframework.beans.factory.annotation.Autowired)

Aggregations

DataSource (javax.sql.DataSource)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 SpringSessionDataSource (org.springframework.session.jdbc.config.annotation.SpringSessionDataSource)1