use of com.navercorp.pinpoint.plugin.commons.dbcp.DbcpDataSourceMonitor in project pinpoint by naver.
the class DataSourceConstructorInterceptor method after.
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
if (!InterceptorUtils.isSuccess(throwable)) {
return;
}
final BasicDataSource basicDataSource = getBasicDatasource(target);
if (basicDataSource instanceof DataSourceMonitorAccessor) {
DbcpDataSourceMonitor dataSourceMonitor = new DbcpDataSourceMonitor(basicDataSource);
dataSourceMonitorRegistry.register(dataSourceMonitor);
((DataSourceMonitorAccessor) basicDataSource)._$PINPOINT$_setDataSourceMonitor(dataSourceMonitor);
}
}
use of com.navercorp.pinpoint.plugin.commons.dbcp.DbcpDataSourceMonitor in project pinpoint by naver.
the class DataSourceCloseInterceptor method before.
@Override
public void before(Object target, Object[] args) {
if (target instanceof DataSourceMonitorAccessor) {
final DataSourceMonitorAccessor dataSourceMonitorAccessor = (DataSourceMonitorAccessor) target;
final DbcpDataSourceMonitor dataSourceMonitor = dataSourceMonitorAccessor._$PINPOINT$_getDataSourceMonitor();
if (dataSourceMonitor != null) {
dataSourceMonitorAccessor._$PINPOINT$_setDataSourceMonitor(null);
dataSourceMonitor.close();
dataSourceMonitorRegistry.unregister(dataSourceMonitor);
}
}
}
use of com.navercorp.pinpoint.plugin.commons.dbcp.DbcpDataSourceMonitor in project pinpoint by pinpoint-apm.
the class DataSourceConstructorInterceptor method after.
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
if (!InterceptorUtils.isSuccess(throwable)) {
return;
}
final BasicDataSource basicDataSource = getBasicDatasource(target);
if (basicDataSource instanceof DataSourceMonitorAccessor) {
DbcpDataSourceMonitor dataSourceMonitor = new DbcpDataSourceMonitor(basicDataSource);
dataSourceMonitorRegistry.register(dataSourceMonitor);
((DataSourceMonitorAccessor) basicDataSource)._$PINPOINT$_setDataSourceMonitor(dataSourceMonitor);
}
}
use of com.navercorp.pinpoint.plugin.commons.dbcp.DbcpDataSourceMonitor in project pinpoint by pinpoint-apm.
the class DataSourceCloseInterceptor method before.
@Override
public void before(Object target, Object[] args) {
if (target instanceof DataSourceMonitorAccessor) {
final DataSourceMonitorAccessor dataSourceMonitorAccessor = (DataSourceMonitorAccessor) target;
final DbcpDataSourceMonitor dataSourceMonitor = dataSourceMonitorAccessor._$PINPOINT$_getDataSourceMonitor();
if (dataSourceMonitor != null) {
dataSourceMonitorAccessor._$PINPOINT$_setDataSourceMonitor(null);
dataSourceMonitor.close();
dataSourceMonitorRegistry.unregister(dataSourceMonitor);
}
}
}
Aggregations