Java Code Examples for org.apache.dubbo.common.URL#getServiceKey()

The following examples show how to use org.apache.dubbo.common.URL#getServiceKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DubboServiceMetadataRepository.java    From spring-cloud-alibaba with Apache License 2.0 5 votes vote down vote up
/**
 * Remove the metadata and initialized service of Dubbo Services if no there is no
 * service instance.
 * @param serviceName the service name
 * @param url the meta service url
 */
public void removeMetadataAndInitializedService(String serviceName, URL url) {
	synchronized (monitor) {
		initializedServices.remove(serviceName);
		dubboRestServiceMetadataRepository.remove(serviceName);
		// fix #1260 if the subscribedDubboMetadataServiceURLs removed fail,old meta
		// information will be retained
		if (DubboMetadataService.class.getName().equals(url.getServiceInterface())) {
			String serviceKey = url.getServiceKey();
			subscribedDubboMetadataServiceURLs.remove(serviceKey);
		}

	}
}
 
Example 2
Source File: DubboServiceMetadataRepository.java    From spring-cloud-alibaba with Apache License 2.0 5 votes vote down vote up
public void unexportURL(URL url) {
	String key = url.getServiceKey();
	// NPE issue :
	// https://github.com/spring-cloud-incubator/spring-cloud-alibaba/issues/591
	List<URL> urls = allExportedURLs.get(key);
	if (!isEmpty(urls)) {
		urls.remove(url);
		allExportedURLs.addAll(key, urls);
	}
}
 
Example 3
Source File: DubboServiceMetadataRepository.java    From spring-cloud-alibaba with Apache License 2.0 4 votes vote down vote up
private void initSubscribedDubboMetadataServiceURL(URL dubboMetadataServiceURL) {
	// add subscriptions
	String serviceKey = dubboMetadataServiceURL.getServiceKey();
	subscribedDubboMetadataServiceURLs.add(serviceKey, dubboMetadataServiceURL);
}