private String getLocalHostname() throws SocketException { // this is removed because, NetworkUtils.getLocalHostname() would return the carbon.xml // hostname if provided. but in the spark environment, it would need a unique hostname DAS-171 // return NetworkUtils.getLocalHostname(); String localIP = System.getenv(AnalyticsConstants.SPARK_LOCAL_IP_PROP); if (localIP != null) { if (log.isDebugEnabled()) { log.debug("Spark host is set from the SPARK_LOCAL_IP property : " + localIP); } return localIP; } else { if (log.isDebugEnabled()) { log.debug("Spark host is set NOT set, hence using the node network interface"); } return org.apache.axis2.util.Utils.getIpAddress(); } } }
public static String getLocalHost(Parameter tcpListenHost){ String host = null; if (tcpListenHost != null) { host = ((String) tcpListenHost.getValue()).trim(); } else { try { host = Utils.getIpAddress(); } catch (SocketException e) { String msg = "Could not get local IP address"; log.error(msg, e); } } if (System.getProperty(ClusteringConstants.LOCAL_IP_ADDRESS) != null) { host = System.getProperty(ClusteringConstants.LOCAL_IP_ADDRESS); } return host; }
public static String getLocalHost(Parameter tcpListenHost){ String host = null; if (tcpListenHost != null) { host = ((String) tcpListenHost.getValue()).trim(); } else { try { host = Utils.getIpAddress(); } catch (SocketException e) { String msg = "Could not get local IP address"; log.error(msg, e); } } if (System.getProperty(ClusteringConstants.LOCAL_IP_ADDRESS) != null) { host = System.getProperty(ClusteringConstants.LOCAL_IP_ADDRESS); } return host; }
private String[] calculateEPRs() { try { String requestIP = org.apache.axis2.util.Utils.getIpAddress(getAxisConfiguration()); return calculateEPRs(requestIP); } catch (SocketException e) { log.error("Cannot get local IP address", e); } return new String[0]; }
private String[] calculateEPRs() { try { String requestIP = org.apache.axis2.util.Utils.getIpAddress(getAxisConfiguration()); return calculateEPRs(requestIP); } catch (SocketException e) { log.error("Cannot get local IP address", e); } return new String[0]; }
/** * First check whether the hostname parameter is there in AxisConfiguration (axis2.xml) , * if it is there then this will retun that as the host name , o.w will return the IP address. */ public static String getIpAddress(AxisConfiguration axisConfiguration) throws SocketException { if(axisConfiguration!=null){ Parameter param = axisConfiguration.getParameter(TransportListener.HOST_ADDRESS); if (param != null) { String hostAddress = ((String) param.getValue()).trim(); if(hostAddress!=null){ return hostAddress; } } } return getIpAddress(); }
@Override protected void doInit() throws AxisFault { DatagramDispatcherCallback callback = new DatagramDispatcherCallback() { public void receive(DatagramEndpoint endpoint, byte[] data, int length, DatagramOutTransportInfo outInfo) { workerPool.execute(new ProcessPacketTask(endpoint, data, length, outInfo)); } }; try { dispatcher = createDispatcher(callback); } catch (IOException ex) { throw new AxisFault("Unable to create selector", ex); } try { defaultIp = org.apache.axis2.util.Utils.getIpAddress(cfgCtx.getAxisConfiguration()); } catch (SocketException ex) { throw new AxisFault("Unable to determine the host's IP address", ex); } }
/** * First check whether the hostname parameter is there in AxisConfiguration (axis2.xml) , * if it is there then this will retun that as the host name , o.w will return the IP address. */ public static String getIpAddress(AxisConfiguration axisConfiguration) throws SocketException { if(axisConfiguration!=null){ Parameter param = axisConfiguration.getParameter(TransportListener.HOST_ADDRESS); if (param != null) { String hostAddress = ((String) param.getValue()).trim(); if(hostAddress!=null){ return hostAddress; } } } return getIpAddress(); }
@Override protected void doInit() throws AxisFault { DatagramDispatcherCallback callback = new DatagramDispatcherCallback() { public void receive(DatagramEndpoint endpoint, byte[] data, int length, DatagramOutTransportInfo outInfo) { workerPool.execute(new ProcessPacketTask(endpoint, data, length, outInfo)); } }; try { dispatcher = createDispatcher(callback); } catch (IOException ex) { throw new AxisFault("Unable to create selector", ex); } try { defaultIp = org.apache.axis2.util.Utils.getIpAddress(cfgCtx.getAxisConfiguration()); } catch (SocketException ex) { throw new AxisFault("Unable to determine the host's IP address", ex); } }
@Override public EndpointReference[] getEndpointReferences(AxisService service, String ip) throws AxisFault { if (ip == null) { try { ip = Utils.getIpAddress(getListener().getConfigurationContext().getAxisConfiguration()); } catch (SocketException ex) { throw new AxisFault("Unable to determine the host's IP address", ex); } } StringBuilder epr = new StringBuilder("udp://"); epr.append(ip); epr.append(':'); epr.append(getPort()); // If messages are predispatched to a service, then WS-Addressing will be used and we // need to include the service path in the EPR. if (getService() == null) { epr.append('/'); epr.append(getConfigurationContext().getServiceContextPath()); epr.append('/'); epr.append(service.getName()); } epr.append("?contentType="); epr.append(getContentType()); return new EndpointReference[] { new EndpointReference(epr.toString()) }; } }
@Override public EndpointReference[] getEndpointReferences(AxisService service, String ip) throws AxisFault { if (ip == null) { try { ip = Utils.getIpAddress(getListener().getConfigurationContext().getAxisConfiguration()); } catch (SocketException ex) { throw new AxisFault("Unable to determine the host's IP address", ex); } } StringBuilder epr = new StringBuilder("udp://"); epr.append(ip); epr.append(':'); epr.append(getPort()); // If messages are predispatched to a service, then WS-Addressing will be used and we // need to include the service path in the EPR. if (getService() == null) { epr.append('/'); epr.append(getConfigurationContext().getServiceContextPath()); epr.append('/'); epr.append(service.getName()); } epr.append("?contentType="); epr.append(getContentType()); return new EndpointReference[] { new EndpointReference(epr.toString()) }; } }
@Override public EndpointReference[] getEndpointReferences(AxisService service, String ip) throws AxisFault { if (ip == null) { try { ip = Utils.getIpAddress(getListener().getConfigurationContext().getAxisConfiguration()); } catch (SocketException ex) { throw new AxisFault("Unable to determine the host's IP address", ex); } } StringBuilder epr = new StringBuilder("udp://"); epr.append(ip); epr.append(':'); epr.append(getPort()); // If messages are predispatched to a service, then WS-Addressing will be used and we // need to include the service path in the EPR. if (getService() == null) { epr.append('/'); epr.append(getConfigurationContext().getServiceContextPath()); epr.append('/'); epr.append(service.getName()); } epr.append("?contentType="); epr.append(getContentType()); return new EndpointReference[] { new EndpointReference(epr.toString()) }; } }
if (ip == null){ try { ip = Utils.getIpAddress(configurationContext.getAxisConfiguration()); } catch (SocketException ex) { AxisFault.makeFault(ex);
if (ip == null){ try { ip = Utils.getIpAddress(configurationContext.getAxisConfiguration()); } catch (SocketException ex) { AxisFault.makeFault(ex);
Map<String, String> map = new HashMap<String, String>((Map) properties); Registry registry = new JCRRegistry(new URI(map.get(ORG_APACHE_JACKRABBIT_REPOSITORY_URI)),map.get(JCR_CLASS),map.get(JCR_USER),map.get(JCR_PASS), map); String localAddress = Utils.getIpAddress(context.getAxisConfiguration()); TransportInDescription transportInDescription = context.getAxisConfiguration().getTransportsIn() .get("http");
public EndpointReference[] getEndpointReferences(AxisService service, String ip) throws AxisFault { if (host == null && ip == null) { try { ip = Utils.getIpAddress(getListener().getConfigurationContext(). getAxisConfiguration()); } catch (SocketException ex) { throw new AxisFault("Unable to determine the host's IP address", ex); } } String url = "tcp://" + (host != null ? host : ip) + ":" + port; String context = getListener().getConfigurationContext().getServiceContextPath(); url += (context.startsWith("/") ? "" : "/") + context + (context.endsWith("/") ? "" : "/") + (getService() == null ? service.getName() : getServiceName()); if (!contentType.equals(TCPConstants.TCP_DEFAULT_CONTENT_TYPE)) { url += "?contentType=" + contentType; } return new EndpointReference[] { new EndpointReference(url) }; }
public EndpointReference[] getEndpointReferences(AxisService service, String ip) throws AxisFault { if (host == null && ip == null) { try { ip = Utils.getIpAddress(getListener().getConfigurationContext(). getAxisConfiguration()); } catch (SocketException ex) { throw new AxisFault("Unable to determine the host's IP address", ex); } } String url = "tcp://" + (host != null ? host : ip) + ":" + port; String context = getListener().getConfigurationContext().getServiceContextPath(); url += (context.startsWith("/") ? "" : "/") + context + (context.endsWith("/") ? "" : "/") + (getService() == null ? service.getName() : getServiceName()); if (!contentType.equals(TCPConstants.TCP_DEFAULT_CONTENT_TYPE)) { url += "?contentType=" + contentType; } return new EndpointReference[] { new EndpointReference(url) }; }
ip = hostIP; } else { ip = Utils.getIpAddress(axisConfiguration);
ip = hostIP; } else { ip = Utils.getIpAddress(axisConfiguration);
String host; try { host = Utils.getIpAddress(); } catch (SocketException e) { String msg = "Could not get local IP address";