/** * Sets the network connectors which this broker will use to connect to * other brokers in a federated network * * @org.apache.xbean.Property * nestedType="org.apache.activemq.network.NetworkConnector" */ public void setNetworkConnectors(List<?> networkConnectors) throws Exception { for (Object connector : networkConnectors) { addNetworkConnector((NetworkConnector) connector); } }
/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(String discoveryAddress) throws Exception { return addNetworkConnector(new URI(discoveryAddress)); }
/** * 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); }
@Override public String addNetworkConnector(String discoveryAddress) throws Exception { NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress); if (connector == null) { throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); } brokerService.registerNetworkConnectorMBean(connector); connector.start(); return connector.getName(); }
/** * Handles any lazy-creation helper properties which are added to make * things easier to configure inside environments such as Spring * * @throws Exception */ protected void processHelperProperties() throws Exception { if (transportConnectorURIs != null) { for (int i = 0; i < transportConnectorURIs.length; i++) { String uri = transportConnectorURIs[i]; addConnector(uri); } } if (networkConnectorURIs != null) { for (int i = 0; i < networkConnectorURIs.length; i++) { String uri = networkConnectorURIs[i]; addNetworkConnector(uri); } } if (jmsBridgeConnectors != null) { for (int i = 0; i < jmsBridgeConnectors.length; i++) { addJmsConnector(jmsBridgeConnectors[i]); } } }
@Override public BrokerService createBroker(URI brokerURI) throws Exception { BrokerService service = new BrokerService(); IntrospectionSupport.setProperties(service, brokerOptions); service.setBrokerName(finalBroker); TransportConnector c = service.addConnector("tcp://0.0.0.0:0"); c.setDiscoveryUri(new URI("multicast://default?group=" + finalGroup)); service.addNetworkConnector("multicast://default?group=" + finalGroup); return service; } });
public BrokerService createBroker(URI brokerURI) throws Exception { CompositeData compositeData = URISupport.parseComposite(brokerURI); Map<String, String> params = new HashMap<String, String>(compositeData.getParameters()); BrokerService brokerService = new BrokerService(); IntrospectionSupport.setProperties(brokerService, params); if (!params.isEmpty()) { String msg = "There are " + params.size() + " Broker options that couldn't be set on the BrokerService." + " Check the options are spelled correctly." + " Unknown parameters=[" + params + "]." + " This BrokerService cannot be started."; throw new IllegalArgumentException(msg); } if (compositeData.getPath() != null) { brokerService.setBrokerName(compositeData.getPath()); } URI[] components = compositeData.getComponents(); for (int i = 0; i < components.length; i++) { if ("network".equals(components[i].getScheme())) { brokerService.addNetworkConnector(components[i].getSchemeSpecificPart()); } else if ("proxy".equals(components[i].getScheme())) { brokerService.addProxyConnector(components[i].getSchemeSpecificPart()); } else { brokerService.addConnector(components[i]); } } return brokerService; }
NetworkConnector connector = getBrokerService().addNetworkConnector(connectorURI);
/** * Sets the network connectors which this broker will use to connect to * other brokers in a federated network * * @org.apache.xbean.Property * nestedType="org.apache.activemq.network.NetworkConnector" */ public void setNetworkConnectors(List<?> networkConnectors) throws Exception { for (Object connector : networkConnectors) { addNetworkConnector((NetworkConnector) connector); } }
/** * Sets the network connectors which this broker will use to connect to * other brokers in a federated network * * @org.apache.xbean.Property * nestedType="org.apache.activemq.network.NetworkConnector" */ public void setNetworkConnectors(List<?> networkConnectors) throws Exception { for (Object connector : networkConnectors) { addNetworkConnector((NetworkConnector) connector); } }
/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(String discoveryAddress) throws Exception { return addNetworkConnector(new URI(discoveryAddress)); }
/** * Adds a new network connector using the given discovery address * * @return the newly created and added network connector * @throws Exception */ public NetworkConnector addNetworkConnector(String discoveryAddress) throws Exception { return addNetworkConnector(new URI(discoveryAddress)); }
/** * 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); }
@Override public String addNetworkConnector(String discoveryAddress) throws Exception { NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress); if (connector == null) { throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); } brokerService.registerNetworkConnectorMBean(connector); connector.start(); return connector.getName(); }
@Override public String addNetworkConnector(String discoveryAddress) throws Exception { NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress); if (connector == null) { throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); } brokerService.registerNetworkConnectorMBean(connector); connector.start(); return connector.getName(); }
@Override public String addNetworkConnector(String discoveryAddress) throws Exception { NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress); if (connector == null) { throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); } brokerService.registerNetworkConnectorMBean(connector); connector.start(); return connector.getName(); }
@Override public BrokerService createBroker(URI brokerURI) throws Exception { BrokerService service = new BrokerService(); IntrospectionSupport.setProperties(service, brokerOptions); service.setBrokerName(finalBroker); TransportConnector c = service.addConnector("tcp://0.0.0.0:0"); c.setDiscoveryUri(new URI("multicast://default?group=" + finalGroup)); service.addNetworkConnector("multicast://default?group=" + finalGroup); return service; } });
@Override public BrokerService createBroker(URI brokerURI) throws Exception { BrokerService service = new BrokerService(); IntrospectionSupport.setProperties(service, brokerOptions); service.setBrokerName(finalBroker); TransportConnector c = service.addConnector("tcp://0.0.0.0:0"); c.setDiscoveryUri(new URI("multicast://default?group=" + finalGroup)); service.addNetworkConnector("multicast://default?group=" + finalGroup); return service; } });
@Override public BrokerService createBroker(URI brokerURI) throws Exception { BrokerService service = new BrokerService(); IntrospectionSupport.setProperties(service, brokerOptions); service.setBrokerName(finalBroker); TransportConnector c = service.addConnector("tcp://0.0.0.0:0"); c.setDiscoveryUri(new URI("multicast://default?group=" + finalGroup)); service.addNetworkConnector("multicast://default?group=" + finalGroup); return service; } });