Package org.apache.activemq.network

Examples of org.apache.activemq.network.NetworkConnector


        TransportConnector connector = (TransportConnector)brokerService.getTransportConnectors().get(0);

        assertEquals(new URI("tcp://localhost:61636"), connector.getUri());
        assertTrue(connector.getTaskRunnerFactory() == brokerService.getTaskRunnerFactory());

        NetworkConnector netConnector = (NetworkConnector)brokerService.getNetworkConnectors().get(0);
        List excludedDestinations = netConnector.getExcludedDestinations();
        assertEquals(new ActiveMQQueue("exclude.test.foo"), excludedDestinations.get(0));
        assertEquals(new ActiveMQTopic("exclude.test.bar"), excludedDestinations.get(1));

        List dynamicallyIncludedDestinations = netConnector.getDynamicallyIncludedDestinations();
        assertEquals(new ActiveMQQueue("include.test.foo"), dynamicallyIncludedDestinations.get(0));
        assertEquals(new ActiveMQTopic("include.test.bar"), dynamicallyIncludedDestinations.get(1));

    }
View Full Code Here


    protected NetworkConnector bridgeBrokers(BrokerService localBroker, BrokerService remoteBroker, boolean dynamicOnly, int networkTTL) throws Exception {
        List transportConnectors = remoteBroker.getTransportConnectors();
        URI remoteURI;
        if (!transportConnectors.isEmpty()) {
            remoteURI = ((TransportConnector)transportConnectors.get(0)).getConnectUri();
            NetworkConnector connector = new DiscoveryNetworkConnector(new URI("static:" + remoteURI));
            connector.setDynamicOnly(dynamicOnly);
            connector.setNetworkTTL(networkTTL);
            localBroker.addNetworkConnector(connector);
            maxSetupTime = 2000;
            return connector;
        } else {
            throw new Exception("Remote broker has no registered connectors.");
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

     */
    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);
    }
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

            uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map));
            if(isWaitForSlave()){
              waitForSlave();
            }
            for (Iterator<NetworkConnector> iter = getNetworkConnectors().iterator(); iter.hasNext();) {
                NetworkConnector connector = iter.next();
                connector.setLocalUri(uri);
                connector.setBrokerName(getBrokerName());
                connector.setDurableDestinations(durableDestinations);
                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

    }

    public void connectTo(BrokerAgent remoteBroker) throws Exception {
        String remoteURI = "static://"+remoteBroker.getConnectionURI();
        log.info("Broker is connecting to network using: " + remoteURI);
        NetworkConnector connector = getBroker().addNetworkConnector(remoteURI);
        if (started) {
            connector.start();
        }
    }
View Full Code Here

    public DiscoveryBrokerAgentImpl() throws Exception {
    }

    public void connectTo(BrokerAgent remoteBroker) throws Exception {
        NetworkConnector connector = getBroker().addNetworkConnector("rendezvous");
        if (isStarted()) {
            connector.start();
        }
    }
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.