本文整理了Java中com.alibaba.dubbo.common.URL.isAnyHost()
方法的一些代码示例,展示了URL.isAnyHost()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URL.isAnyHost()
方法的具体详情如下:
包路径:com.alibaba.dubbo.common.URL
类名称:URL
方法名:isAnyHost
暂无
代码示例来源:origin: linux-china/dubbo3
public ConsulRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
}
consulClient = new ConsulClient(url.getHost(), url.getPort());
}
代码示例来源:origin: linux-china/dubbo3
public ConsulRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
}
consulClient = new ConsulClient(url.getHost(), url.getPort());
}
代码示例来源:origin: com.alibaba/dubbo
public ZookeeperRegistry(URL url, ZookeeperTransporter zookeeperTransporter) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
}
String group = url.getParameter(Constants.GROUP_KEY, DEFAULT_ROOT);
if (!group.startsWith(Constants.PATH_SEPARATOR)) {
group = Constants.PATH_SEPARATOR + group;
}
this.root = group;
zkClient = zookeeperTransporter.connect(url);
zkClient.addStateListener(new StateListener() {
@Override
public void stateChanged(int state) {
if (state == RECONNECTED) {
try {
recover();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
}
});
}
代码示例来源:origin: remoting/dubbox
public ZookeeperRegistry(URL url, ZookeeperTransporter zookeeperTransporter) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
}
String group = url.getParameter(Constants.GROUP_KEY, DEFAULT_ROOT);
if (! group.startsWith(Constants.PATH_SEPARATOR)) {
group = Constants.PATH_SEPARATOR + group;
}
this.root = group;
zkClient = zookeeperTransporter.connect(url);
zkClient.addStateListener(new StateListener() {
public void stateChanged(int state) {
if (state == RECONNECTED) {
try {
recover();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
}
});
}
代码示例来源:origin: remoting/dubbox
public ZookeeperRegistry(URL url, ZookeeperTransporter zookeeperTransporter) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
}
String group = url.getParameter(Constants.GROUP_KEY, DEFAULT_ROOT);
if (! group.startsWith(Constants.PATH_SEPARATOR)) {
group = Constants.PATH_SEPARATOR + group;
}
this.root = group;
zkClient = zookeeperTransporter.connect(url);
zkClient.addStateListener(new StateListener() {
public void stateChanged(int state) {
if (state == RECONNECTED) {
try {
recover();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
}
});
}
代码示例来源:origin: com.alibaba/dubbo
public MulticastRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: com.alibaba/dubbo-registry-multicast
public MulticastRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: net.jahhan/dubbo-registry-multicast
public MulticastRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: hutai123/dubbox
public MulticastRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: hutai123/dubbox
public MulticastRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: apache/incubator-dubbo-rpc-jsonrpc
public JettyHttpServer(URL url, final HttpHandler handler) {
super(url, handler);
DispatcherServlet.addHttpHandler(url.getPort(), handler);
int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS);
QueuedThreadPool threadPool = new QueuedThreadPool();
threadPool.setDaemon(true);
threadPool.setMaxThreads(threads);
threadPool.setMinThreads(threads);
server = new Server(threadPool);
// HTTP connector
ServerConnector connector = new ServerConnector(server);
if (!url.isAnyHost() && NetUtils.isValidLocalHost(url.getHost())) {
connector.setHost(url.getHost());
}
connector.setPort(url.getPort());
// connector.setIdleTimeout(30000);
server.addConnector(connector);
ServletHandler servletHandler = new ServletHandler();
ServletHolder servletHolder = servletHandler.addServletWithMapping(DispatcherServlet.class, "/*");
servletHolder.setInitOrder(2);
server.insertHandler(servletHandler);
try {
server.start();
} catch (Exception e) {
throw new IllegalStateException("Failed to start jetty server on " + url.getAddress() + ", cause: "
+ e.getMessage(), e);
}
}
代码示例来源:origin: hutai123/dubbox
public RedisRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: com.alibaba/dubbo
@Override
protected void doStart(URL url) {
String bindIp = url.getParameter(Constants.BIND_IP_KEY, url.getHost());
if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) {
server.setHostname(bindIp);
}
server.setPort(url.getParameter(Constants.BIND_PORT_KEY, url.getPort()));
Map<ChannelOption, Object> channelOption = new HashMap<ChannelOption, Object>();
channelOption.put(ChannelOption.SO_KEEPALIVE, url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE));
server.setChildChannelOptions(channelOption);
server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS));
server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS));
server.setMaxRequestSize(url.getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD));
server.start();
}
代码示例来源:origin: com.alibaba/dubbo-registry-redis
public RedisRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: com.alibaba/dubbo
public RedisRegistry(URL url) {
super(url);
if (url.isAnyHost()) {
throw new IllegalStateException("registry address == null");
代码示例来源:origin: remoting/dubbox
if (! url.isAnyHost() && NetUtils.isValidLocalHost(url.getHost())) {
connector.setHost(url.getHost());
代码示例来源:origin: net.jahhan/dubbo-remoting-http
if (! url.isAnyHost() && NetUtils.isValidLocalHost(url.getHost())) {
connector.setHost(url.getHost());
代码示例来源:origin: remoting/dubbox
if (! url.isAnyHost() && NetUtils.isValidLocalHost(url.getHost())) {
connector.setHost(url.getHost());
代码示例来源:origin: com.alibaba/dubbo
if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) {
connector.setHost(bindIp);
代码示例来源:origin: com.alibaba/dubbo-remoting-http
if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) {
connector.setHost(bindIp);
内容来源于网络,如有侵权,请联系作者删除!