protected ServiceUnit createServiceUnit(String name, String rootPath) { DefaultServiceUnit su = new DefaultServiceUnit(); su.setComponent(component); su.setName(name); su.setRootPath(rootPath); return su; }
protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception { // We receive an exchange for an EPR that has not been used yet. // Register a provider endpoint and restart processing. JmsEndpoint jmsEp = new JmsEndpoint(true); jmsEp.setServiceUnit(new DefaultServiceUnit(component)); jmsEp.setService(ep.getServiceName()); jmsEp.setEndpoint(ep.getEndpointName()); jmsEp.setRole(MessageExchange.Role.PROVIDER); URI uri = new URI(ep.getEndpointName()); Map map = URISupport.parseQuery(uri.getQuery()); if (IntrospectionSupport.setProperties(jmsEp, map, "jms.")) { uri = URISupport.createRemainingURI(uri, map); } if (uri.getPath() != null) { String path = uri.getSchemeSpecificPart(); while (path.startsWith("/")) { path = path.substring(1); } if (path.startsWith(AbstractJmsProcessor.STYLE_QUEUE + "/")) { jmsEp.setDestinationStyle(AbstractJmsProcessor.STYLE_QUEUE); jmsEp.setJmsProviderDestinationName(path.substring(AbstractJmsProcessor.STYLE_QUEUE.length() + 1)); } else if (path.startsWith(AbstractJmsProcessor.STYLE_TOPIC + "/")) { jmsEp.setDestinationStyle(AbstractJmsProcessor.STYLE_TOPIC); jmsEp.setJmsProviderDestinationName(path.substring(AbstractJmsProcessor.STYLE_TOPIC.length() + 1)); } } return jmsEp; }
protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception { // We receive an exchange for an EPR that has not been used yet. // Register a provider endpoint and restart processing. HttpEndpoint httpEp = new HttpEndpoint(true); httpEp.setServiceUnit(new DefaultServiceUnit(component)); httpEp.setService(ep.getServiceName()); httpEp.setEndpoint(ep.getEndpointName()); httpEp.setRole(MessageExchange.Role.PROVIDER); URI uri = new URI(ep.getEndpointName()); Map map = URISupport.parseQuery(uri.getQuery()); if (IntrospectionSupport.setProperties(httpEp, map, "http.")) { uri = URISupport.createRemainingURI(uri, map); } if (httpEp.getLocationURI() == null) { httpEp.setLocationURI(uri.toString()); } return httpEp; }