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


Java UrlUtils.parseURL方法代码示例

本文整理汇总了Java中com.alibaba.dubbo.common.utils.UrlUtils.parseURL方法的典型用法代码示例。如果您正苦于以下问题:Java UrlUtils.parseURL方法的具体用法?Java UrlUtils.parseURL怎么用?Java UrlUtils.parseURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.alibaba.dubbo.common.utils.UrlUtils的用法示例。


在下文中一共展示了UrlUtils.parseURL方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadMonitor

import com.alibaba.dubbo.common.utils.UrlUtils; //导入方法依赖的package包/类
protected URL loadMonitor(URL registryURL) {
    if (monitor == null) {
        String monitorAddress = ConfigUtils.getProperty("dubbo.monitor.address");
        String monitorProtocol = ConfigUtils.getProperty("dubbo.monitor.protocol");
        if (monitorAddress != null && monitorAddress.length() > 0
                || monitorProtocol != null && monitorProtocol.length() > 0) {
            monitor = new MonitorConfig();
        } else {
            return null;
        }
    }
    appendProperties(monitor);
    Map<String, String> map = new HashMap<String, String>();
    map.put(Constants.INTERFACE_KEY, MonitorService.class.getName());
    map.put("dubbo", Version.getVersion());
    map.put(Constants.TIMESTAMP_KEY, String.valueOf(System.currentTimeMillis()));
    if (ConfigUtils.getPid() > 0) {
        map.put(Constants.PID_KEY, String.valueOf(ConfigUtils.getPid()));
    }
    appendParameters(map, monitor);
    String address = monitor.getAddress();
    String sysaddress = System.getProperty("dubbo.monitor.address");
    if (sysaddress != null && sysaddress.length() > 0) {
        address = sysaddress;
    }
    if (ConfigUtils.isNotEmpty(address)) {
        if (! map.containsKey(Constants.PROTOCOL_KEY)) {
            if (ExtensionLoader.getExtensionLoader(MonitorFactory.class).hasExtension("logstat")) {
                map.put(Constants.PROTOCOL_KEY, "logstat");
            } else {
                map.put(Constants.PROTOCOL_KEY, "dubbo");
            }
        }
        return UrlUtils.parseURL(address, map);
    } else if (Constants.REGISTRY_PROTOCOL.equals(monitor.getProtocol()) && registryURL != null) {
        return registryURL.setProtocol("dubbo").addParameter(Constants.PROTOCOL_KEY, "registry").addParameterAndEncoded(Constants.REFER_KEY, StringUtils.toQueryString(map));
    }
    return null;
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:40,代码来源:AbstractInterfaceConfig.java

示例2: loadMonitor

import com.alibaba.dubbo.common.utils.UrlUtils; //导入方法依赖的package包/类
protected URL loadMonitor(URL registryURL) {
    if (monitor == null) {
        String monitorAddress = ConfigUtils.getProperty("dubbo.monitor.address");
        String monitorProtocol = ConfigUtils.getProperty("dubbo.monitor.protocol");
        if (monitorAddress != null && monitorAddress.length() > 0
                || monitorProtocol != null && monitorProtocol.length() > 0) {
            monitor = new MonitorConfig();
        } else {
            return null;
        }
    }
    appendProperties(monitor);
    Map<String, String> map = new HashMap<>();
    map.put(Constants.INTERFACE_KEY, MonitorService.class.getName());
    map.put("dubbo", Version.getVersion());
    map.put(Constants.TIMESTAMP_KEY, String.valueOf(System.currentTimeMillis()));
    if (ConfigUtils.getPid() > 0) {
        map.put(Constants.PID_KEY, String.valueOf(ConfigUtils.getPid()));
    }
    appendParameters(map, monitor);
    String address = monitor.getAddress();
    String sysaddress = System.getProperty("dubbo.monitor.address");
    if (sysaddress != null && sysaddress.length() > 0) {
        address = sysaddress;
    }
    if (ConfigUtils.isNotEmpty(address)) {
        if (! map.containsKey(Constants.PROTOCOL_KEY)) {
            if (ExtensionLoader.getExtensionLoader(MonitorFactory.class).hasExtension("logstat")) {
                map.put(Constants.PROTOCOL_KEY, "logstat");
            } else {
                map.put(Constants.PROTOCOL_KEY, "dubbo");
            }
        }
        return UrlUtils.parseURL(address, map);
    } else if (Constants.REGISTRY_PROTOCOL.equals(monitor.getProtocol()) && registryURL != null) {
        return registryURL.setProtocol("dubbo").addParameter(Constants.PROTOCOL_KEY, "registry").addParameterAndEncoded(Constants.REFER_KEY, StringUtils.toQueryString(map));
    }
    return null;
}
 
开发者ID:linux-china,项目名称:dubbo3,代码行数:40,代码来源:AbstractInterfaceConfig.java

示例3: loadMonitor

import com.alibaba.dubbo.common.utils.UrlUtils; //导入方法依赖的package包/类
protected URL loadMonitor(URL registryURL) {
	if (monitor == null) {
		String monitorAddress = ConfigUtils.getProperty("dubbo.monitor.address");
		String monitorProtocol = ConfigUtils.getProperty("dubbo.monitor.protocol");
		if (monitorAddress != null && monitorAddress.length() > 0
				|| monitorProtocol != null && monitorProtocol.length() > 0) {
			monitor = new MonitorConfig();
		} else {
			return null;
		}
	}
	appendProperties(monitor);
	Map<String, String> map = new HashMap<String, String>();
	map.put(Constants.INTERFACE_KEY, MonitorService.class.getName());
	map.put("dubbo", Version.getVersion());
	map.put(Constants.TIMESTAMP_KEY, String.valueOf(System.currentTimeMillis()));
	if (BaseContext.CTX.getNode().getPid() > 0) {
		map.put(Constants.PID_KEY, String.valueOf(BaseContext.CTX.getNode().getPid()));
	}
	appendParameters(map, monitor);
	String address = monitor.getAddress();
	String sysaddress = System.getProperty("dubbo.monitor.address");
	if (sysaddress != null && sysaddress.length() > 0) {
		address = sysaddress;
	}
	if (ConfigUtils.isNotEmpty(address)) {
		if (!map.containsKey(Constants.PROTOCOL_KEY)) {
			if (ExtensionExtendUtil.hasExtension(MonitorFactory.class, "logstat")) {
				map.put(Constants.PROTOCOL_KEY, "logstat");
			} else {
				map.put(Constants.PROTOCOL_KEY, "dubbo");
			}
		}
		return UrlUtils.parseURL(address, map);
	} else if (Constants.REGISTRY_PROTOCOL.equals(monitor.getProtocol()) && registryURL != null) {
		return registryURL.setProtocol("dubbo").addParameter(Constants.PROTOCOL_KEY, "registry")
				.addParameterAndEncoded(Constants.REFER_KEY, StringUtils.toQueryString(map));
	}
	return null;
}
 
开发者ID:nince-wyj,项目名称:jahhan,代码行数:41,代码来源:AbstractInterfaceConfig.java

示例4: loadMonitor

import com.alibaba.dubbo.common.utils.UrlUtils; //导入方法依赖的package包/类
protected URL loadMonitor(URL registryURL) {
    if (monitor == null) {
        String monitorAddress = ConfigUtils.getProperty("dubbo.monitor.address");
        String monitorProtocol = ConfigUtils.getProperty("dubbo.monitor.protocol");
        if ((monitorAddress == null || monitorAddress.length() == 0) && (monitorProtocol == null || monitorProtocol.length() == 0)) {
            return null;
        }

        monitor = new MonitorConfig();
        if (monitorAddress != null && monitorAddress.length() > 0) {
            monitor.setAddress(monitorAddress);
        }
        if (monitorProtocol != null && monitorProtocol.length() > 0) {
            monitor.setProtocol(monitorProtocol);
        }
    }
    appendProperties(monitor);
    Map<String, String> map = new HashMap<String, String>();
    map.put(Constants.INTERFACE_KEY, MonitorService.class.getName());
    map.put("dubbo", Version.getVersion());
    map.put(Constants.TIMESTAMP_KEY, String.valueOf(System.currentTimeMillis()));
    if (ConfigUtils.getPid() > 0) {
        map.put(Constants.PID_KEY, String.valueOf(ConfigUtils.getPid()));
    }
    appendParameters(map, monitor);
    String address = monitor.getAddress();
    String sysaddress = System.getProperty("dubbo.monitor.address");
    if (sysaddress != null && sysaddress.length() > 0) {
        address = sysaddress;
    }
    if (ConfigUtils.isNotEmpty(address)) {
        if (!map.containsKey(Constants.PROTOCOL_KEY)) {
            if (ExtensionLoader.getExtensionLoader(MonitorFactory.class).hasExtension("logstat")) {
                map.put(Constants.PROTOCOL_KEY, "logstat");
            } else {
                map.put(Constants.PROTOCOL_KEY, "dubbo");
            }
        }
        return UrlUtils.parseURL(address, map);
    } else if (Constants.REGISTRY_PROTOCOL.equals(monitor.getProtocol()) && registryURL != null) {
        return registryURL.setProtocol("dubbo").addParameter(Constants.PROTOCOL_KEY, "registry").addParameterAndEncoded(Constants.REFER_KEY, StringUtils.toQueryString(map));
    }
    return null;
}
 
开发者ID:hufeng,项目名称:dubbo2.js,代码行数:45,代码来源:AbstractInterfaceConfig.java


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