类com.alibaba.dubbo.rpc.support.ProtocolUtils源码实例Demo

下面列出了怎么用com.alibaba.dubbo.rpc.support.ProtocolUtils的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dubbo-2.6.5   文件: InjvmProtocol.java
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 项目: dubbox   文件: InjvmProtocol.java
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 项目: dubbox-hystrix   文件: InjvmProtocol.java
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 项目: dubbo3   文件: InjvmProtocol.java
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;
    }
}
 
源代码5 项目: dubbox   文件: InjvmProtocol.java
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;
    }
}
 
源代码6 项目: dubbox   文件: InjvmProtocol.java
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;
    }
}
 
源代码7 项目: dubbo-2.6.5   文件: HessianProtocol.java
@Override
@SuppressWarnings("unchecked")
protected <T> T doRefer(Class<T> serviceType, URL url) throws RpcException {
    String generic = url.getParameter(Constants.GENERIC_KEY);
    boolean isGeneric = ProtocolUtils.isGeneric(generic) || serviceType.equals(GenericService.class);
    if (isGeneric) {
        RpcContext.getContext().setAttachment(Constants.GENERIC_KEY, generic);
        url = url.setPath(url.getPath() + "/" + Constants.GENERIC_KEY);
    }

    HessianProxyFactory hessianProxyFactory = new HessianProxyFactory();
    boolean isHessian2Request = url.getParameter(Constants.HESSIAN2_REQUEST_KEY, Constants.DEFAULT_HESSIAN2_REQUEST);
    hessianProxyFactory.setHessian2Request(isHessian2Request);
    boolean isOverloadEnabled = url.getParameter(Constants.HESSIAN_OVERLOAD_METHOD_KEY, Constants.DEFAULT_HESSIAN_OVERLOAD_METHOD);
    hessianProxyFactory.setOverloadEnabled(isOverloadEnabled);
    String client = url.getParameter(Constants.CLIENT_KEY, Constants.DEFAULT_HTTP_CLIENT);
    if ("httpclient".equals(client)) {
        hessianProxyFactory.setConnectionFactory(new HttpClientConnectionFactory());
    } else if (client != null && client.length() > 0 && !Constants.DEFAULT_HTTP_CLIENT.equals(client)) {
        throw new IllegalStateException("Unsupported http protocol client=\"" + client + "\"!");
    } else {
        HessianConnectionFactory factory = new DubboHessianURLConnectionFactory();
        factory.setHessianProxyFactory(hessianProxyFactory);
        hessianProxyFactory.setConnectionFactory(factory);
    }
    int timeout = url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    hessianProxyFactory.setConnectTimeout(timeout);
    hessianProxyFactory.setReadTimeout(timeout);
    return (T) hessianProxyFactory.create(serviceType, url.setProtocol("http").toJavaURL(), Thread.currentThread().getContextClassLoader());
}
 
源代码8 项目: dubbo-2.6.5   文件: ServiceConfig.java
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);
    }
}
 
源代码9 项目: dubbox   文件: ServiceConfig.java
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);
    }
}
 
源代码10 项目: dubbox-hystrix   文件: ServiceConfig.java
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);
    }
}
 
源代码11 项目: dubbo3   文件: ServiceConfig.java
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);
    }
}
 
源代码12 项目: dubbox   文件: ServiceConfig.java
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);
    }
}
 
源代码13 项目: dubbox   文件: ServiceConfig.java
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);
    }
}
 
源代码14 项目: dubbo-2.6.5   文件: AbstractProtocol.java
protected static String serviceKey(int port, String serviceName, String serviceVersion, String serviceGroup) {
    return ProtocolUtils.serviceKey(port, serviceName, serviceVersion, serviceGroup);
}
 
源代码15 项目: dubbo-2.6.5   文件: AbstractReferenceConfig.java
@Parameter(excluded = true)
public Boolean isGeneric() {
    return ProtocolUtils.isGeneric(generic);
}
 
源代码16 项目: dubbox   文件: AbstractProtocol.java
protected static String serviceKey(URL url) {
    return ProtocolUtils.serviceKey(url);
}
 
源代码17 项目: dubbox   文件: AbstractProtocol.java
protected static String serviceKey(int port, String serviceName, String serviceVersion, String serviceGroup) {
	return ProtocolUtils.serviceKey(port, serviceName, serviceVersion, serviceGroup);
}
 
源代码18 项目: dubbox   文件: AbstractReferenceConfig.java
@Parameter(excluded = true)
public Boolean isGeneric() {
    return ProtocolUtils.isGeneric(generic);
}
 
源代码19 项目: dubbox-hystrix   文件: AbstractProtocol.java
protected static String serviceKey(URL url) {
    return ProtocolUtils.serviceKey(url);
}
 
源代码20 项目: dubbox-hystrix   文件: AbstractProtocol.java
protected static String serviceKey(int port, String serviceName, String serviceVersion, String serviceGroup) {
	return ProtocolUtils.serviceKey(port, serviceName, serviceVersion, serviceGroup);
}
 
源代码21 项目: dubbox-hystrix   文件: AbstractReferenceConfig.java
@Parameter(excluded = true)
public Boolean isGeneric() {
    return ProtocolUtils.isGeneric(generic);
}
 
源代码22 项目: dubbo3   文件: AbstractProtocol.java
protected static String serviceKey(URL url) {
    return ProtocolUtils.serviceKey(url);
}
 
源代码23 项目: dubbo3   文件: AbstractProtocol.java
protected static String serviceKey(int port, String serviceName, String serviceVersion, String serviceGroup) {
	return ProtocolUtils.serviceKey(port, serviceName, serviceVersion, serviceGroup);
}
 
源代码24 项目: dubbo3   文件: AbstractReferenceConfig.java
@Parameter(excluded = true)
public Boolean isGeneric() {
    return ProtocolUtils.isGeneric(generic);
}
 
源代码25 项目: dubbox   文件: AbstractProtocol.java
protected static String serviceKey(URL url) {
    return ProtocolUtils.serviceKey(url);
}
 
源代码26 项目: dubbox   文件: AbstractProtocol.java
protected static String serviceKey(int port, String serviceName, String serviceVersion, String serviceGroup) {
	return ProtocolUtils.serviceKey(port, serviceName, serviceVersion, serviceGroup);
}
 
源代码27 项目: dubbox   文件: AbstractReferenceConfig.java
@Parameter(excluded = true)
public Boolean isGeneric() {
    return ProtocolUtils.isGeneric(generic);
}
 
源代码28 项目: dubbox   文件: AbstractProtocol.java
protected static String serviceKey(URL url) {
    return ProtocolUtils.serviceKey(url);
}
 
源代码29 项目: dubbox   文件: AbstractProtocol.java
protected static String serviceKey(int port, String serviceName, String serviceVersion, String serviceGroup) {
	return ProtocolUtils.serviceKey(port, serviceName, serviceVersion, serviceGroup);
}
 
源代码30 项目: dubbox   文件: AbstractReferenceConfig.java
@Parameter(excluded = true)
public Boolean isGeneric() {
    return ProtocolUtils.isGeneric(generic);
}
 
 类所在包
 类方法
 同包方法