当前位置: 首页>>代码示例>>Java>>正文


Java SyncUtils类代码示例

本文整理汇总了Java中com.alibaba.dubbo.governance.sync.util.SyncUtils的典型用法代码示例。如果您正苦于以下问题:Java SyncUtils类的具体用法?Java SyncUtils怎么用?Java SyncUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SyncUtils类属于com.alibaba.dubbo.governance.sync.util包,在下文中一共展示了SyncUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findProviderUrl

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Pair<Long, URL> findProviderUrl(String service, String address) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
    filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);

    Map<Long, URL> ret = SyncUtils.filterFromCategory(getRegistryCache(), filter);
    if (ret.isEmpty()) {
        return null;
    } else {
        Long key = ret.entrySet().iterator().next().getKey();
        return new Pair<Long, URL>(key, ret.get(key));
    }
}
 
开发者ID:l1325169021,项目名称:github-test,代码行数:14,代码来源:ProviderServiceImpl.java

示例2: findRouteUrl

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findRouteUrl(String service, String address, boolean force) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.ROUTERS_CATEGORY);
    if (service != null && service.length() > 0) {
    	filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
    }
    if (address != null && address.length() > 0) {
    	filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
    }
    if (force) {
    	filter.put("force", "true");
    }
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:flychao88,项目名称:dubbocloud,代码行数:15,代码来源:RouteServiceImpl.java

示例3: findProviderUrlByService

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findProviderUrlByService(String service) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
    filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
    
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:8,代码来源:ProviderServiceImpl.java

示例4: findRouteUrl

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findRouteUrl(String service, String address, boolean force) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.ROUTERS_CATEGORY);
    if (service != null && service.length() > 0) {
        filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
    }
    if (address != null && address.length() > 0) {
        filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
    }
    if (force) {
        filter.put("force", "true");
    }
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:l1325169021,项目名称:github-test,代码行数:15,代码来源:RouteServiceImpl.java

示例5: findProviderUrl

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Pair<Long, URL> findProviderUrl(String service, String address) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
    filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
    
    Map<Long, URL> ret = SyncUtils.filterFromCategory(getRegistryCache(), filter);
    if(ret.isEmpty()) {
        return null;
    }
    else { 
        Long key = ret.entrySet().iterator().next().getKey();
        return new Pair<Long, URL>(key, ret.get(key));
    }
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:15,代码来源:ProviderServiceImpl.java

示例6: findConsumerUrlByApplication

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findConsumerUrlByApplication(String application) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
    filter.put(Constants.APPLICATION_KEY, application);
    
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:yunhaibin,项目名称:dubbox-hystrix,代码行数:8,代码来源:ConsumerServiceImpl.java

示例7: findOverrideUrl

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findOverrideUrl(String service, String address, String application) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.CONFIGURATORS_CATEGORY);
    if (service != null && service.length() > 0) {
    	filter.put(SyncUtils.SERVICE_FILTER_KEY, service);
    }
    if (address != null && address.length() > 0) {
    	filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
    }
    if (application != null && application.length() > 0) {
    	filter.put(Constants.APPLICATION_KEY, application);
    }
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:flychao88,项目名称:dubbocloud,代码行数:15,代码来源:OverrideServiceImpl.java

示例8: findConsumerUrlByAddress

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findConsumerUrlByAddress(String address) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
    filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
    
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:8,代码来源:ConsumerServiceImpl.java

示例9: findProviderUrlByAddress

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Map<Long, URL> findProviderUrlByAddress(String address) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
    filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);

    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:l1325169021,项目名称:github-test,代码行数:8,代码来源:ProviderServiceImpl.java

示例10: findProviderUrlByAddress

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Map<Long, URL> findProviderUrlByAddress(String address) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.PROVIDERS_CATEGORY);
    filter.put(SyncUtils.ADDRESS_FILTER_KEY, address);
    
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:8,代码来源:ProviderServiceImpl.java

示例11: findConsumerUrlByService

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Map<Long, URL> findConsumerUrlByService(String service) {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
    filter.put(SyncUtils.SERVICE_FILTER_KEY, service);

    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:l1325169021,项目名称:github-test,代码行数:8,代码来源:ConsumerServiceImpl.java

示例12: findByService

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public List<Consumer> findByService(String service) {
    return SyncUtils.url2ConsumerList(findConsumerUrlByService(service));
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:ConsumerServiceImpl.java

示例13: findConsumer

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public Consumer findConsumer(Long id) {
    return SyncUtils.url2Consumer(findConsumerUrl(id));
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:ConsumerServiceImpl.java

示例14: findAll

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
public List<Consumer> findAll() {
    return SyncUtils.url2ConsumerList(findAllConsumerUrl());
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:ConsumerServiceImpl.java

示例15: findAllConsumerUrl

import com.alibaba.dubbo.governance.sync.util.SyncUtils; //导入依赖的package包/类
private Map<Long, URL> findAllConsumerUrl() {
    Map<String, String> filter = new HashMap<String, String>();
    filter.put(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY);
    return SyncUtils.filterFromCategory(getRegistryCache(), filter);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:6,代码来源:ConsumerServiceImpl.java


注:本文中的com.alibaba.dubbo.governance.sync.util.SyncUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。