本文整理汇总了Java中com.alibaba.dubbo.rpc.support.ProtocolUtils类的典型用法代码示例。如果您正苦于以下问题:Java ProtocolUtils类的具体用法?Java ProtocolUtils怎么用?Java ProtocolUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtocolUtils类属于com.alibaba.dubbo.rpc.support包,在下文中一共展示了ProtocolUtils类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExporter
import com.alibaba.dubbo.rpc.support.ProtocolUtils; //导入依赖的package包/类
static Exporter<?> getExporter(Map<String, Exporter<?>> map, URL key) {
Exporter<?> result = null;
if (!key.getServiceKey().contains("*")) {
result = map.get(key.getServiceKey());
} else {
if (map != null && !map.isEmpty()) {
for (Exporter<?> exporter : map.values()) {
if (UrlUtils.isServiceKeyMatch(key, exporter.getInvoker().getUrl())) {
result = exporter;
break;
}
}
}
}
if (result == null) {
return null;
} else if (ProtocolUtils.isGeneric(
result.getInvoker().getUrl().getParameter(Constants.GENERIC_KEY))) {
return null;
} else {
return result;
}
}
示例2: getExporter
import com.alibaba.dubbo.rpc.support.ProtocolUtils; //导入依赖的package包/类
static Exporter<?> getExporter(Map<String, Exporter<?>> map, URL key) {
Exporter<?> result = null;
if (!key.getServiceKey().contains("*")) {
result = map.get(key.getServiceKey());
} else {
if (map != null && !map.isEmpty()) {
for (Exporter<?> exporter : map.values()) {
if (UrlUtils.isServiceKeyMatch(key, exporter.getInvoker().getUrl())) {
result = exporter;
break;
}
}
}
}
if (result == null) {
return null;
} else if (ProtocolUtils.isGeneric(
result.getInvoker().getUrl().getParameter(Constants.GENERIC_KEY))) {
return null;
} else {
return result;
}
}
示例3: getExporter
import com.alibaba.dubbo.rpc.support.ProtocolUtils; //导入依赖的package包/类
static Exporter<?> getExporter(Map<String, Exporter<?>> map, URL key) {
Exporter<?> result = null;
if (!key.getServiceKey().contains("*")) {
result = map.get(key.getServiceKey());
} else {
if (map != null && !map.isEmpty()) {
for (Exporter<?> exporter : map.values()) {
if (UrlUtils.isServiceKeyMatch(key, exporter.getInvoker().getUrl())) {
result = exporter;
break;
}
}
}
}
if (result == null) {
return null;
} else if (ProtocolUtils.isGeneric(result.getInvoker().getUrl().getParameter(Constants.GENERIC_KEY))) {
return null;
} else {
return result;
}
}
示例4: setGeneric
import com.alibaba.dubbo.rpc.support.ProtocolUtils; //导入依赖的package包/类
public void setGeneric(String generic) {
if (StringUtils.isEmpty(generic)) { return; }
if (ProtocolUtils.isGeneric(generic)) {
this.generic = generic;
} else {
throw new IllegalArgumentException("Unsupported generic type " + generic);
}
}
示例5: setGeneric
import com.alibaba.dubbo.rpc.support.ProtocolUtils; //导入依赖的package包/类
public void setGeneric(String generic) {
if (StringUtils.isEmpty(generic)) {
return;
}
if (ProtocolUtils.isGeneric(generic)) {
this.generic = generic;
} else {
throw new IllegalArgumentException("Unsupported generic type " + generic);
}
}
示例6: setGeneric
import com.alibaba.dubbo.rpc.support.ProtocolUtils; //导入依赖的package包/类
public void setGeneric(String generic) {
if (StringUtils.isEmpty(generic)) {
return;
}
if (ProtocolUtils.isGeneric(generic)) {
this.generic = generic;
} else {
throw new IllegalArgumentException("Unsupported generic type " + generic);
}
}
示例7: serviceKey
import com.alibaba.dubbo.rpc.support.ProtocolUtils; //导入依赖的package包/类
protected static String serviceKey(URL url) {
return ProtocolUtils.serviceKey(url);
}