Package org.apache.activemq.network

Examples of org.apache.activemq.network.NetworkConnector


     *
     * @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);
    }
View Full Code Here


     *
     * @org.apache.xbean.Property nestedType="org.apache.activemq.network.NetworkConnector"
     */
    public void setNetworkConnectors(List networkConnectors) throws Exception {
        for (Iterator iter = networkConnectors.iterator(); iter.hasNext();) {
            NetworkConnector connector = (NetworkConnector)iter.next();
            addNetworkConnector(connector);
        }
    }
View Full Code Here

    }

    protected void stopAllConnectors(ServiceStopper stopper) {

        for (Iterator<NetworkConnector> iter = getNetworkConnectors().iterator(); iter.hasNext();) {
            NetworkConnector connector = iter.next();
            unregisterNetworkConnectorMBean(connector);
            stopper.stop(connector);
        }

        for (Iterator<ProxyConnector> iter = getProxyConnectors().iterator(); iter.hasNext();) {
View Full Code Here

            map.put("network", "true");
            map.put("async", "false");
            uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map));

            for (Iterator<NetworkConnector> iter = getNetworkConnectors().iterator(); iter.hasNext();) {
                NetworkConnector connector = iter.next();
                connector.setLocalUri(uri);
                connector.setBrokerName(getBrokerName());
                connector.setDurableDestinations(getBroker().getDurableDestinations());
                connector.start();
            }

            for (Iterator<ProxyConnector> iter = getProxyConnectors().iterator(); iter.hasNext();) {
                ProxyConnector connector = iter.next();
                connector.start();
            }

            for (Iterator<JmsConnector> iter = jmsConnectors.iterator(); iter.hasNext();) {
                JmsConnector connector = iter.next();
                connector.start();
            }
            for (Service service:services) {
                configureService(service);
                service.start();
            }
View Full Code Here

        connector.start();
        return connector.getName();
    }

    public String addNetworkConnector(String discoveryAddress) throws Exception {
        NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress);
        connector.start();
        return connector.getName();
    }
View Full Code Here

        connector.stop();
        return brokerService.removeConnector(connector);
    }

    public boolean removeNetworkConnector(String connectorName) throws Exception {
        NetworkConnector connector = brokerService.getNetworkConnectorByName(connectorName);
        connector.stop();
        return brokerService.removeNetworkConnector(connector);
    }
View Full Code Here

        super.setUp();
        BrokerService brokerA = createBroker(new URI("broker:(tcp://localhost:61616)/BrokerA?persistent=true&useJmx=false&deleteAllMessagesOnStartup=true"));
        brokerA.setBrokerId("BrokerA");
        BrokerService brokerB = createBroker(new URI("broker:(tcp://localhost:61617)/BrokerB?persistent=true&useJmx=false&deleteAllMessagesOnStartup=true"));
        brokerB.setBrokerId("BrokerB");
        NetworkConnector aTOb = bridgeBrokers(brokers.get("BrokerA").broker, brokers.get("BrokerB").broker, false, 2, true, true);
        aTOb.addStaticallyIncludedDestination(queue);
        NetworkConnector bTOa = bridgeBrokers(brokers.get("BrokerB").broker, brokers.get("BrokerA").broker, false, 2, true, true);
        bTOa.addStaticallyIncludedDestination(queue);

        startAllBrokers();
        waitForBridgeFormation();
       
    }
View Full Code Here

    protected void restartBroker(String brokerName) throws Exception {
        destroyBroker("BrokerA");
        BrokerService broker = createBroker(new URI("broker:(tcp://localhost:61616)/BrokerA?persistent=true&useJmx=false"));
        broker.setBrokerId("BrokerA");
        NetworkConnector aTOb = bridgeBrokers(brokers.get("BrokerA").broker, brokers.get("BrokerB").broker, false, 2, true, true);
        aTOb.addStaticallyIncludedDestination(queue);
        broker.start();
        broker.waitUntilStarted();
        waitForBridgeFormation();
    }
View Full Code Here

    protected NetworkConnector bridgeBrokers(BrokerService localBroker, BrokerService remoteBroker, boolean dynamicOnly, int networkTTL, boolean conduit, boolean failover) throws Exception {
        List<TransportConnector> transportConnectors = remoteBroker.getTransportConnectors();
        URI remoteURI;
        if (!transportConnectors.isEmpty()) {
            remoteURI = transportConnectors.get(0).getConnectUri();
            NetworkConnector connector = new DiscoveryNetworkConnector(new URI("static:" + remoteURI));
            connector.setName(localBroker.getBrokerName() + remoteBroker.getBrokerName());
            localBroker.addNetworkConnector(connector);
            maxSetupTime = 2000;
            return connector;
        } else {
            throw new Exception("Remote broker has no registered connectors.");
View Full Code Here

        return advisoryTopicsForTempQueues;
    }


    private void bridgeAndConfigureBrokers(String local, String remote) throws Exception {
        NetworkConnector bridge = bridgeBrokers(local, remote);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.network.NetworkConnector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.