public List<Endpoint> query(Map<String, ?> properties) { return registry.query(properties); }
protected List<Endpoint> doQueryEndpoints(Map<String, Object> props, boolean external) { if (props == null) { props = new HashMap<String, Object>(); } props.put(external ? EXTERNAL_ENDPOINT : INTERNAL_ENDPOINT, Boolean.TRUE.toString()); List<Endpoint> endpoints = getNmr().getEndpointRegistry().query(props); return endpoints; }
public ServiceEndpoint getEndpoint(QName serviceName, String endpointName) { Map<String, Object> props = new HashMap<String, Object>(); props.put(Endpoint.SERVICE_NAME, serviceName.toString()); props.put(Endpoint.ENDPOINT_NAME, endpointName); props.put(INTERNAL_ENDPOINT, Boolean.TRUE.toString()); List<Endpoint> endpoints = getNmr().getEndpointRegistry().query(props); if (endpoints.isEmpty()) { return null; } Map<String, ?> p = getNmr().getEndpointRegistry().getProperties(endpoints.get(0)); return new ServiceEndpointImpl(p); }
protected Channel getChannelToUse(InternalExchange exchange) { Channel channelToUse = channel; if (exchange.getSource() == null) { // We need to look up the channel corresponding to the sender endpoint try { String sender = (String) exchange.getProperty(SENDER_ENDPOINT); if (sender != null) { int idx = sender.lastIndexOf(':'); String svc = sender.substring(0, idx); String ep = sender.substring(idx + 1); Map<String, Object> props = ServiceHelper.createMap(Endpoint.SERVICE_NAME, svc, Endpoint.ENDPOINT_NAME, ep); // TODO: we may be using the wrong channel if both an internal endpoint and an external endpoint // have been registered with the same svc / ep name List<Endpoint> eps = channel.getNMR().getEndpointRegistry().query(props); if (eps != null && eps.size() == 1) { channelToUse = ((InternalEndpoint) eps.get(0)).getChannel(); } } } catch (Throwable t) { // Ignore } } else { channelToUse = exchange.getSource().getChannel(); } return channelToUse; }