Having expanded the once-simple ConnectionTester interface to support both user-specified queries and return of root cause Exceptions (via an out-param), this interface has grown unnecessarily complex.
If you wish to implement a custom Connection tester, here is the simple way to do it
com.mchange.v2.c3p0.AbstractConnectionTester public int activeCheckConnection(Connection c, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)public int statusOnException(Connection c, Throwable t, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)preferredTestQuery and
rootCauseOutParamHolder to be null.Parameter rootCauseOutParamHolder is an optional parameter, which if supplied, will be a Throwable array whose size
it at least one. If a Connection test fails because of some Exception, the Connection tester may set this Exception as the
zero-th element of the array to provide information about why and how the test failed.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract int | activeCheckConnection(Connection c, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)
Redeclares com. Override, but remember that |
| public int | |
| public int | activeCheckConnection(Connection c, Throwable[] rootCauseOutParamHolder)
Implements com.
|
| public int | activeCheckConnection(Connection c, String preferredTestQuery)
Implements com.
|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Implements com. Indicates whether some other object is "equal to" this one. |
| public int | hashCode()
Overrides java. Implements com. Returns a hash code value for this object. |
| public abstract int | statusOnException(Connection c, Throwable t, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)
Redeclares com. Override, but remember that |
| public int | |
| public int | statusOnException(Connection c, Throwable t, Throwable[] rootCauseOutParamHolder)
Implements com.
|
| public int | statusOnException(Connection c, Throwable t, String preferredTestQuery)
Implements com.
|
| AbstractConnectionTester | back to summary |
|---|---|
| public AbstractConnectionTester() | |
| activeCheckConnection | back to summary |
|---|---|
| public abstract int activeCheckConnection(Connection c, String preferredTestQuery, Throwable[] rootCauseOutParamHolder) Redeclares com. Override, but remember that | |
| activeCheckConnection | back to summary |
|---|---|
| public int activeCheckConnection(Connection c) Implements com. | |
| activeCheckConnection | back to summary |
|---|---|
| public int activeCheckConnection(Connection c, Throwable[] rootCauseOutParamHolder) Implements com. | |
| activeCheckConnection | back to summary |
|---|---|
| public int activeCheckConnection(Connection c, String preferredTestQuery) Implements com. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements com. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements com. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| statusOnException | back to summary |
|---|---|
| public abstract int statusOnException(Connection c, Throwable t, String preferredTestQuery, Throwable[] rootCauseOutParamHolder) Redeclares com. Override, but remember that | |
| statusOnException | back to summary |
|---|---|
| public int statusOnException(Connection c, Throwable t) Implements com. | |
| statusOnException | back to summary |
|---|---|
| public int statusOnException(Connection c, Throwable t, Throwable[] rootCauseOutParamHolder) Implements com. | |
| statusOnException | back to summary |
|---|---|
| public int statusOnException(Connection c, Throwable t, String preferredTestQuery) Implements com. | |