类 ServiceHelper
java.lang.Object
com.ajaxjs.mcp.message.ServiceHelper
Utility wrapper around
ServiceLoader.load().-
方法概要
修饰符和类型方法说明static <T> Collection<T> loadFactories(Class<T> clazz) Load all the services of a given type.static <T> Collection<T> loadFactories(Class<T> clazz, ClassLoader classLoader) Load all the services of a given type.
-
方法详细资料
-
loadFactories
Load all the services of a given type.- 类型参数:
T- the type of service- 参数:
clazz- the type of service- 返回:
- the list of services, empty if none
-
loadFactories
Load all the services of a given type.Utility mechanism around
ServiceLoader.load()- If classloader is
null, will tryServiceLoader.load(clazz) - If classloader is not
null, will tryServiceLoader.load(clazz, classloader)
If the above return nothing, will fall back to
ServiceLoader.load(clazz, $this class loader$)- 类型参数:
T- the type of service- 参数:
clazz- the type of serviceclassLoader- the classloader to use, may be null- 返回:
- the list of services, empty if none
- If classloader is
-