类 ServiceLoaderUtils

java.lang.Object
spring.turbo.util.ServiceLoaderUtils

public final class ServiceLoaderUtils extends Object
ServiceLoader相关工具
从以下版本开始:
1.0.0
作者:
应卓
另请参阅:
  • 方法详细资料

    • load

      public static <T> List<T> load(Class<T> targetType)
      加载Service
      类型参数:
      T - Service类型泛型
      参数:
      targetType - Service类型
      返回:
      Service实例
      抛出:
      ServiceConfigurationError - 加载失败时抛出此错误
    • load

      public static <T> List<T> load(Class<T> targetType, @Nullable ClassLoader classLoader)
      加载Service
      类型参数:
      T - Service类型泛型
      参数:
      targetType - Service类型
      classLoader - ClassLoader实例
      返回:
      Service实例
      抛出:
      ServiceConfigurationError - 加载失败时抛出此错误
    • loadQuietly

      public static <T> List<T> loadQuietly(Class<T> targetType)
      加载Service
      类型参数:
      T - Service类型泛型
      参数:
      targetType - Service类型
      返回:
      Service实例
    • loadQuietly

      public static <T> List<T> loadQuietly(Class<T> targetType, @Nullable ClassLoader classLoader)
      加载Service
      类型参数:
      T - Service类型泛型
      参数:
      targetType - Service类型
      classLoader - ClassLoader实例
      返回:
      Service实例