Class DataSourceWrapper
- java.lang.Object
-
- org.springframework.jdbc.datasource.DelegatingDataSource
-
- org.springframework.cloud.sleuth.instrument.jdbc.DataSourceWrapper
-
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,org.springframework.beans.factory.InitializingBean
public class DataSourceWrapper extends org.springframework.jdbc.datasource.DelegatingDataSourceReturns link of both realDataSource, decoratedDataSource.- Since:
- 3.1.0
- Author:
- Arthur Gavlyukovskiy
-
-
Constructor Summary
Constructors Constructor Description DataSourceWrapper(DataSource originalDataSource, DataSource decoratedDataSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSourcegetDecoratedDataSource()Returns wrapped data source with the decorator applied.DataSourcegetOriginalDataSource()Returns original data source, before applying any decorator.-
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource
afterPropertiesSet, getConnection, getConnection, getLoginTimeout, getLogWriter, getParentLogger, getTargetDataSource, isWrapperFor, obtainTargetDataSource, setLoginTimeout, setLogWriter, setTargetDataSource, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
-
-
-
Constructor Detail
-
DataSourceWrapper
public DataSourceWrapper(DataSource originalDataSource, DataSource decoratedDataSource)
-
-
Method Detail
-
getOriginalDataSource
public DataSource getOriginalDataSource()
Returns original data source, before applying any decorator.- Returns:
- original data source
-
getDecoratedDataSource
public DataSource getDecoratedDataSource()
Returns wrapped data source with the decorator applied.- Returns:
- decorated data source
-
-