类 NacosServiceLoader
- java.lang.Object
-
- com.alibaba.nacos.common.spi.NacosServiceLoader
-
public class NacosServiceLoader extends java.lang.ObjectNacos SPI Service Loader.- 作者:
- xiweng.yy
-
-
字段概要
字段 修饰符和类型 字段 说明 private static java.util.Map<java.lang.Class<?>,java.util.Collection<java.lang.Class<?>>>SERVICES
-
构造器概要
构造器 构造器 说明 NacosServiceLoader()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 private static <T> voidcacheServiceClass(java.lang.Class<T> service, T instance)static <T> java.util.Collection<T>load(java.lang.Class<T> service)Load service.private static java.lang.ObjectnewServiceInstance(java.lang.Class<?> clazz)static <T> java.util.Collection<T>newServiceInstances(java.lang.Class<T> service)New service instances.private static <T> java.util.Collection<T>newServiceInstancesFromCache(java.lang.Class<T> service)
-
-
-
方法详细资料
-
load
public static <T> java.util.Collection<T> load(java.lang.Class<T> service)
Load service.Load service by SPI and cache the classes for reducing cost when load second time.
- 类型参数:
T- type of service- 参数:
service- service class- 返回:
- service instances
-
cacheServiceClass
private static <T> void cacheServiceClass(java.lang.Class<T> service, T instance)
-
newServiceInstances
public static <T> java.util.Collection<T> newServiceInstances(java.lang.Class<T> service)
New service instances.- 类型参数:
T- type of service- 参数:
service- service class- 返回:
- service instances
-
newServiceInstancesFromCache
private static <T> java.util.Collection<T> newServiceInstancesFromCache(java.lang.Class<T> service)
-
newServiceInstance
private static java.lang.Object newServiceInstance(java.lang.Class<?> clazz)
-
-