From 0e53ee6712b5b4d7f1729f74669ad6665ba56127 Mon Sep 17 00:00:00 2001
From: Artem Vysochyn <artem.vysochyn@gmail.com>
Date: Sun, 22 Sep 2024 08:20:16 +0300
Subject: [PATCH 1/2] Removed Runners

---
 .../java/io/scalecube/runners/Runners.java    | 32 -------------------
 1 file changed, 32 deletions(-)
 delete mode 100644 src/main/java/io/scalecube/runners/Runners.java

diff --git a/src/main/java/io/scalecube/runners/Runners.java b/src/main/java/io/scalecube/runners/Runners.java
deleted file mode 100644
index 7a47054..0000000
--- a/src/main/java/io/scalecube/runners/Runners.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package io.scalecube.runners;
-
-import sun.misc.Signal;
-import sun.misc.SignalHandler;
-
-public final class Runners {
-
-  private Runners() {
-    // Do not instantiate
-  }
-
-  /**
-   * Listens to jvm signas SIGTERM and SIGINT and applies shutdown lambda function.
-   *
-   * @param runnable shutdown task
-   */
-  public static void onShutdown(Runnable runnable) {
-    SignalHandler handler = signal -> runnable.run();
-    Signal.handle(new Signal("INT"), handler);
-    Signal.handle(new Signal("TERM"), handler);
-  }
-
-  /**
-   * Utility method to simply check if current thread is interrupted. If it is, then {@code
-   * IllegalStateException} is being thrown.
-   */
-  public static void checkInterrupted() {
-    if (Thread.currentThread().isInterrupted()) {
-      throw new IllegalStateException("Unexpected interrupt");
-    }
-  }
-}

From c2a78f441e78f5b38f8e4ad4fbc98a352d657fb1 Mon Sep 17 00:00:00 2001
From: Artem Vysochyn <artem.vysochyn@gmail.com>
Date: Sun, 22 Sep 2024 08:42:56 +0300
Subject: [PATCH 2/2] Get rid of ServiceLoaderUtil

---
 .../io/scalecube/utils/ServiceLoaderUtil.java | 63 -------------------
 1 file changed, 63 deletions(-)
 delete mode 100644 src/main/java/io/scalecube/utils/ServiceLoaderUtil.java

diff --git a/src/main/java/io/scalecube/utils/ServiceLoaderUtil.java b/src/main/java/io/scalecube/utils/ServiceLoaderUtil.java
deleted file mode 100644
index 22dbd08..0000000
--- a/src/main/java/io/scalecube/utils/ServiceLoaderUtil.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package io.scalecube.utils;
-
-import java.util.Optional;
-import java.util.ServiceLoader;
-import java.util.function.Predicate;
-import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
-
-public final class ServiceLoaderUtil {
-
-  private ServiceLoaderUtil() {
-    // Do not instantiate
-  }
-
-  /**
-   * Finds the first implementation of the given service type and creates its instance.
-   *
-   * @param clazz service type
-   * @return the first implementation of the given service type
-   */
-  public static <T> Optional<T> findFirst(Class<T> clazz) {
-    ServiceLoader<T> load = ServiceLoader.load(clazz);
-    return StreamSupport.stream(load.spliterator(), false).findFirst();
-  }
-
-  /**
-   * Finds the first implementation of the given service type using the given predicate to filter
-   * out found service types and creates its instance.
-   *
-   * @param clazz service type
-   * @param predicate service type predicate
-   * @return the first implementation of the given service type
-   */
-  public static <T> Optional<T> findFirst(Class<T> clazz, Predicate<? super T> predicate) {
-    ServiceLoader<T> load = ServiceLoader.load(clazz);
-    Stream<T> stream = StreamSupport.stream(load.spliterator(), false);
-    return stream.filter(predicate).findFirst();
-  }
-
-  /**
-   * Finds all implementations of the given service type and creates their instances.
-   *
-   * @param clazz service type
-   * @return implementations' stream of the given service type
-   */
-  public static <T> Stream<T> findAll(Class<T> clazz) {
-    ServiceLoader<T> load = ServiceLoader.load(clazz);
-    return StreamSupport.stream(load.spliterator(), false);
-  }
-
-  /**
-   * Finds all implementations of the given service type using the given predicate to filter out
-   * found service types and creates their instances.
-   *
-   * @param clazz service type
-   * @param predicate service type predicate
-   * @return implementations' stream of the given service type
-   */
-  public static <T> Stream<T> findAll(Class<T> clazz, Predicate<? super T> predicate) {
-    ServiceLoader<T> load = ServiceLoader.load(clazz);
-    return StreamSupport.stream(load.spliterator(), false).filter(predicate);
-  }
-}