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


Java RegistryContainer类代码示例

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


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

示例1: handle

import com.alibaba.dubbo.monitor.simple.RegistryContainer; //导入依赖的package包/类
public Page handle(URL url) {
    String provider = url.getParameterAndDecoded("provider");
    if (provider == null || provider.length() == 0) {
        throw new IllegalArgumentException("Please input provider parameter.");
    }
    URL providerUrl = URL.valueOf(provider);
    RegistryContainer.getInstance().getRegistry().unregister(providerUrl);
    String parameter;
    if (url.hasParameter("service")) {
        parameter = "service=" + url.getParameter("service");
    } else if (url.hasParameter("host")) {
        parameter = "host=" + url.getParameter("host");
    } else if (url.hasParameter("application")) {
        parameter = "application=" + url.getParameter("application");
    } else {
        parameter = "service=" + providerUrl.getServiceInterface();
    }
    return new Page("<script type=\"text/javascript\">window.location.href=\"providers.html?" + parameter + "\";</script>");
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:20,代码来源:UnregisterPageHandler.java

示例2: handle

import com.alibaba.dubbo.monitor.simple.RegistryContainer; //导入依赖的package包/类
public Page handle(URL url) {
    String consumer = url.getParameterAndDecoded("consumer");
    if (consumer == null || consumer.length() == 0) {
        throw new IllegalArgumentException("Please input consumer parameter.");
    }
    URL consumerUrl = URL.valueOf(consumer);
    RegistryContainer.getInstance().getRegistry().unsubscribe(consumerUrl, NotifyListenerAdapter.NOTIFY_LISTENER);
    String parameter;
    if (url.hasParameter("service")) {
        parameter = "service=" + url.getParameter("service");
    } else if (url.hasParameter("host")) {
        parameter = "host=" + url.getParameter("host");
    } else if (url.hasParameter("application")) {
        parameter = "application=" + url.getParameter("application");
    } else {
        parameter = "service=" + consumerUrl.getServiceInterface();
    }
    return new Page("<script type=\"text/javascript\">window.location.href=\"consumers.html?" + parameter + "\";</script>");
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:20,代码来源:UnsubscribePageHandler.java

示例3: handle

import com.alibaba.dubbo.monitor.simple.RegistryContainer; //导入依赖的package包/类
public Page handle(URL url) {
    String application = url.getParameter("application");
    if (application == null || application.length() == 0) {
        throw new IllegalArgumentException("Please input application parameter.");
    }
    boolean reverse = url.getParameter("reverse", false);
    List<List<String>> rows = new ArrayList<List<String>>();
    Set<String> directly = RegistryContainer.getInstance().getDependencies(application, reverse);
    Set<String> indirectly = new HashSet<String>();
    appendDependency(rows, reverse, application, 0, new HashSet<String>(), indirectly);
    indirectly.remove(application);
    return new Page("<a href=\"applications.html\">Applications</a> &gt; " + application + 
            " &gt; <a href=\"providers.html?application=" + application + "\">Providers</a> | <a href=\"consumers.html?application=" + application + "\">Consumers</a> | " +
            (reverse ? "<a href=\"dependencies.html?application=" + application + "\">Depends On</a> | Used By" 
                    : "Depends On | <a href=\"dependencies.html?application=" + application + "&reverse=true\">Used By</a>"), (reverse ? "Used By" : "Depends On") + " (" + directly.size() + "/" + indirectly.size() + ")", new String[] { "Application Name:"}, rows);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:17,代码来源:DependenciesPageHandler.java


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