if (uri.startsWith("interface:")) { String u = this.uri.substring(10); String[] parts = split2(u); return context.getEndpoints(new QName(parts[0], parts[1])); } else if (uri.startsWith("operation:")) { String[] parts = split3(u); return context.getEndpoints(new QName(parts[0], parts[1])); } else if (uri.startsWith("service:")) { String u = this.uri.substring(8); String[] parts = split2(u); return context.getEndpointsForService(new QName(parts[0], parts[1])); } else if (uri.startsWith("endpoint:")) { String u = this.uri.substring(9); String[] parts = split3(u); ServiceEndpoint se = context.getEndpoint(new QName(parts[0], parts[1]), parts[2]); if (se != null) { DocumentFragment epr = createWSAEPR(uri); ServiceEndpoint se = context.resolveEndpointReference(epr); if (se != null) {
/** * Used by POJOs acting as a consumer * @param uri * @param message * @return */ public Future<NormalizedMessage> send(String uri, NormalizedMessage message) { try { InOut me = getExchangeFactory().createInOutExchange(); URIResolver.configureExchange(me, getServiceUnit().getComponent().getComponentContext(), uri); MessageUtil.transferTo(message, me, "in"); final Holder h = new Holder(); getOrCreateCurrentRequest(me).addExchange(me); exchanges.put(me.getExchangeId(), h); BeanEndpoint.this.send(me); return h; } catch (Exception e) { throw new RuntimeException(e); } }
String[] parts = URIResolver.split3(value); MessageExchange exchange = message.getContent(MessageExchange.class); exchange.setOperation(new QName(parts[0], parts[2])); if (toAddress != null && toAddress.endsWith(CxfJbiConstants.JBI_SUFFIX)) { toAddress = toAddress.substring(0, toAddress.indexOf(CxfJbiConstants.JBI_SUFFIX) - 1); String[] parts = URIResolver.split3(toAddress); MessageExchange exchange = message.getContent(MessageExchange.class); exchange.setService(new QName(parts[0], parts[1]));
public ResolvedEndpoint(String uri, QName serviceName) { this(URIResolver.createWSAEPR(uri), uri, serviceName); }
private MessageExchange prepareMessageExchange(Exchange exchange) throws MessagingException, URISyntaxException { MessageExchange messageExchange = binding.makeJbiMessageExchange(exchange, getExchangeFactory(), jbiEndpoint.getMep()); if (jbiEndpoint.getOperation() != null) { messageExchange.setOperation(jbiEndpoint.getOperation()); } URIResolver.configureExchange(messageExchange, getContext(), jbiEndpoint.getDestinationUri()); return messageExchange; }
String[] parts = URIResolver.split3(action); itf = new QName(parts[0], parts[1]); op = new QName(parts[0], parts[2]); } else if (WSAddressingConstants.EL_TO.equals(qname.getLocalPart())) { String to = getHeaderText(message.getSoapHeaders().get(qname)); String[] parts = URIResolver.split3(to); svc = new QName(parts[0], parts[1]); ep = parts[2];
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange, ComponentContext context) throws MessagingException { if (interf == null && service == null && uri == null) { throw new MessagingException("interface, service or uri should be specified"); } if (uri != null) { URIResolver.configureExchange(exchange, context, uri); } if (interf != null) { exchange.setInterfaceName(interf); } if (operation != null) { exchange.setOperation(operation); } if (service != null) { exchange.setService(service); if (endpoint != null) { ServiceEndpoint se = context.getEndpoint(service, endpoint); exchange.setEndpoint(se); } } }
String[] parts = URIResolver.split2(uri2); exchange.setInterfaceName(new QName(parts[0], parts[1])); } else if (uri.startsWith("operation:")) { String uri2 = uri.substring(10); String[] parts = URIResolver.split3(uri2); exchange.setInterfaceName(new QName(parts[0], parts[1])); exchange.setOperation(new QName(parts[0], parts[2])); } else if (uri.startsWith("service:")) { String uri2 = uri.substring(8); String[] parts = URIResolver.split2(uri2); exchange.setService(new QName(parts[0], parts[1])); } else if (uri.startsWith("endpoint:")) { String uri2 = uri.substring(9); String[] parts = URIResolver.split3(uri2); ServiceEndpoint se = context.getEndpoint(new QName(parts[0], parts[1]), parts[2]); exchange.setEndpoint(se); } else { DocumentFragment epr = URIResolver.createWSAEPR(uri); ServiceEndpoint se = context.resolveEndpointReference(epr); exchange.setEndpoint(se);
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange, ComponentContext context) throws MessagingException { if (interf == null && service == null && uri == null) { throw new MessagingException("interface, service or uri should be specified"); } if (uri != null) { URIResolver.configureExchange(exchange, context, uri); } if (interf != null) { exchange.setInterfaceName(interf); } if (operation != null) { exchange.setOperation(operation); } if (service != null) { exchange.setService(service); if (endpoint != null) { ServiceEndpoint se = context.getEndpoint(service, endpoint); exchange.setEndpoint(se); } } }
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange, ComponentContext context) throws MessagingException { if (interf == null && service == null && uri == null) { throw new MessagingException("interface, service or uri should be specified"); } if (uri != null) { URIResolver.configureExchange(exchange, context, uri); } if (interf != null) { exchange.setInterfaceName(interf); } if (operation != null) { exchange.setOperation(operation); } if (service != null) { exchange.setService(service); if (endpoint != null) { ServiceEndpoint se = context.getEndpoint(service, endpoint); exchange.setEndpoint(se); } } }
protected void configureExchangeTarget(MessageExchange exchange) { if (targetUri != null) { URIResolver.configureExchange(exchange, getContext(), targetUri); } if (exchange.getInterfaceName() == null && targetInterface != null) { exchange.setInterfaceName(targetInterface); } if (exchange.getOperation() == null && targetOperation != null) { exchange.setOperation(targetOperation); } if (exchange.getService() == null && targetService != null) { exchange.setService(targetService); if (targetEndpoint != null) { ServiceEndpoint se = getContext().getEndpoint(targetService, targetEndpoint); if (se != null) { exchange.setEndpoint(se); } else { logger.warn("Target service (" + targetService + ") and endpoint (" + targetEndpoint + ")" + " specified, but no matching endpoint found. Only the service will be used for routing."); } } } }
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange) throws MessagingException { if (targetInterface == null && targetService == null && targetUri == null) { throw new MessagingException("target's interface, service or uri should be specified"); } if (targetUri != null) { URIResolver.configureExchange(exchange, getContext(), targetUri); } if (targetInterface != null) { exchange.setInterfaceName(targetInterface); } if (targetOperation != null) { exchange.setOperation(targetOperation); } if (targetService != null) { exchange.setService(targetService); if (targetEndpoint != null) { ServiceEndpoint se = getContext().getEndpoint(targetService, targetEndpoint); exchange.setEndpoint(se); } } }