@Override public String getBrokerName() { if (brokerName == null) { try { brokerName = InetAddressUtil.getLocalHostName().toLowerCase(Locale.ENGLISH); } catch (Exception e) { brokerName = "localhost"; } } return brokerName; }
protected String resolveHostName(String host) throws UnknownHostException { if (isUseLocalHost()) { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && isUseLocalHost()) { if (localName.equals(host)) { return "localhost"; } } return host; }
/** * @param socket * @param bindAddress * @return real hostName * @throws UnknownHostException */ protected String resolveHostName(ServerSocket socket, InetAddress bindAddress) throws UnknownHostException { String result = null; if (socket.isBound()) { if (socket.getInetAddress().isAnyLocalAddress()) { // make it more human readable and useful, an alternative to 0.0.0.0 result = InetAddressUtil.getLocalHostName(); } else { result = socket.getInetAddress().getCanonicalHostName(); } } else { result = bindAddress.getCanonicalHostName(); } return result; }
if (address.isAnyLocalAddress()) { result = InetAddressUtil.getLocalHostName(); } else { result = address.getHostName(); if (address.isAnyLocalAddress()) { result = InetAddressUtil.getLocalHostName(); } else { result = address.getCanonicalHostName();
@Override public String getBrokerName() { if (brokerName == null) { try { brokerName = InetAddressUtil.getLocalHostName().toLowerCase(); } catch (Exception e) { brokerName = "localhost"; } } return brokerName; }
@Override public String getBrokerName() { if (brokerName == null) { try { brokerName = InetAddressUtil.getLocalHostName().toLowerCase(Locale.ENGLISH); } catch (Exception e) { brokerName = "localhost"; } } return brokerName; }
@Override public String getBrokerName() { if (brokerName == null) { try { brokerName = InetAddressUtil.getLocalHostName().toLowerCase(Locale.ENGLISH); } catch (Exception e) { brokerName = "localhost"; } } return brokerName; }
@Override public String getBrokerName() { if (brokerName == null) { try { brokerName = InetAddressUtil.getLocalHostName().toLowerCase(Locale.ENGLISH); } catch (Exception e) { brokerName = "localhost"; } } return brokerName; }
protected String resolveHostName(String host) throws UnknownHostException { if (isUseLocalHost()) { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && isUseLocalHost()) { if (localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && isUseLocalHost()) { if (localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { if (isUseLocalHost()) { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && isUseLocalHost()) { if (localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { if (isUseLocalHost()) { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { if (isUseLocalHost()) { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && localName.equals(host)) { return "localhost"; } } return host; }
protected String resolveHostName(String host) throws UnknownHostException { String localName = InetAddressUtil.getLocalHostName(); if (localName != null && isUseLocalHost()) { if (localName.equals(host)) { return "localhost"; } } return host; }
/** * @param socket * @param bindAddress * @return real hostName * @throws UnknownHostException */ protected String resolveHostName(ServerSocket socket, InetAddress bindAddress) throws UnknownHostException { String result = null; if (socket.isBound()) { if (socket.getInetAddress().isAnyLocalAddress()) { // make it more human readable and useful, an alternative to 0.0.0.0 result = InetAddressUtil.getLocalHostName(); } else { result = socket.getInetAddress().getCanonicalHostName(); } } else { result = bindAddress.getCanonicalHostName(); } return result; }
public String getBrokerName() { if (brokerName == null) { try { brokerName = InetAddressUtil.getLocalHostName().toLowerCase(Locale.ENGLISH); } catch (Exception e) { brokerName = server.getNodeID().toString(); } } return brokerName; }
public void bind() throws Exception { URI bind = getBindLocation(); String bindHost = bind.getHost(); bindHost = (bindHost == null || bindHost.length() == 0) ? "localhost" : bindHost; InetAddress addr = InetAddress.getByName(bindHost); host = addr.getCanonicalHostName(); connector.setHost(host); connector.setPort(bindAddress.getPort()); connector.setServer(server); server.addConnector(connector); if (addr.isAnyLocalAddress()) { host = InetAddressUtil.getLocalHostName(); } setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), host, bindAddress.getPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } }