Search in sources :

Example 1 with C3p0Template

use of com.pamirs.attach.plugin.dynamic.template.C3p0Template in project LinkAgent by shulieTech.

the class DataSourceGetConnectionArgsCutoffInterceptor method attachment.

void attachment(Advice advice) {
    try {
        ComboPooledDataSource target = (ComboPooledDataSource) advice.getTarget();
        ResourceManager.set(new Attachment(target.getJdbcUrl(), "c3p0", Type.DataBaseType.types(), new C3p0Template().setUrl(target.getJdbcUrl()).setUsername(target.getUser()).setPassword(target.getPassword()).setDriverClassName(target.getDriverClass()).setInitialPoolSize(target.getInitialPoolSize()).setMaxIdleTime(target.getMaxIdleTime()).setMaxPoolSize(target.getMaxPoolSize())));
    } catch (Throwable t) {
        logger.error(t.getMessage());
    }
}
Also used : ComboPooledDataSource(com.mchange.v2.c3p0.ComboPooledDataSource) C3p0Template(com.pamirs.attach.plugin.dynamic.template.C3p0Template) Attachment(com.pamirs.attach.plugin.dynamic.Attachment)

Example 2 with C3p0Template

use of com.pamirs.attach.plugin.dynamic.template.C3p0Template in project LinkAgent by shulieTech.

the class DataSourceGetConnectionCutoffInterceptor method attachment.

void attachment(Advice advice) {
    try {
        ComboPooledDataSource target = (ComboPooledDataSource) advice.getTarget();
        ResourceManager.set(new Attachment(target.getJdbcUrl(), "c3p0", Type.DataBaseType.types(), new C3p0Template().setUrl(target.getJdbcUrl()).setUsername(target.getUser()).setPassword(target.getPassword()).setDriverClassName(target.getDriverClass()).setInitialPoolSize(target.getInitialPoolSize()).setMaxIdleTime(target.getMaxIdleTime()).setMaxPoolSize(target.getMaxPoolSize())));
    } catch (Throwable t) {
        logger.error(t.getMessage());
    }
}
Also used : ComboPooledDataSource(com.mchange.v2.c3p0.ComboPooledDataSource) C3p0Template(com.pamirs.attach.plugin.dynamic.template.C3p0Template) Attachment(com.pamirs.attach.plugin.dynamic.Attachment)

Aggregations

ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)2 Attachment (com.pamirs.attach.plugin.dynamic.Attachment)2 C3p0Template (com.pamirs.attach.plugin.dynamic.template.C3p0Template)2