@Override public void onServiceAdd(DiscoveryEvent event) { String url = event.getServiceName(); if (url != null) { try { URI uri = new URI(url); LOG.info("Adding new broker connection URL: " + uri); uri = URISupport.applyParameters(uri, parameters, DISCOVERED_OPTION_PREFIX); serviceURIs.put(event.getServiceName(), uri); next.add(false,new URI[] {uri}); } catch (URISyntaxException e) { LOG.warn("Could not connect to remote URI: " + url + " due to bad URI syntax: " + e, e); } } }
@Override public void onServiceRemove(DiscoveryEvent event) { URI uri = serviceURIs.get(event.getServiceName()); if (uri != null) { next.remove(false,new URI[] {uri}); } }
@Override public void start() throws Exception { if (discoveryAgent == null) { throw new IllegalStateException("discoveryAgent not configured"); } // lets pass into the agent the broker name and connection details discoveryAgent.setDiscoveryListener(this); discoveryAgent.start(); next.start(); }
private Transport createRemoteTransport(final Transport local) throws Exception { Transport transport = TransportFactory.compositeConnect(remote); CompositeTransport ct = transport.narrow(CompositeTransport.class); if (ct != null && localUri != null && proxyToLocalBroker) { ct.add(false, new URI[] { localUri }); } // Add a transport filter so that we can track the transport life cycle transport = new TransportFilter(transport) { @Override public void stop() throws Exception { LOG.info("Stopping proxy."); super.stop(); ProxyConnection dummy = new ProxyConnection(local, this); LOG.debug("Removing proxyConnection {}", dummy.toString()); connections.remove(dummy); } }; return transport; }
@Override public void start() throws Exception { if (discoveryAgent == null) { throw new IllegalStateException("discoveryAgent not configured"); } // lets pass into the agent the broker name and connection details discoveryAgent.setDiscoveryListener(this); discoveryAgent.start(); next.start(); }
@Override public void onServiceRemove(DiscoveryEvent event) { URI uri = serviceURIs.get(event.getServiceName()); if (uri != null) { next.remove(false,new URI[] {uri}); } }
public void onServiceAdd(DiscoveryEvent event) { String url = event.getServiceName(); if (url != null) { try { URI uri = new URI(url); LOG.info("Adding new broker connection URL: " + uri); uri = URISupport.applyParameters(uri, parameters, DISCOVERED_OPTION_PREFIX); serviceURIs.put(event.getServiceName(), uri); next.add(false,new URI[] {uri}); } catch (URISyntaxException e) { LOG.warn("Could not connect to remote URI: " + url + " due to bad URI syntax: " + e, e); } } }
@Override public void start() throws Exception { if (discoveryAgent == null) { throw new IllegalStateException("discoveryAgent not configured"); } // lets pass into the agent the broker name and connection details discoveryAgent.setDiscoveryListener(this); discoveryAgent.start(); next.start(); }
@Override public void onServiceRemove(DiscoveryEvent event) { URI uri = serviceURIs.get(event.getServiceName()); if (uri != null) { next.remove(false,new URI[] {uri}); } }
@Override public void onServiceAdd(DiscoveryEvent event) { String url = event.getServiceName(); if (url != null) { try { URI uri = new URI(url); LOG.info("Adding new broker connection URL: " + uri); uri = URISupport.applyParameters(uri, parameters, DISCOVERED_OPTION_PREFIX); serviceURIs.put(event.getServiceName(), uri); next.add(false,new URI[] {uri}); } catch (URISyntaxException e) { LOG.warn("Could not connect to remote URI: " + url + " due to bad URI syntax: " + e, e); } } }
@Override public void start() throws Exception { if (discoveryAgent == null) { throw new IllegalStateException("discoveryAgent not configured"); } // lets pass into the agent the broker name and connection details discoveryAgent.setDiscoveryListener(this); discoveryAgent.start(); next.start(); }
@Override public void onServiceRemove(DiscoveryEvent event) { URI uri = serviceURIs.get(event.getServiceName()); if (uri != null) { next.remove(false,new URI[] {uri}); } }
@Override public void onServiceAdd(DiscoveryEvent event) { String url = event.getServiceName(); if (url != null) { try { URI uri = new URI(url); LOG.info("Adding new broker connection URL: " + uri); uri = URISupport.applyParameters(uri, parameters, DISCOVERED_OPTION_PREFIX); serviceURIs.put(event.getServiceName(), uri); next.add(false,new URI[] {uri}); } catch (URISyntaxException e) { LOG.warn("Could not connect to remote URI: " + url + " due to bad URI syntax: " + e, e); } } }
@Override public void start() throws Exception { if (discoveryAgent == null) { throw new IllegalStateException("discoveryAgent not configured"); } // lets pass into the agent the broker name and connection details discoveryAgent.setDiscoveryListener(this); discoveryAgent.start(); next.start(); }
public void onServiceRemove(DiscoveryEvent event) { URI uri = serviceURIs.get(event.getServiceName()); if (uri != null) { next.remove(false,new URI[] {uri}); } }
@Override public void onServiceAdd(DiscoveryEvent event) { String url = event.getServiceName(); if (url != null) { try { URI uri = new URI(url); LOG.info("Adding new broker connection URL: " + uri); uri = URISupport.applyParameters(uri, parameters, DISCOVERED_OPTION_PREFIX); serviceURIs.put(event.getServiceName(), uri); next.add(false,new URI[] {uri}); } catch (URISyntaxException e) { LOG.warn("Could not connect to remote URI: " + url + " due to bad URI syntax: " + e, e); } } }
private Transport createRemoteTransport() throws Exception { Transport transport = TransportFactory.compositeConnect(remote); CompositeTransport ct = transport.narrow(CompositeTransport.class); if (ct != null && localUri != null && proxyToLocalBroker) { ct.add(false,new URI[] {localUri}); } // Add a transport filter so that we can track the transport life cycle transport = new TransportFilter(transport) { @Override public void stop() throws Exception { LOG.info("Stopping proxy."); super.stop(); connections.remove(this); } }; return transport; }
private Transport createRemoteTransport(final Transport local) throws Exception { Transport transport = TransportFactory.compositeConnect(remote); CompositeTransport ct = transport.narrow(CompositeTransport.class); if (ct != null && localUri != null && proxyToLocalBroker) { ct.add(false, new URI[] { localUri }); } // Add a transport filter so that we can track the transport life cycle transport = new TransportFilter(transport) { @Override public void stop() throws Exception { LOG.info("Stopping proxy."); super.stop(); ProxyConnection dummy = new ProxyConnection(local, this); LOG.debug("Removing proxyConnection {}", dummy.toString()); connections.remove(dummy); } }; return transport; }
private Transport createRemoteTransport(final Transport local) throws Exception { Transport transport = TransportFactory.compositeConnect(remote); CompositeTransport ct = transport.narrow(CompositeTransport.class); if (ct != null && localUri != null && proxyToLocalBroker) { ct.add(false, new URI[] { localUri }); } // Add a transport filter so that we can track the transport life cycle transport = new TransportFilter(transport) { @Override public void stop() throws Exception { LOG.info("Stopping proxy."); super.stop(); ProxyConnection dummy = new ProxyConnection(local, this); LOG.debug("Removing proxyConnection {}", dummy.toString()); connections.remove(dummy); } }; return transport; }
private Transport createRemoteTransport(final Transport local) throws Exception { Transport transport = TransportFactory.compositeConnect(remote); CompositeTransport ct = transport.narrow(CompositeTransport.class); if (ct != null && localUri != null && proxyToLocalBroker) { ct.add(false, new URI[] { localUri }); } // Add a transport filter so that we can track the transport life cycle transport = new TransportFilter(transport) { @Override public void stop() throws Exception { LOG.info("Stopping proxy."); super.stop(); ProxyConnection dummy = new ProxyConnection(local, this); LOG.debug("Removing proxyConnection {}", dummy.toString()); connections.remove(dummy); } }; return transport; }