org.apache.camel.processor.aggregate.jdbc
Class DefaultJdbcOptimisticLockingExceptionMapper

java.lang.Object
  extended by org.apache.camel.processor.aggregate.jdbc.DefaultJdbcOptimisticLockingExceptionMapper
All Implemented Interfaces:
JdbcOptimisticLockingExceptionMapper

public class DefaultJdbcOptimisticLockingExceptionMapper
extends Object
implements JdbcOptimisticLockingExceptionMapper

A default JdbcOptimisticLockingExceptionMapper which checks the caused exception (and its nested) whether any of them is a constraint violation exception.

The following check is done:

In addition you can add FQN classnames using the addClassName(String) or setClassNames(java.util.Set) methods. These class names is also matched. This allows to add vendor specific exception classes.


Constructor Summary
DefaultJdbcOptimisticLockingExceptionMapper()
           
 
Method Summary
 void addClassName(String name)
           
static boolean isConstraintViolation(SQLException e)
           
 boolean isOptimisticLocking(Exception cause)
          Checks the caused exception whether its to be considered as an JdbcAggregationRepository.OptimisticLockingException.
 void setClassNames(Set<String> names)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJdbcOptimisticLockingExceptionMapper

public DefaultJdbcOptimisticLockingExceptionMapper()
Method Detail

isOptimisticLocking

public boolean isOptimisticLocking(Exception cause)
Description copied from interface: JdbcOptimisticLockingExceptionMapper
Checks the caused exception whether its to be considered as an JdbcAggregationRepository.OptimisticLockingException.

Specified by:
isOptimisticLocking in interface JdbcOptimisticLockingExceptionMapper
Parameters:
cause - the caused exception
Returns:
true if the caused should be rethrown as an JdbcAggregationRepository.OptimisticLockingException.

isConstraintViolation

public static boolean isConstraintViolation(SQLException e)

addClassName

public void addClassName(String name)

setClassNames

public void setClassNames(Set<String> names)


Apache Camel