Class DecoratedDataSource

java.lang.Object
org.springframework.jdbc.datasource.DelegatingDataSource
com.github.gavlyukovskiy.boot.jdbc.decorator.DecoratedDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, org.springframework.beans.factory.InitializingBean

public class DecoratedDataSource extends org.springframework.jdbc.datasource.DelegatingDataSource
Interface that implicitly added to the CGLIB proxy of DataSource. Returns link of both real DataSource, decorated DataSource and all decorating chain including decorator bean name, instance and result of decorating.
Since:
1.2.2
  • Method Details

    • getBeanName

      public String getBeanName()
      Returns data source bean name.
      Returns:
      data source bean name
    • getRealDataSource

      public DataSource getRealDataSource()
      Returns initial data source, before applying any decorator.
      Returns:
      initial data source
    • getDecoratedDataSource

      public DataSource getDecoratedDataSource()
      Returns wrapped data source with all decorators applied.
      Returns:
      decorated data source
    • getDecoratingChain

      public List<DataSourceDecorationStage> getDecoratingChain()
      Returns list with all decorators applied on a DataSource reverse ordered with applying order.
      Returns:
      decorating information chain
    • unwrap

      public <T> T unwrap(Class<T> iface) throws SQLException
      Specified by:
      unwrap in interface Wrapper
      Overrides:
      unwrap in class org.springframework.jdbc.datasource.DelegatingDataSource
      Throws:
      SQLException
    • toString

      public String toString()
      Overrides:
      toString in class Object