Package com.atlassian.jira.ofbiz
Class ChainedSQLInterceptor
java.lang.Object
com.atlassian.jira.ofbiz.ChainedSQLInterceptor
- All Implemented Interfaces:
org.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptor
,org.ofbiz.core.entity.jdbc.interceptors.SQLInterceptor
public class ChainedSQLInterceptor
extends Object
implements org.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptor
A
SQLInterceptor
that can chain together multiple
SQLInterceptors.
It will call them in an enveloping order, and any runtime exceptions thrown by one of the chained interceptors will be caught and logged but otherwise ignored.
For example, if we add 'one' and 'two', then it will call:
one.beforeExecution(...) two.beforeExecution(...) two.afterSuccessfulExecution(...) one.afterSuccessfulExecution(...)
- Since:
- v4.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterSuccessfulExecution
(String sqlString, List<String> parameterValues, Statement statement, ResultSet resultSet, int rowsUpdated) void
beforeExecution
(String sqlString, List<String> parameterValues, Statement statement) void
onConnectionReplaced
(Connection connection, org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState) void
onConnectionTaken
(Connection connection, org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState) void
onException
(String sqlString, List<String> parameterValues, Statement statement, SQLException sqlException) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ofbiz.core.entity.jdbc.interceptors.SQLInterceptor
afterSuccessfulExecution, beforeExecution, onException
-
Method Details
-
onConnectionTaken
public void onConnectionTaken(Connection connection, org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState) - Specified by:
onConnectionTaken
in interfaceorg.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptor
-
onConnectionReplaced
public void onConnectionReplaced(Connection connection, org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState) - Specified by:
onConnectionReplaced
in interfaceorg.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptor
-
beforeExecution
- Specified by:
beforeExecution
in interfaceorg.ofbiz.core.entity.jdbc.interceptors.SQLInterceptor
-
afterSuccessfulExecution
public void afterSuccessfulExecution(String sqlString, List<String> parameterValues, Statement statement, ResultSet resultSet, int rowsUpdated) - Specified by:
afterSuccessfulExecution
in interfaceorg.ofbiz.core.entity.jdbc.interceptors.SQLInterceptor
-
onException
public void onException(String sqlString, List<String> parameterValues, Statement statement, SQLException sqlException) - Specified by:
onException
in interfaceorg.ofbiz.core.entity.jdbc.interceptors.SQLInterceptor
-