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
  • Method Details

    • onConnectionTaken

      public void onConnectionTaken(Connection connection, org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState)
      Specified by:
      onConnectionTaken in interface org.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 interface org.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptor
    • beforeExecution

      public void beforeExecution(String sqlString, List<String> parameterValues, Statement statement)
      Specified by:
      beforeExecution in interface org.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 interface org.ofbiz.core.entity.jdbc.interceptors.SQLInterceptor
    • onException

      public void onException(String sqlString, List<String> parameterValues, Statement statement, SQLException sqlException)
      Specified by:
      onException in interface org.ofbiz.core.entity.jdbc.interceptors.SQLInterceptor