mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[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:
committed by
intellij-monorepo-bot
parent
0f646dd473
commit
bcc925993f
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user