use of com.pamirs.attach.plugin.dynamic.template.HikariTemplate in project LinkAgent by shulieTech.
the class DataSourceConnectionInterceptor method attachment.
void attachment(Advice advice) {
try {
HikariDataSource target = (HikariDataSource) advice.getTarget();
ResourceManager.set(new Attachment(target.getJdbcUrl(), "hikari", Type.DataBaseType.types(), new HikariTemplate().setUrl(target.getJdbcUrl()).setUsername(target.getUsername()).setPassword(target.getPassword()).setDriverClassName(target.getDriverClassName()).setConnectionTimeout(target.getConnectionTimeout()).setConnectionTestQuery(target.getConnectionTestQuery()).setIdleTimeout(target.getIdleTimeout()).setMaxLifetime(target.getMaxLifetime()).setMinimumIdle(target.getIdleTimeout()).setMaximumPoolSize(target.getMaximumPoolSize()).setValidationTimeout(target.getValidationTimeout())));
} catch (Throwable t) {
logger.error(t.getMessage());
}
}
Aggregations