Skip to content

Commit b8ed13c

Browse files
committed
code cleanup
1 parent 447eb5a commit b8ed13c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/subscription/ConcurrentSubscriptionHandlerFactory.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dev.dsf.bpe.subscription;
22

33
import java.util.Objects;
4-
import java.util.concurrent.BlockingQueue;
54
import java.util.concurrent.LinkedBlockingQueue;
65
import java.util.concurrent.ThreadPoolExecutor;
76
import java.util.concurrent.TimeUnit;
@@ -19,8 +18,6 @@ public class ConcurrentSubscriptionHandlerFactory<R extends Resource>
1918
private static final Logger logger = LoggerFactory.getLogger(ConcurrentSubscriptionHandlerFactory.class);
2019

2120
private final SubscriptionHandlerFactory<R> delegate;
22-
23-
private final BlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
2421
private final ThreadPoolExecutor executor;
2522

2623
/**
@@ -34,11 +31,11 @@ public ConcurrentSubscriptionHandlerFactory(int corePoolSize, SubscriptionHandle
3431
if (corePoolSize <= 0)
3532
throw new IllegalArgumentException("corePoolSize <= 0");
3633

37-
executor = new ThreadPoolExecutor(corePoolSize, corePoolSize, 30, TimeUnit.MINUTES, queue,
34+
this.delegate = delegate;
35+
36+
executor = new ThreadPoolExecutor(corePoolSize, corePoolSize, 30, TimeUnit.MINUTES, new LinkedBlockingQueue<>(),
3837
(r, executor) -> logger.error("Unable to handle Task - execution rejected"));
3938
executor.allowCoreThreadTimeOut(true);
40-
41-
this.delegate = delegate;
4239
}
4340

4441
@Override

0 commit comments

Comments
 (0)