/** * Get the Axis2 configuration context. This is a convenience method that can be used by * subclasses to get the {@link ConfigurationContext} object from the listener. * * @return the configuration context */ protected final ConfigurationContext getConfigurationContext() { return listener.getConfigurationContext(); }
/** * Get the Axis2 configuration context. This is a convenience method that can be used by * subclasses to get the {@link ConfigurationContext} object from the listener. * * @return the configuration context */ protected final ConfigurationContext getConfigurationContext() { return listener.getConfigurationContext(); }
@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()) }; } }
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) }; }
@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()) }; } }
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) }; }
@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()) }; } }
public void startServer() throws IOException { if (serverSocket == null) { if (endpoint.getHost() != null) { InetAddress address = InetAddress.getByName(endpoint.getHost()); serverSocket = new ServerSocket(endpoint.getPort(), endpoint.getBacklog(), address); } else { serverSocket = new ServerSocket(endpoint.getPort(), endpoint.getBacklog()); } } started = true; endpoint.getListener().getConfigurationContext().getThreadPool().execute(this); log.info("TCP server started on port : " + endpoint.getPort()); }
public void startServer() throws IOException { if (serverSocket == null) { if (endpoint.getHost() != null) { InetAddress address = InetAddress.getByName(endpoint.getHost()); serverSocket = new ServerSocket(endpoint.getPort(), endpoint.getBacklog(), address); } else { serverSocket = new ServerSocket(endpoint.getPort(), endpoint.getBacklog()); } } started = true; endpoint.getListener().getConfigurationContext().getThreadPool().execute(this); log.info("TCP server started on port : " + endpoint.getPort()); }