* Interceptor class that we are looking for
* @return Instance of <code>clazz</code>
*/
private static <T extends JdbcInterceptor> T findInterceptor(Object proxy,
Class<T> clazz) {
JdbcInterceptor interceptor = (JdbcInterceptor) Proxy
.getInvocationHandler(proxy);
while (interceptor != null) {
if (clazz.isInstance(interceptor)) {
return clazz.cast(interceptor);
}
interceptor = interceptor.getNext();
}
return null;
}