本文整理汇总了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>");
}
示例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>");
}
示例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> > " + application +
" > <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);
}