public static <T> T getProxy(SqlRetryHandler sqlRetryHandler, MultiDataSourceJdbcResource jdbcResourceHandler, T interfaceObject) {
    TransactionalRetryProxy<T> handler = new TransactionalRetryProxy<>(interfaceObject, sqlRetryHandler, jdbcResourceHandler);
    //noinspection unchecked
    return (T) Proxy.newProxyInstance(
        TransactionalRetryProxy.class.getClassLoader(),
        ClassUtils.getAllInterfaces(interfaceObject.getClass()).toArray(new Class[0]),
        handler);
  }
Gets the proxy interface for the given {@link TxnStore}.

@param sqlRetryHandler Responsible to re-execute the methods in case of failure.
@param interfaceObject The real object to proxy.
@return Returns the proxy object capable of retrying the failed calls automatically and transparently.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TransactionalRetryProxy.java