public String getMgmtAddress() { return NetworkUtils.formatPossibleIpv6Address(mgmtAddress); }
public String getMgmtAddress() { return NetworkUtils.formatPossibleIpv6Address(mgmtAddress); }
public String getMgmtAddress() { return NetworkUtils.formatPossibleIpv6Address(mgmtAddress); }
public String getMgmtAddress() { return NetworkUtils.formatPossibleIpv6Address(mgmtAddress); }
public JMXServiceURL getRemoteJMXURL() { try { return new JMXServiceURL("service:jmx:remoting-jmx://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } catch (Exception e) { throw new RuntimeException("Could not create JMXServiceURL:" + this, e); } }
public JMXServiceURL getRemoteJMXURL() { try { if ("http-remoting".equals(mgmtProtocol) || "remote+http".equals(mgmtProtocol)) { return new JMXServiceURL("service:jmx:remote+http://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } else if (mgmtProtocol.equals("https-remoting")) { return new JMXServiceURL("service:jmx:remote+https://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } else { return new JMXServiceURL("service:jmx:remoting-jmx://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } } catch (Exception e) { throw new RuntimeException("Could not create JMXServiceURL:" + this, e); } }
public JMXServiceURL getRemoteJMXURL() { try { if (mgmtProtocol.equals("http-remoting")) { return new JMXServiceURL("service:jmx:http-remoting-jmx://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } else if (mgmtProtocol.equals("https-remoting")) { return new JMXServiceURL("service:jmx:https-remoting-jmx://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } else { return new JMXServiceURL("service:jmx:remoting-jmx://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } } catch (Exception e) { throw new RuntimeException("Could not create JMXServiceURL:" + this, e); } }
public JMXServiceURL getRemoteJMXURL() { try { if ("http-remoting".equals(mgmtProtocol) || "remote+http".equals(mgmtProtocol)) { return new JMXServiceURL("service:jmx:remote+http://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } else if (mgmtProtocol.equals("https-remoting")) { return new JMXServiceURL("service:jmx:remote+https://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } else { return new JMXServiceURL("service:jmx:remoting-jmx://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort); } } catch (Exception e) { throw new RuntimeException("Could not create JMXServiceURL:" + this, e); } }
public MBeanServerConnection getConnection() { String host = hostAddr.getHostAddress(); String urlString = System.getProperty("jmx.service.url", "service:jmx:remote+http://" + NetworkUtils.formatPossibleIpv6Address(host) + ":" + port); try { if (jmxConnector == null) { log.debug("Connecting JMXConnector to: " + urlString); JMXServiceURL serviceURL = new JMXServiceURL(urlString); jmxConnector = JMXConnectorFactory.connect(serviceURL, null); } return jmxConnector.getMBeanServerConnection(); } catch (IOException ex) { throw new IllegalStateException("Cannot obtain MBeanServerConnection to: " + urlString, ex); } }
public MBeanServerConnection getConnection() { String host = hostAddr.getHostAddress(); String urlString = System.getProperty("jmx.service.url", "service:jmx:rmi:///jndi/rmi://" + NetworkUtils.formatPossibleIpv6Address(host) + ":" + port + "/jmxrmi"); try { if (jmxConnector == null) { log.debug("Connecting JMXConnector to: " + urlString); JMXServiceURL serviceURL = new JMXServiceURL(urlString); jmxConnector = JMXConnectorFactory.connect(serviceURL, null); } return jmxConnector.getMBeanServerConnection(); } catch (IOException ex) { throw new IllegalStateException("Cannot obtain MBeanServerConnection to: " + urlString, ex); } }
public MBeanServerConnection getConnection() { String host = hostAddr.getHostAddress(); String urlString = System.getProperty("jmx.service.url", "service:jmx:rmi:///jndi/rmi://" + NetworkUtils.formatPossibleIpv6Address(host) + ":" + port + "/jmxrmi"); try { if (jmxConnector == null) { log.debug("Connecting JMXConnector to: " + urlString); JMXServiceURL serviceURL = new JMXServiceURL(urlString); jmxConnector = JMXConnectorFactory.connect(serviceURL, null); } return jmxConnector.getMBeanServerConnection(); } catch (IOException ex) { throw new IllegalStateException("Cannot obtain MBeanServerConnection to: " + urlString, ex); } }
public MBeanServerConnection getConnection() { String host = hostAddr.getHostAddress(); String urlString = System.getProperty("jmx.service.url", "service:jmx:remote+http://" + NetworkUtils.formatPossibleIpv6Address(host) + ":" + port); try { if (jmxConnector == null) { log.debug("Connecting JMXConnector to: " + urlString); JMXServiceURL serviceURL = new JMXServiceURL(urlString); jmxConnector = JMXConnectorFactory.connect(serviceURL, null); } return jmxConnector.getMBeanServerConnection(); } catch (IOException ex) { throw new IllegalStateException("Cannot obtain MBeanServerConnection to: " + urlString, ex); } }
private URI getBinding(final String protocol, final String socketBinding) { try { final String socketBindingGroupName = rootNode.get("socket-binding-group").keys().iterator().next(); final ModelNode operation = new ModelNode(); operation.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName); operation.get(OP_ADDR).get("socket-binding").set(socketBinding); operation.get(OP).set(READ_RESOURCE_OPERATION); operation.get("include-runtime").set(true); ModelNode binding = executeForResult(operation); String ip = binding.get("bound-address").asString(); //it appears some system can return a binding with the zone specifier on the end if (ip.contains(":") && ip.contains("%")) { ip = ip.split("%")[0]; } final int port = defined(binding.get("bound-port"), socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt(); return URI.create(protocol + "://" + NetworkUtils.formatPossibleIpv6Address(ip) + ":" + port); } catch (Exception e) { throw new RuntimeException(e); } }
private URI getBinding(final String protocol, final String socketBinding) { try { //TODO: resolve socket binding group correctly final String socketBindingGroupName = rootNode.get("socket-binding-group").keys().iterator().next(); final ModelNode operation = new ModelNode(); operation.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName); operation.get(OP_ADDR).get("socket-binding").set(socketBinding); operation.get(OP).set(READ_ATTRIBUTE_OPERATION); operation.get(NAME).set("bound-address"); String ip = executeForResult(operation).asString(); //it appears some system can return a binding with the zone specifier on the end if(ip.contains(":") && ip.contains("%")) { ip = ip.split("%")[0]; } final ModelNode portOp = new ModelNode(); portOp.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName); portOp.get(OP_ADDR).get("socket-binding").set(socketBinding); portOp.get(OP).set(READ_ATTRIBUTE_OPERATION); portOp.get(NAME).set("bound-port"); final int port = defined(executeForResult(portOp), socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt(); return URI.create(protocol + "://" + NetworkUtils.formatPossibleIpv6Address(ip) + ":" + port); } catch (Exception e) { throw new RuntimeException(e); } }
return URI.create(protocol + "://" + NetworkUtils.formatPossibleIpv6Address(host) + ":" + port); } catch (Exception e) { throw new RuntimeException(e);
return URI.create(protocol + "://" + NetworkUtils.formatPossibleIpv6Address(host) + ":" + port); } catch (Exception e) { throw new RuntimeException(e);