Package net.officefloor.jdbc
Interface DataSourceWrapper
-
public interface DataSourceWrapper
Means to obtain theDataSource
being wrapped.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GET_REAL_DATA_SOURCE_METHOD_NAME
getRealDataSource()
Method
name.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.sql.DataSource
getRealDataSource()
Allows obtaining the actualDataSource
.static javax.sql.DataSource
getRealDataSource(javax.sql.DataSource dataSource)
Obtains the "real"DataSource
from the inputDataSource
.static java.lang.reflect.Method
getRealDataSourceMethod()
Obtains thegetRealDataSource()
Method
.static boolean
isGetRealDataSourceMethod(java.lang.reflect.Method method)
Indicates ifMethod
is thegetRealDataSource()
.
-
-
-
Field Detail
-
GET_REAL_DATA_SOURCE_METHOD_NAME
static final java.lang.String GET_REAL_DATA_SOURCE_METHOD_NAME
getRealDataSource()
Method
name.- See Also:
- Constant Field Values
-
-
Method Detail
-
isGetRealDataSourceMethod
static boolean isGetRealDataSourceMethod(java.lang.reflect.Method method)
Indicates ifMethod
is thegetRealDataSource()
.- Parameters:
method
-Method
.- Returns:
true
ifgetRealDataSource()
.
-
getRealDataSourceMethod
static java.lang.reflect.Method getRealDataSourceMethod()
Obtains thegetRealDataSource()
Method
.- Returns:
getRealDataSource()
Method
.
-
getRealDataSource
static javax.sql.DataSource getRealDataSource(javax.sql.DataSource dataSource) throws java.sql.SQLException
Obtains the "real"DataSource
from the inputDataSource
.- Parameters:
dataSource
-DataSource
to inspect for the "real"DataSource
.- Returns:
- The "real"
DataSource
. - Throws:
java.sql.SQLException
- If fails to obtain the "real"DataSource
.
-
getRealDataSource
javax.sql.DataSource getRealDataSource() throws java.sql.SQLException
Allows obtaining the actual
DataSource
.Some implementations may
Proxy
theDataSource
. Therefore, in inspecting theDataSource
on closingOfficeFloor
, it will incorrectly determine if theDataSource
isAutoCloseable
.This enables obtaining the "real"
DataSource
.- Returns:
- The "real"
DataSource
. In some implementations it may actually benull
as no "real" backingDataSource
is available. - Throws:
java.sql.SQLException
- If fails to obtain the "real"DataSource
.
-
-