Class AbsServiceLoader<S>
java.lang.Object
org.miaixz.bus.core.lang.loader.spi.AbsServiceLoader<S>
- Type Parameters:
S- 服务类型
- All Implemented Interfaces:
Iterable<S>,ServiceLoader<S>
- Direct Known Subclasses:
ListServiceLoader,MapServiceLoader
抽象服务加载器,提供包括路径前缀、服务类、类加载器、编码、安全相关持有
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Charsetprotected final ClassLoaderprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionAbsServiceLoader(String pathPrefix, Class<S> serviceClass, ClassLoader classLoader, Charset charset) 构造 -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.miaixz.bus.core.lang.loader.spi.ServiceLoader
getService, getServiceClass, getServiceNames, load, size
-
Field Details
-
pathPrefix
-
serviceClass
-
classLoader
-
charset
-
-
Constructor Details
-
AbsServiceLoader
public AbsServiceLoader(String pathPrefix, Class<S> serviceClass, ClassLoader classLoader, Charset charset) 构造- Parameters:
pathPrefix- 路径前缀serviceClass- 服务名称classLoader- 自定义类加载器,null表示使用默认当前的类加载器charset- 编码,默认UTF-8
-