use of com.navercorp.pinpoint.plugin.commons.dbcp2.Dbcp2DataSourceMonitor in project pinpoint by naver.
the class DataSourceCloseInterceptor method before.
@Override
public void before(Object target, Object[] args) {
if ((target instanceof DataSourceMonitorAccessor)) {
Dbcp2DataSourceMonitor dataSourceMonitor = ((DataSourceMonitorAccessor) target)._$PINPOINT$_getDataSourceMonitor();
if (dataSourceMonitor != null) {
((DataSourceMonitorAccessor) target)._$PINPOINT$_setDataSourceMonitor(null);
dataSourceMonitor.close();
dataSourceMonitorRegistry.unregister(dataSourceMonitor);
}
}
}
use of com.navercorp.pinpoint.plugin.commons.dbcp2.Dbcp2DataSourceMonitor 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;
}
if ((target instanceof DataSourceMonitorAccessor) && (target instanceof BasicDataSource)) {
Dbcp2DataSourceMonitor dbcpDataSourceMonitor = new Dbcp2DataSourceMonitor((BasicDataSource) target);
dataSourceMonitorRegistry.register(dbcpDataSourceMonitor);
((DataSourceMonitorAccessor) target)._$PINPOINT$_setDataSourceMonitor(dbcpDataSourceMonitor);
}
}
Aggregations