This commit is contained in:
Looly
2023-12-19 22:04:31 +08:00
parent 494c70b9e6
commit 6dfb495278
6 changed files with 48 additions and 18 deletions

View File

@@ -13,6 +13,7 @@
package org.dromara.hutool.db.ds;
import org.dromara.hutool.core.io.IoUtil;
import org.dromara.hutool.core.lang.Singleton;
import org.dromara.hutool.core.map.MapUtil;
import org.dromara.hutool.core.map.SafeConcurrentHashMap;
import org.dromara.hutool.core.spi.SpiUtil;
@@ -42,17 +43,13 @@ public class DSPool implements Closeable {
private static final String CONNECTION_PREFIX = "connection.";
private static class SingletonHolder {
private static final DSPool INSTANCE = new DSPool();
}
/**
* 获取单例池对象
*
* @return 数据源池
*/
public static DSPool getInstance() {
return SingletonHolder.INSTANCE;
return Singleton.get(DSPool.class.getName(), DSPool::new);
}
/**