@Override public InetSocketAddress getLocalAddress() { if (client == null) { return InetSocketAddress.createUnresolved(NetUtils.getLocalHost(), 0); } else { return client.getLocalAddress(); } }
@Override public InetSocketAddress getLocalAddress() { if (client == null) { return InetSocketAddress.createUnresolved(NetUtils.getLocalHost(), 0); } else { return client.getLocalAddress(); } }
private String appendContextMessage(String msg) { return " [DUBBO] " + msg + ", dubbo version: " + Version.getVersion() + ", current host: " + NetUtils.getLocalHost(); }
private String appendContextMessage(String msg) { return " [DUBBO] " + msg + ", dubbo version: " + Version.getVersion() + ", current host: " + NetUtils.getLocalHost(); }
/** * get local host. * * @return local host */ public String getLocalHost() { String host = localAddress == null ? null : localAddress.getAddress() == null ? localAddress.getHostName() : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress()); if (host == null || host.length() == 0) { return NetUtils.getLocalHost(); } return host; }
/** * get local host. * * @return local host */ public String getLocalHost() { String host = localAddress == null ? null : localAddress.getAddress() == null ? localAddress.getHostName() : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress()); if (host == null || host.length() == 0) { return NetUtils.getLocalHost(); } return host; }
@Override public InetSocketAddress getLocalAddress() { Channel channel = getChannel(); if (channel == null) { return InetSocketAddress.createUnresolved(NetUtils.getLocalHost(), 0); } return channel.getLocalAddress(); }
@Override public InetSocketAddress getLocalAddress() { Channel channel = getChannel(); if (channel == null) { return InetSocketAddress.createUnresolved(NetUtils.getLocalHost(), 0); } return channel.getLocalAddress(); }
private boolean isValidCategory(URL url) { String category = url.getParameter(CATEGORY_KEY, DEFAULT_CATEGORY); if ((ROUTERS_CATEGORY.equals(category) || ROUTE_PROTOCOL.equals(url.getProtocol())) || PROVIDERS_CATEGORY.equals(category) || CONFIGURATORS_CATEGORY.equals(category) || DYNAMIC_CONFIGURATORS_CATEGORY.equals(category) || APP_DYNAMIC_CONFIGURATORS_CATEGORY.equals(category)) { return true; } logger.warn("Unsupported category " + category + " in notified url: " + url + " from registry " + getUrl().getAddress() + " to consumer " + NetUtils.getLocalHost()); return false; }
private boolean isValidCategory(URL url) { String category = url.getParameter(CATEGORY_KEY, DEFAULT_CATEGORY); if ((ROUTERS_CATEGORY.equals(category) || ROUTE_PROTOCOL.equals(url.getProtocol())) || PROVIDERS_CATEGORY.equals(category) || CONFIGURATORS_CATEGORY.equals(category) || DYNAMIC_CONFIGURATORS_CATEGORY.equals(category) || APP_DYNAMIC_CONFIGURATORS_CATEGORY.equals(category)) { return true; } logger.warn("Unsupported category " + category + " in notified url: " + url + " from registry " + getUrl().getAddress() + " to consumer " + NetUtils.getLocalHost()); return false; }
protected void checkWhetherDestroyed() { if (destroyed.get()) { throw new RpcException("Rpc cluster invoker for " + getInterface() + " on consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + " is now destroyed! Can not invoke any more."); } }
protected void checkWhetherDestroyed() { if (destroyed.get()) { throw new RpcException("Rpc cluster invoker for " + getInterface() + " on consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + " is now destroyed! Can not invoke any more."); } }
private void changed() throws RemotingException { try { String[] lines = IOUtils.readLines(file); for (String line : lines) { connect(URL.valueOf(line)); } } catch (IOException e) { throw new RemotingException(new InetSocketAddress(NetUtils.getLocalHost(), 0), getUrl().toInetSocketAddress(), e.getMessage(), e); } }
private void changed() throws RemotingException { try { String[] lines = IOUtils.readLines(file); for (String line : lines) { connect(URL.valueOf(line)); } } catch (IOException e) { throw new RemotingException(new InetSocketAddress(NetUtils.getLocalHost(), 0), getUrl().toInetSocketAddress(), e.getMessage(), e); } }
private void changed() throws RemotingException { try { String[] lines = IOUtils.readLines(file); for (String line : lines) { connect(URL.valueOf(line)); } } catch (IOException e) { throw new RemotingException(new InetSocketAddress(NetUtils.getLocalHost(), 0), getUrl().toInetSocketAddress(), e.getMessage(), e); } }
private void changed() throws RemotingException { try { String[] lines = IOUtils.readLines(file); for (String line : lines) { connect(URL.valueOf(line)); } } catch (IOException e) { throw new RemotingException(new InetSocketAddress(NetUtils.getLocalHost(), 0), getUrl().toInetSocketAddress(), e.getMessage(), e); } }
public ExchangePeer joinExchange(URL url, ExchangeHandler handler) throws RemotingException { ExchangePeer peer = super.join(url, handler); try { String full = url.toFullString(); String[] lines = IOUtils.readLines(file); for (String line : lines) { if (full.equals(line)) { return peer; } } IOUtils.appendLines(file, new String[]{full}); } catch (IOException e) { throw new RemotingException(new InetSocketAddress(NetUtils.getLocalHost(), 0), getUrl().toInetSocketAddress(), e.getMessage(), e); } return peer; }
public ExchangePeer joinExchange(URL url, ExchangeHandler handler) throws RemotingException { ExchangePeer peer = super.join(url, handler); try { String full = url.toFullString(); String[] lines = IOUtils.readLines(file); for (String line : lines) { if (full.equals(line)) { return peer; } } IOUtils.appendLines(file, new String[]{full}); } catch (IOException e) { throw new RemotingException(new InetSocketAddress(NetUtils.getLocalHost(), 0), getUrl().toInetSocketAddress(), e.getMessage(), e); } return peer; }
protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) { if (CollectionUtils.isEmpty(invokers)) { throw new RpcException(RpcException.NO_INVOKER_AVAILABLE_AFTER_FILTER, "Failed to invoke the method " + invocation.getMethodName() + " in the service " + getInterface().getName() + ". No provider available for the service " + directory.getUrl().getServiceKey() + " from registry " + directory.getUrl().getAddress() + " on the consumer " + NetUtils.getLocalHost() + " using the dubbo version " + Version.getVersion() + ". Please check if the providers have been started and registered."); } }
protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) { if (CollectionUtils.isEmpty(invokers)) { throw new RpcException(RpcException.NO_INVOKER_AVAILABLE_AFTER_FILTER, "Failed to invoke the method " + invocation.getMethodName() + " in the service " + getInterface().getName() + ". No provider available for the service " + directory.getUrl().getServiceKey() + " from registry " + directory.getUrl().getAddress() + " on the consumer " + NetUtils.getLocalHost() + " using the dubbo version " + Version.getVersion() + ". Please check if the providers have been started and registered."); } }