[aether-resolver] IJI-781 Create base classes for retries injection

(cherry picked from commit 4bbee1dddba0504bd2edb0a7915d66fdeae66fba)

IJ-MR-20326

GitOrigin-RevId: c2c0b8fd40a16689ef61f73135b2144a4cbc742d
This commit is contained in:
Vladislav Yaroshchuk
2021-12-31 04:20:05 +03:00
committed by intellij-monorepo-bot
parent 0f646dd473
commit bcc925993f
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.maven.aether;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
/**
* Common retry interface for aether dependency resolver.
*/
@FunctionalInterface
public interface Retry {
/**
* @param supplier Supplies that does some possibly throwing work.
* @param logger Messages logger.
* @param <R> Supplier result type.
* @return Result from supplier.
* @throws Exception An error the job thrown if attempts limit exceeded.
*/
<R> R retry(@NotNull ThrowingSupplier<? extends R> supplier, @NotNull Logger logger) throws Exception;
}

View File

@@ -0,0 +1,7 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.idea.maven.aether;
@FunctionalInterface
interface ThrowingSupplier<R> {
R get() throws Exception;
}