Update pom.xml and BlockingOnFullQueueExecutorServiceDecorator.java
This commit is contained in:
parent
4ee7c8c2a4
commit
ac166bfba9
15
pom.xml
15
pom.xml
@ -7,7 +7,7 @@
|
||||
|
||||
<artifactId>common-utils</artifactId>
|
||||
<groupId>org.warp</groupId>
|
||||
<version>1.0.8</version>
|
||||
<version>1.0.9</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@ -41,7 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<version>5.7.0</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -50,11 +50,6 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>19.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
@ -76,6 +71,12 @@
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>20.1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
@ -10,7 +10,6 @@ import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Supplier;
|
||||
import javax.annotation.Nonnull;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -18,17 +17,17 @@ public class BlockingOnFullQueueExecutorServiceDecorator extends ExecutorService
|
||||
|
||||
private volatile boolean ignoreTaskLimit;
|
||||
|
||||
@Nonnull
|
||||
@NotNull
|
||||
private final Duration timeout;
|
||||
|
||||
private final int maximumTaskNumber;
|
||||
|
||||
@Nonnull
|
||||
@NotNull
|
||||
private final Supplier<Integer> queueSizeSupplier;
|
||||
|
||||
private final @Nullable BiConsumer<Boolean, Integer> queueSizeStatus;
|
||||
|
||||
public BlockingOnFullQueueExecutorServiceDecorator(@Nonnull final ExecutorService executor, final int maximumTaskNumber, @Nonnull final Duration maximumTimeout, @Nonnull Supplier<Integer> queueSizeSupplier, @Nullable BiConsumer<Boolean, Integer> queueSizeStatus) {
|
||||
public BlockingOnFullQueueExecutorServiceDecorator(@NotNull final ExecutorService executor, final int maximumTaskNumber, @NotNull final Duration maximumTimeout, @NotNull Supplier<Integer> queueSizeSupplier, @Nullable BiConsumer<Boolean, Integer> queueSizeStatus) {
|
||||
super(executor);
|
||||
if (maximumTaskNumber < 0) {
|
||||
throw new IllegalArgumentException(String.format("At least zero tasks must be permitted, not '%d'", maximumTaskNumber));
|
||||
@ -44,7 +43,7 @@ public class BlockingOnFullQueueExecutorServiceDecorator extends ExecutorService
|
||||
this.queueSizeStatus = queueSizeStatus;
|
||||
}
|
||||
|
||||
public BlockingOnFullQueueExecutorServiceDecorator(@Nonnull final ExecutorService executor, final int maximumTaskNumber, @Nonnull final Duration maximumTimeout, @Nonnull Supplier<Integer> queueSizeSupplier) {
|
||||
public BlockingOnFullQueueExecutorServiceDecorator(@NotNull final ExecutorService executor, final int maximumTaskNumber, @NotNull final Duration maximumTimeout, @NotNull Supplier<Integer> queueSizeSupplier) {
|
||||
this(executor, maximumTaskNumber, maximumTimeout, queueSizeSupplier, null);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user