类 NacosServiceLoader


  • public class NacosServiceLoader
    extends java.lang.Object
    Nacos SPI Service Loader.
    作者:
    xiweng.yy
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      private static java.util.Map<java.lang.Class<?>,​java.util.Collection<java.lang.Class<?>>> SERVICES  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      private static <T> void cacheServiceClass​(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.Object newServiceInstance​(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)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • SERVICES

        private static final java.util.Map<java.lang.Class<?>,​java.util.Collection<java.lang.Class<?>>> SERVICES
    • 构造器详细资料

      • NacosServiceLoader

        public NacosServiceLoader()
    • 方法详细资料

      • 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)