Java Code Examples for com.alibaba.dubbo.config.ReferenceConfig#getInterfaceClass()

The following examples show how to use com.alibaba.dubbo.config.ReferenceConfig#getInterfaceClass() . 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: ReferenceConfigCache.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Override
public String generateKey(ReferenceConfig<?> referenceConfig) {
    String iName = referenceConfig.getInterface();
    if (StringUtils.isBlank(iName)) {
        Class<?> clazz = referenceConfig.getInterfaceClass();
        iName = clazz.getName();
    }
    if (StringUtils.isBlank(iName)) {
        throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
    }

    StringBuilder ret = new StringBuilder();
    if (!StringUtils.isBlank(referenceConfig.getGroup())) {
        ret.append(referenceConfig.getGroup()).append("/");
    }
    ret.append(iName);
    if (!StringUtils.isBlank(referenceConfig.getVersion())) {
        ret.append(":").append(referenceConfig.getVersion());
    }
    return ret.toString();
}
 
Example 2
Source File: ReferenceConfigCache.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public String generateKey(ReferenceConfig<?> referenceConfig) {
    String iName = referenceConfig.getInterface();
    if(StringUtils.isBlank(iName)) {
        Class<?> clazz = referenceConfig.getInterfaceClass();
        iName = clazz.getName();
    }
    if(StringUtils.isBlank(iName)) {
        throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
    }

    StringBuilder ret = new StringBuilder();
    if(! StringUtils.isBlank(referenceConfig.getGroup())) {
        ret.append(referenceConfig.getGroup()).append("/");
    }
    ret.append(iName);
    if(! StringUtils.isBlank(referenceConfig.getVersion())) {
        ret.append(":").append(referenceConfig.getVersion());
    }
    return ret.toString();
}
 
Example 3
Source File: ReferenceConfigCache.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
public String generateKey(ReferenceConfig<?> referenceConfig) {
    String iName = referenceConfig.getInterface();
    if(StringUtils.isBlank(iName)) {
        Class<?> clazz = referenceConfig.getInterfaceClass();
        iName = clazz.getName();
    }
    if(StringUtils.isBlank(iName)) {
        throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
    }

    StringBuilder ret = new StringBuilder();
    if(! StringUtils.isBlank(referenceConfig.getGroup())) {
        ret.append(referenceConfig.getGroup()).append("/");
    }
    ret.append(iName);
    if(! StringUtils.isBlank(referenceConfig.getVersion())) {
        ret.append(":").append(referenceConfig.getVersion());
    }
    return ret.toString();
}
 
Example 4
Source File: ReferenceConfigCache.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
public String generateKey(ReferenceConfig<?> referenceConfig) {
    String iName = referenceConfig.getInterface();
    if (StringUtils.isBlank(iName)) {
        Class<?> clazz = referenceConfig.getInterfaceClass();
        iName = clazz.getName();
    }
    if (StringUtils.isBlank(iName)) {
        throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
    }

    StringBuilder ret = new StringBuilder();
    if (!StringUtils.isBlank(referenceConfig.getGroup())) {
        ret.append(referenceConfig.getGroup()).append("/");
    }
    ret.append(iName);
    if (!StringUtils.isBlank(referenceConfig.getVersion())) {
        ret.append(":").append(referenceConfig.getVersion());
    }
    return ret.toString();
}
 
Example 5
Source File: ReferenceConfigCache.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public String generateKey(ReferenceConfig<?> referenceConfig) {
    String iName = referenceConfig.getInterface();
    if(StringUtils.isBlank(iName)) {
        Class<?> clazz = referenceConfig.getInterfaceClass();
        iName = clazz.getName();
    }
    if(StringUtils.isBlank(iName)) {
        throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
    }

    StringBuilder ret = new StringBuilder();
    if(! StringUtils.isBlank(referenceConfig.getGroup())) {
        ret.append(referenceConfig.getGroup()).append("/");
    }
    ret.append(iName);
    if(! StringUtils.isBlank(referenceConfig.getVersion())) {
        ret.append(":").append(referenceConfig.getVersion());
    }
    return ret.toString();
}
 
Example 6
Source File: ReferenceConfigCache.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public String generateKey(ReferenceConfig<?> referenceConfig) {
    String iName = referenceConfig.getInterface();
    if(StringUtils.isBlank(iName)) {
        Class<?> clazz = referenceConfig.getInterfaceClass();
        iName = clazz.getName();
    }
    if(StringUtils.isBlank(iName)) {
        throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
    }

    StringBuilder ret = new StringBuilder();
    if(! StringUtils.isBlank(referenceConfig.getGroup())) {
        ret.append(referenceConfig.getGroup()).append("/");
    }
    ret.append(iName);
    if(! StringUtils.isBlank(referenceConfig.getVersion())) {
        ret.append(":").append(referenceConfig.getVersion());
    }
    return ret.toString();
}