接口 ServiceNameMapping

  • 所有超级接口:
    org.apache.dubbo.rpc.service.Destroyable
    所有已知实现类:
    AbstractServiceNameMapping

    @SPI(value="metadata",
         scope=APPLICATION)
    public interface ServiceNameMapping
    extends org.apache.dubbo.rpc.service.Destroyable
    This will interact with remote metadata center to find the interface-app mapping and will cache the data locally. Call variants of getCachedMapping() methods whenever need to use the mapping data.
    • 字段详细资料

    • 方法详细资料

      • map

        boolean map​(org.apache.dubbo.common.URL url)
        Map the specified Dubbo service interface, group, version and protocol to current Dubbo service name
      • buildMappingKey

        static String buildMappingKey​(org.apache.dubbo.common.URL url)
      • buildGroup

        static String buildGroup​(String serviceInterface)
      • initInterfaceAppMapping

        void initInterfaceAppMapping​(org.apache.dubbo.common.URL subscribedURL)
        Init mapping from local storage and url parameter.
      • getAndListen

        Set<String> getAndListen​(org.apache.dubbo.common.URL registryURL,
                                 org.apache.dubbo.common.URL subscribedURL,
                                 MappingListener listener)
        Get the latest mapping result from remote center and register listener at the same time to get notified once mapping changes.
        参数:
        listener - listener that will be notified on mapping change
        返回:
        the latest mapping result from remote center
      • putCachedMapping

        void putCachedMapping​(String serviceKey,
                              Set<String> apps)
      • getCachedMapping

        Set<String> getCachedMapping​(org.apache.dubbo.common.URL consumerURL)
      • getRemoteMapping

        Set<String> getRemoteMapping​(org.apache.dubbo.common.URL consumerURL)
      • removeCachedMapping

        Set<String> removeCachedMapping​(String serviceKey)