类 ServiceManager


  • public class ServiceManager
    extends java.lang.Object
    Nacos service manager for v2.
    作者:
    xiweng.yy
    • 字段详细资料

      • singletonRepository

        private final java.util.concurrent.ConcurrentHashMap<Service,​Service> singletonRepository
      • namespaceSingletonMaps

        private final java.util.concurrent.ConcurrentHashMap<java.lang.String,​java.util.Set<Service>> namespaceSingletonMaps
    • 构造器详细资料

      • ServiceManager

        private ServiceManager()
    • 方法详细资料

      • getSingletons

        public java.util.Set<Service> getSingletons​(java.lang.String namespace)
      • getSingleton

        public Service getSingleton​(Service service)
        Get singleton service. Put to manager if no singleton.
        参数:
        service - new service
        返回:
        if service is exist, return exist service, otherwise return new service
      • getSingletonIfExist

        public java.util.Optional<Service> getSingletonIfExist​(java.lang.String namespace,
                                                               java.lang.String group,
                                                               java.lang.String name)
        Get singleton service if Exist.
        参数:
        namespace - namespace of service
        group - group of service
        name - name of service
        返回:
        singleton service if exist, otherwise null optional
      • getSingletonIfExist

        public java.util.Optional<Service> getSingletonIfExist​(Service service)
        Get singleton service if Exist.
        参数:
        service - service template
        返回:
        singleton service if exist, otherwise null optional
      • getAllNamespaces

        public java.util.Set<java.lang.String> getAllNamespaces()
      • removeSingleton

        public Service removeSingleton​(Service service)
        Remove singleton service.
        参数:
        service - service need to remove
        返回:
        removed service
      • containSingleton

        public boolean containSingleton​(Service service)
      • size

        public int size()