Class AbstractServiceLoader<S>
java.lang.Object
org.miaixz.bus.core.lang.loader.spi.AbstractServiceLoader<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 Charset字符集protected final ClassLoader类加载器protected final String路径前缀服务类 -
Constructor Summary
ConstructorsConstructorDescriptionAbstractServiceLoader(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
-
AbstractServiceLoader
public AbstractServiceLoader(String pathPrefix, Class<S> serviceClass, ClassLoader classLoader, Charset charset) 构造- Parameters:
pathPrefix- 路径前缀serviceClass- 服务名称classLoader- 自定义类加载器,null表示使用默认当前的类加载器charset- 编码,默认UTF-8
-