/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception { NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress); return addNetworkConnector(connector); }
/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception { NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress); return addNetworkConnector(connector); }
/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception { NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress); return addNetworkConnector(connector); }
/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception { NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress); return addNetworkConnector(connector); }
private NetworkConnector createNetworkConnector(URI uri,Properties properties) throws URISyntaxException, IOException { NetworkConnector nc = new DiscoveryNetworkConnector(uri); Map<String, Object> networkProperties = new HashMap<String, Object>(); // use default credentials for network connector (if none was specified) networkProperties.put("network.userName", "admin"); networkProperties.put("network.password", properties.getProperty("zookeeper.password")); for (String k : properties.stringPropertyNames()) { networkProperties.put(k, properties.getProperty(k)); } IntrospectionSupport.setProperties(nc, networkProperties, "network."); return nc; }
/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception { if (!isAdvisorySupport()) { throw new javax.jms.IllegalStateException( "Networks require advisory messages to function - advisories are currently disabled"); } NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress); return addNetworkConnector(connector); }
@Override public NetworkConnector addNetworkConnector(final URI discoveryAddress) throws Exception { final NetworkConnector connector = new DiscoveryNetworkConnector(discoveryAddress); try { // try to set properties to broker too final Map<String, String> props = URISupport.parseParameters(discoveryAddress); if (!props.containsKey("skipConnector")) { IntrospectionSupport.setProperties(connector, props); } } catch (final URISyntaxException e) { // low level cause not supported by AMQ by default Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).getChildLogger("service") .debug(e.getMessage()); } return addNetworkConnector(connector); } };
if (!name.isEmpty()) { LOG.info("Adding network connector " + name); NetworkConnector nc = new DiscoveryNetworkConnector(new URI("fabric:" + name)); nc.setName("fabric-" + name);
@Override public void addNew(Object o) { DtoNetworkConnector networkConnector = (DtoNetworkConnector) o; if (networkConnector.getUri() != null) { try { DiscoveryNetworkConnector nc = fromDto(networkConnector, new DiscoveryNetworkConnector()); plugin.getBrokerService().addNetworkConnector(nc); plugin.getBrokerService().startNetworkConnector(nc, null); plugin.info("started new network connector: " + nc); } catch (Exception e) { plugin.info("Failed to add new networkConnector " + networkConnector, e); } } }