use of com.google.gerrit.extensions.persistence.DataSourceInterceptor in project gerrit by GerritCodeReview.
the class DataSourceProvider method intercept.
private DataSource intercept(String interceptor, DataSource ds) {
if (interceptor == null) {
return ds;
}
try {
Constructor<?> c = Class.forName(interceptor).getConstructor();
DataSourceInterceptor datasourceInterceptor = (DataSourceInterceptor) c.newInstance();
return datasourceInterceptor.intercept("reviewDb", ds);
} catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new ProvisionException("Cannot intercept datasource", e);
}
}
Aggregations