Search in sources :

Example 26 with Registry

use of org.apache.dubbo.registry.Registry in project dubbo by alibaba.

the class MultipleRegistry method initServiceRegistry.

protected void initServiceRegistry(URL url, Map<String, Registry> registryMap) {
    origServiceRegistryURLs = url.getParameter(REGISTRY_FOR_SERVICE, new ArrayList<String>());
    effectServiceRegistryURLs = this.filterServiceRegistry(origServiceRegistryURLs);
    for (String tmpUrl : effectServiceRegistryURLs) {
        if (registryMap.get(tmpUrl) != null) {
            serviceRegistries.put(tmpUrl, registryMap.get(tmpUrl));
            continue;
        }
        Registry registry = getRegistry(URL.valueOf(tmpUrl));
        registryMap.put(tmpUrl, registry);
        serviceRegistries.put(tmpUrl, registry);
    }
}
Also used : ArrayList(java.util.ArrayList) AbstractRegistry(org.apache.dubbo.registry.support.AbstractRegistry) Registry(org.apache.dubbo.registry.Registry)

Aggregations

Registry (org.apache.dubbo.registry.Registry)26 Test (org.junit.jupiter.api.Test)9 AbstractRegistry (org.apache.dubbo.registry.support.AbstractRegistry)8 URL (org.apache.dubbo.common.URL)7 ArrayList (java.util.ArrayList)3 Status (org.apache.dubbo.common.status.Status)3 ProviderModel (org.apache.dubbo.rpc.model.ProviderModel)3 RegistryStatusChecker (org.apache.dubbo.registry.status.RegistryStatusChecker)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 ConfigurationException (org.apache.dubbo.admin.common.exception.ConfigurationException)1 QOS_HOST (org.apache.dubbo.common.constants.QosConstants.QOS_HOST)1 QOS_PORT (org.apache.dubbo.common.constants.QosConstants.QOS_PORT)1 ApplicationConfig (org.apache.dubbo.config.ApplicationConfig)1 RegistryConfig (org.apache.dubbo.config.RegistryConfig)1 ServiceConfig (org.apache.dubbo.config.ServiceConfig)1 DubboBootstrap (org.apache.dubbo.config.bootstrap.DubboBootstrap)1 DemoService (org.apache.dubbo.config.spring.api.DemoService)1 MockRegistry (org.apache.dubbo.config.spring.registry.MockRegistry)1 NotifyListener (org.apache.dubbo.registry.NotifyListener)1