mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
#476 - ENH: Enable ServiceConfig to use alternate ClassLoader - was ServiceConfig add setClassloader api --- part 3: Refactor with ClassLoadConfig
This commit is contained in:
1 parent
2859ea657e
commit
f252b80c2d
16 files changed
+266
-256
No files matched your search
@@ -171,10 +171,14 @@ public class DataSourcePool implements DataSource {
|
||||
private final Runnable heartbeatRunnable = new HeartBeatRunnable();
|
||||
|
||||
public DataSourcePool(DataSourceAlert notify, String name, DataSourceConfig params) {
|
||||
this(notify, name, params, null);
|
||||
}
|
||||
|
||||
public DataSourcePool(DataSourceAlert notify, String name, DataSourceConfig params, DataSourcePoolListener listener) {
|
||||
|
||||
this.notify = notify;
|
||||
this.name = name;
|
||||
this.poolListener = createPoolListener(params.getPoolListener());
|
||||
this.poolListener = listener;
|
||||
|
||||
this.autoCommit = params.isAutoCommit();
|
||||
this.transactionIsolation = params.getIsolationLevel();
|
||||
@@ -238,20 +242,6 @@ public class DataSourcePool implements DataSource {
|
||||
throw new SQLFeatureNotSupportedException("We do not support java.util.logging");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the DataSourcePoolListener if there is one.
|
||||
*/
|
||||
private DataSourcePoolListener createPoolListener(String cn) {
|
||||
if (cn == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return (DataSourcePoolListener) ClassUtil.newInstance(cn, this.getClass());
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void initialise() throws SQLException {
|
||||
|
||||
String transIsolation = TransactionIsolation.getLevelDescription(transactionIsolation);
|
||||
|
||||
Reference in new issue
Block a user