com.codahale.metrics.jdbi3.strategies.DelegatingStatementNameStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-jdbi3 Show documentation
Show all versions of metrics-jdbi3 Show documentation
Provides instrumentation of Jdbi3 data access objects
The newest version!
package com.codahale.metrics.jdbi3.strategies;
import org.jdbi.v3.core.statement.StatementContext;
import java.util.Arrays;
import java.util.List;
public abstract class DelegatingStatementNameStrategy implements StatementNameStrategy {
/**
* Unknown SQL.
*/
private static final String UNKNOWN_SQL = "sql.unknown";
private final List strategies;
protected DelegatingStatementNameStrategy(StatementNameStrategy... strategies) {
this.strategies = Arrays.asList(strategies);
}
@Override
public String getStatementName(StatementContext statementContext) {
for (StatementNameStrategy strategy : strategies) {
final String statementName = strategy.getStatementName(statementContext);
if (statementName != null) {
return statementName;
}
}
return UNKNOWN_SQL;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy