- final ThreadFactory factory = new ThreadFactoryBuilder()
- .setDaemon(true)
- .setNameFormat("md-sal-binding-notification-%d")
- .build();
-
- final ThreadPoolExecutor executor = new ThreadPoolExecutor(CORE_NOTIFICATION_THREADS, MAX_NOTIFICATION_THREADS,
- NOTIFICATION_THREAD_LIFE, TimeUnit.SECONDS, queue, factory,
- // if the max threads are met, then it will raise a rejectedExecution. We then push to the queue.
- (r, executor1) -> {
- try {
- executor1.getQueue().put(r);
- } catch (final InterruptedException e) {
- throw new RejectedExecutionException("Interrupted while waiting on the queue", e);
- }
- });
+ final ThreadFactory factory = new ThreadFactoryBuilder().setDaemon(true)
+ .setNameFormat("md-sal-binding-notification-%d").build();
+
+ final ThreadPoolExecutor executor = new ThreadPoolExecutor(CORE_NOTIFICATION_THREADS,
+ MAX_NOTIFICATION_THREADS, NOTIFICATION_THREAD_LIFE, TimeUnit.SECONDS, queue, factory,
+ // if the max threads are met, then it will raise a rejectedExecution. We then push to the queue.
+ (runnable, executor1) -> {
+ try {
+ executor1.getQueue().put(runnable);
+ } catch (final InterruptedException e) {
+ throw new RejectedExecutionException("Interrupted while waiting on the queue", e);
+ }
+ });