Search in sources :

Example 1 with NoOpServiceMapping

use of org.apache.dubbo.admin.registry.mapping.impl.NoOpServiceMapping in project incubator-dubbo-ops by apache.

the class ConfigCenter method getServiceMapping.

@Bean
@DependsOn("metaDataCollector")
ServiceMapping getServiceMapping(ServiceDiscovery serviceDiscovery, InstanceRegistryCache instanceRegistryCache) {
    ServiceMapping serviceMapping = new NoOpServiceMapping();
    if (metadataUrl == null) {
        return serviceMapping;
    }
    MappingListener mappingListener = new AdminMappingListener(serviceDiscovery, instanceRegistryCache);
    serviceMapping = ExtensionLoader.getExtensionLoader(ServiceMapping.class).getExtension(metadataUrl.getProtocol());
    serviceMapping.addMappingListener(mappingListener);
    serviceMapping.init(metadataUrl);
    return serviceMapping;
}
Also used : NoOpServiceMapping(org.apache.dubbo.admin.registry.mapping.impl.NoOpServiceMapping) ServiceMapping(org.apache.dubbo.admin.registry.mapping.ServiceMapping) NoOpServiceMapping(org.apache.dubbo.admin.registry.mapping.impl.NoOpServiceMapping) AdminMappingListener(org.apache.dubbo.admin.registry.mapping.AdminMappingListener) AdminMappingListener(org.apache.dubbo.admin.registry.mapping.AdminMappingListener) MappingListener(org.apache.dubbo.metadata.MappingListener) DependsOn(org.springframework.context.annotation.DependsOn) Bean(org.springframework.context.annotation.Bean)

Aggregations

AdminMappingListener (org.apache.dubbo.admin.registry.mapping.AdminMappingListener)1 ServiceMapping (org.apache.dubbo.admin.registry.mapping.ServiceMapping)1 NoOpServiceMapping (org.apache.dubbo.admin.registry.mapping.impl.NoOpServiceMapping)1 MappingListener (org.apache.dubbo.metadata.MappingListener)1 Bean (org.springframework.context.annotation.Bean)1 DependsOn (org.springframework.context.annotation.DependsOn)1