01: /*
02: * Created on Sep 21, 2004
03: */
04: package net.sourceforge.orbroker.exception;
05:
06: import java.sql.SQLException;
07:
08: /**
09: * Interface to interrogate an {@link java.sql.SQLException}.
10: * @author Nils Kilden-Pedersen
11: * @see net.sourceforge.orbroker.Broker#setExceptionEvaluator(ExceptionEvaluator)
12: */
13: public interface ExceptionEvaluator {
14:
15: /**
16: * Is SQLException a constraint violation?
17: * @param source Exception source
18: * @return true, if SQLException is caused by a database constraint.
19: */
20: public boolean isConstraint(SQLException source);
21:
22: /**
23: * Is SQLException a deadlock?
24: * @param source Exception source
25: * @return true, if SQLException is caused by a dead lock.
26: */
27: public boolean isDeadlock(SQLException source);
28:
29: /**
30: * Is SQLException caused by stale connection?
31: * @param source Exception source
32: * @return true, if SQLException is caused by a stale connection.
33: */
34: public boolean isStaleConnection(SQLException source);
35: }
|