/** * 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 protected final void startListeningForService(AxisService service) throws AxisFault { E endpoint = createEndpoint(); endpoint.init(this, service); if (endpoint.loadConfiguration(service)) { startEndpoint(endpoint); serviceEndpoints.add(endpoint); } else if (globalEndpoint != null) { return; } else { throw new AxisFault("Service doesn't have configuration information for transport " + getTransportName()); } }
@Override public void destroy() { super.destroy(); timer.cancel(); timer = null; }
@Override public final void init(ConfigurationContext cfgCtx, TransportInDescription transportIn) throws AxisFault { super.init(cfgCtx, transportIn); doInit(); // Create endpoint configured at transport level (if available) E endpoint = createEndpoint(); endpoint.init(this, null); if (endpoint.loadConfiguration(transportIn)) { globalEndpoint = endpoint; } }
@Override public void start() throws AxisFault { super.start(); // Explicitly start the endpoint configured at the transport level. All other endpoints will // be started by startListeningForService. if (globalEndpoint != null) { startEndpoint(globalEndpoint); } }
@Override public boolean loadConfiguration(ParameterInclude params) throws AxisFault { contentType = ParamUtils.getRequiredParam( params, "transport." + getListener().getTransportName() + ".contentType"); return true; } }
public MessageContext createMessageContext() throws AxisFault { MessageContext msgContext = listener.createMessageContext(); if (service != null) { msgContext.setAxisService(service); // find the operation for the message, or default to one Parameter operationParam = service.getParameter(BaseConstants.OPERATION_PARAM); QName operationQName = ( operationParam != null ? BaseUtils.getQNameFromString(operationParam.getValue()) : BaseConstants.DEFAULT_OPERATION); AxisOperation operation = service.getOperation(operationQName); if (operation != null) { msgContext.setAxisOperation(operation); msgContext.setAxisMessage( operation.getMessage(WSDL2Constants.MESSAGE_LABEL_IN)); msgContext.setSoapAction("urn:" + operation.getName().getLocalPart()); } } return msgContext; } }
@Override public final void init(ConfigurationContext cfgCtx, TransportInDescription transportIn) throws AxisFault { super.init(cfgCtx, transportIn); doInit(); // Create endpoint configured at transport level (if available) E endpoint = createEndpoint(); endpoint.init(this, null); if (endpoint.loadConfiguration(transportIn)) { globalEndpoint = endpoint; } }
@Override public void start() throws AxisFault { super.start(); // Explicitly start the endpoint configured at the transport level. All other endpoints will // be started by startListeningForService. if (globalEndpoint != null) { startEndpoint(globalEndpoint); } }
@Override public boolean loadConfiguration(ParameterInclude params) throws AxisFault { contentType = ParamUtils.getRequiredParam( params, "transport." + getListener().getTransportName() + ".contentType"); return true; } }
public MessageContext createMessageContext() throws AxisFault { MessageContext msgContext = listener.createMessageContext(); if (service != null) { msgContext.setAxisService(service); // find the operation for the message, or default to one Parameter operationParam = service.getParameter(BaseConstants.OPERATION_PARAM); QName operationQName = ( operationParam != null ? BaseUtils.getQNameFromString(operationParam.getValue()) : BaseConstants.DEFAULT_OPERATION); AxisOperation operation = service.getOperation(operationQName); if (operation != null) { msgContext.setAxisOperation(operation); msgContext.setAxisMessage( operation.getMessage(WSDL2Constants.MESSAGE_LABEL_IN)); msgContext.setSoapAction("urn:" + operation.getName().getLocalPart()); } } return msgContext; } }
/** * 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 protected final void startListeningForService(AxisService service) throws AxisFault { E endpoint = createEndpoint(); endpoint.init(this, service); if (endpoint.loadConfiguration(service)) { startEndpoint(endpoint); serviceEndpoints.add(endpoint); } else if (globalEndpoint != null) { return; } else { throw new AxisFault("Service doesn't have configuration information for transport " + getTransportName()); } }
@Override public void destroy() { super.destroy(); timer.cancel(); timer = null; }
@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 void destroy() { super.destroy(); try { dispatcher.stop(); } catch (IOException ex) { log.error("Failed to stop dispatcher", ex); } }
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 void destroy() { super.destroy(); try { dispatcher.stop(); } catch (IOException ex) { log.error("Failed to stop dispatcher", 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()) }; } }
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) }; }