APIdia Launch Partner
Top Inners Fields Constructors Methods
jdk.jpackage.internal.util

public Class RetryExecutor<T, E extends Exception>

extends Object
Class Inheritance
Static Imports
jdk.jpackage.internal.util.function.ThrowingConsumer.toConsumer

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
private class

Field Summary

Modifier and TypeField and Description
private int
private final Class<? extends E>
private ThrowingFunction<RetryExecutor.Context<RetryExecutor<T, E>>, T, E>
private Consumer<Duration>
private Duration
private Function<E, RuntimeException>

Constructor Summary

AccessConstructor and Description
public
RetryExecutor(Class<? extends E> exceptionType)

Method Summary

Modifier and TypeMethod and Description
public final Class<? extends E>
private ThrowingFunction<RetryExecutor.Context<RetryExecutor<T, E>>, T, E>
public T
public final T
public final RetryExecutor<T, E>
mutate(Consumer<RetryExecutor<T, E>> mutator)

public final RetryExecutor<T, E>
public RetryExecutor<T, E>
public RetryExecutor<T, E>
public RetryExecutor<T, E>
public final RetryExecutor<T, E>
public RetryExecutor<T, E>
public RetryExecutor<T, E>
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attemptsback to summary
private int attempts
exceptionTypeback to summary
private final Class<? extends E> exceptionType
executableback to summary
private ThrowingFunction<RetryExecutor.Context<RetryExecutor<T, E>>, T, E> executable
sleepFunctionback to summary
private Consumer<Duration> sleepFunction
timeoutback to summary
private Duration timeout
toUncheckedback to summary
private Function<E, RuntimeException> toUnchecked

Constructor Detail

RetryExecutorback to summary
public RetryExecutor(Class<? extends E> exceptionType)

Method Detail

exceptionTypeback to summary
public final Class<? extends E> exceptionType()
executableback to summary
private ThrowingFunction<RetryExecutor.Context<RetryExecutor<T, E>>, T, E> executable()
executeback to summary
public T execute() throws RetryExecutor:E
executeUncheckedback to summary
public final T executeUnchecked()
mutateback to summary
public final RetryExecutor<T, E> mutate(Consumer<RetryExecutor<T, E>> mutator)
setAttemptTimeoutback to summary
public final RetryExecutor<T, E> setAttemptTimeout(long v, TimeUnit unit)
setAttemptTimeoutback to summary
public RetryExecutor<T, E> setAttemptTimeout(Duration v)
setExceptionMapperback to summary
public RetryExecutor<T, E> setExceptionMapper(Function<E, RuntimeException> v)
setExecutableback to summary
public RetryExecutor<T, E> setExecutable(ThrowingFunction<RetryExecutor.Context<RetryExecutor<T, E>>, T, E> v)
setExecutableback to summary
public final RetryExecutor<T, E> setExecutable(ThrowingSupplier<T, E> v)
setMaxAttemptsCountback to summary
public RetryExecutor<T, E> setMaxAttemptsCount(int v)
setSleepFunctionback to summary
public RetryExecutor<T, E> setSleepFunction(Consumer<Duration> v)
sleepback to summary
private void sleep()
jdk.jpackage.internal.util back to summary

public Interface RetryExecutor.Context<T>

Known Direct Implementers
jdk.jpackage.internal.util.RetryExecutor.DefaultContext

Method Summary

Modifier and TypeMethod and Description
public int
public T
public boolean

Method Detail

attemptback to summary
public int attempt()
executorback to summary
public T executor()
isLastAttemptback to summary
public boolean isLastAttempt()
jdk.jpackage.internal.util back to summary

private final Class RetryExecutor.DefaultContext

extends Object
implements RetryExecutor.Context<RetryExecutor<T, E extends Exception>>, Iterator<Void>
Class Inheritance
All Implemented Interfaces
java.util.Iterator, jdk.jpackage.internal.util.RetryExecutor.Context

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
public RetryExecutor<T, E>
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public boolean
public Void
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attemptback to summary
private int attempt

Constructor Detail

DefaultContextback to summary
private DefaultContext()

Method Detail

attemptback to summary
public int attempt()

Implements jdk.jpackage.internal.util.RetryExecutor.Context.attempt.

Annotations
@Override
executorback to summary
public RetryExecutor<T, E> executor()

Implements jdk.jpackage.internal.util.RetryExecutor.Context.executor.

Annotations
@Override
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Annotations
@Override
isLastAttemptback to summary
public boolean isLastAttempt()

Implements jdk.jpackage.internal.util.RetryExecutor.Context.isLastAttempt.

Annotations
@Override
nextback to summary
public Void next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Annotations
@Override