public final class ServiceLoaderUtils extends Object
ServiceLoader相关工具ServiceLoader| 限定符和类型 | 方法和说明 |
|---|---|
static <T> List<T> |
load(Class<T> targetType)
加载Service
|
static <T> List<T> |
load(Class<T> targetType,
ClassLoader classLoader)
加载Service
|
static <T> List<T> |
loadQuietly(Class<T> targetType)
加载Service
|
static <T> List<T> |
loadQuietly(Class<T> targetType,
ClassLoader classLoader)
加载Service
|
public static <T> List<T> load(Class<T> targetType)
T - Service类型泛型targetType - Service类型ServiceConfigurationError - 加载失败时抛出此错误public static <T> List<T> load(Class<T> targetType, ClassLoader classLoader)
T - Service类型泛型targetType - Service类型classLoader - ClassLoader实例ServiceConfigurationError - 加载失败时抛出此错误public static <T> List<T> loadQuietly(Class<T> targetType)
T - Service类型泛型targetType - Service类型public static <T> List<T> loadQuietly(Class<T> targetType, ClassLoader classLoader)
T - Service类型泛型targetType - Service类型classLoader - ClassLoader实例Copyright © 2022. All rights reserved.