Search in sources :

Example 1 with HikariTemplate

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());
    }
}
Also used : HikariDataSource(com.zaxxer.hikari.HikariDataSource) HikariTemplate(com.pamirs.attach.plugin.dynamic.template.HikariTemplate) Attachment(com.pamirs.attach.plugin.dynamic.Attachment)

Aggregations

Attachment (com.pamirs.attach.plugin.dynamic.Attachment)1 HikariTemplate (com.pamirs.attach.plugin.dynamic.template.HikariTemplate)1 HikariDataSource (com.zaxxer.hikari.HikariDataSource)1