protected String getLocalHost() { try { return SocketCreator.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException ignore) { return LOCALHOST; } }
ServerLocator() throws IOException { this.port = 10334; this.hostName = SocketCreator.getLocalHost().getCanonicalHostName(); this.hostNameForClients= this.hostName; this.logFile = null; this.memberName = null; this.ds = null; this.advisor = null; this.stats = null; }
protected String getLocalHost() { try { return SocketCreator.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException ignore) { return LOCALHOST; } }
private String getHost(){ try { InetAddress addr = SocketCreator.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException ex) { return ManagementConstants.DEFAULT_HOST_NAME; } }
ServerLocator() throws IOException { this.port = 10334; this.hostName = SocketCreator.getLocalHost().getCanonicalHostName(); this.hostNameForClients= this.hostName; this.logFile = null; this.memberName = null; this.ds = null; this.advisor = null; this.stats = null; }
/** get the IP literal name for the current host, use this instead of * "localhost" to avoid IPv6 name resolution bugs in the JDK/machine config. * @return an ip literal, this method honors java.net.preferIPvAddresses */ public static String getIPLiteral() { try { return SocketCreator.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { throw new Error("problem determining host IP address", e); } }
/** * Helper method to get the host name to bind to * * @return The InetAddress to bind to * @throws UnknownHostException */ private InetAddress getBindAddress() throws UnknownHostException { return this.bindAddress == null || this.bindAddress.isEmpty() ? SocketCreator.getLocalHost() : InetAddress.getByName(this.bindAddress); }
protected MemcachedClient createMemcachedClient() throws IOException, UnknownHostException { MemcachedClient client = new MemcachedClient(new InetSocketAddress( SocketCreator.getLocalHost(), PORT)); return client; } }
/** * Returns the path to this sampler's system directory; if it has one. */ @Override public final String getSystemDirectoryPath() { try { return SocketCreator.getHostName(SocketCreator.getLocalHost()); } catch (UnknownHostException ignore) { return ""; } }
protected String getMachineInfo() { String machineInfo = System.getProperty("os.arch"); try { String hostName = SocketCreator.getHostName(SocketCreator.getLocalHost()); machineInfo += " " + hostName; } catch (UnknownHostException ignore) { } return machineInfo; }
protected String getMachineInfo() { String machineInfo = System.getProperty("os.arch"); try { String hostName = SocketCreator.getHostName(SocketCreator.getLocalHost()); machineInfo += " " + hostName; } catch (UnknownHostException ignore) { } return machineInfo; }
/** * Returns the path to this sampler's system directory; if it has one. */ @Override public final String getSystemDirectoryPath() { try { return SocketCreator.getHostName(SocketCreator.getLocalHost()); } catch (UnknownHostException ignore) { return ""; } }
public void onConnect(InternalDistributedSystem sys) { try { stats.hookupStats(sys, SocketCreator.getLocalHost().getCanonicalHostName() + "-" + server.getBindAddress().toString()); } catch(UnknownHostException uhe) { uhe.printStackTrace(); } }
public void onConnect(InternalDistributedSystem sys) { try { stats.hookupStats(sys, SocketCreator.getLocalHost().getCanonicalHostName() + "-" + server.getBindAddress().toString()); } catch(UnknownHostException uhe) { uhe.printStackTrace(); } }
@Override protected MemcachedClient createMemcachedClient() throws IOException, UnknownHostException { List<InetSocketAddress> addrs = new ArrayList<InetSocketAddress>(); addrs.add(new InetSocketAddress(SocketCreator.getLocalHost(), PORT)); MemcachedClient client = new MemcachedClient(new BinaryConnectionFactory(), addrs); return client; }
public java.net.InetAddress getHost() { try { return SocketCreator.getLocalHost(); } catch (Exception ex) { throw new com.gemstone.gemfire.InternalGemFireException(LocalizedStrings.DistributedSystemHealthMonitor_COULD_NOT_GET_LOCALHOST.toLocalizedString()); } }
public java.net.InetAddress getHost() { try { return SocketCreator.getLocalHost(); } catch (Exception ex) { throw new com.gemstone.gemfire.InternalGemFireException(LocalizedStrings.DistributedSystemHealthMonitor_COULD_NOT_GET_LOCALHOST.toLocalizedString()); } }
private String getHost(final String bindAddress) throws UnknownHostException { if (!StringUtils.isBlank(this.config.getJmxManagerHostnameForClients())) { return this.config.getJmxManagerHostnameForClients(); } else if (!StringUtils.isBlank(bindAddress)) { return InetAddress.getByName(bindAddress).getHostAddress(); } else { return SocketCreator.getLocalHost().getHostAddress(); } }
private PoolFactory createDefaultPF() { PoolFactory defpf = PoolManager.createFactory(); try { String localHostName = SocketCreator.getHostName(SocketCreator.getLocalHost()); defpf.addServer(localHostName, CacheServer.DEFAULT_PORT); } catch (UnknownHostException ex) { throw new IllegalStateException("Could not determine local host name"); } return defpf; }
private PoolFactory createDefaultPF() { PoolFactory defpf = PoolManager.createFactory(); try { String localHostName = SocketCreator.getHostName(SocketCreator.getLocalHost()); defpf.addServer(localHostName, CacheServer.DEFAULT_PORT); } catch (UnknownHostException ex) { throw new IllegalStateException("Could not determine local host name"); } return defpf; }