Package org.apache.activemq.network

Examples of org.apache.activemq.network.NetworkConnector


        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

    }
   
    protected void configureNetwork(BrokerService answer,String uri) throws Exception {
        answer.setBrokerName(BROKER_B_NAME);
        answer.setPersistent(false);
        NetworkConnector network = answer.addNetworkConnector("static://"+BROKER_A_BIND_ADDRESS);
        network.setDuplex(true);
        TransportConnector connector =answer.addConnector(uri);
        connector.setRebalanceClusterClients(true);
        connector.setUpdateClusterClients(true);
        answer.setUseShutdownHook(false);
    }
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();) {
            ProxyConnector connector = iter.next();
View Full Code Here

            if (isWaitForSlave()) {
                waitForSlave();
            }
            if (!stopped.get()) {
                for (Iterator<NetworkConnector> iter = getNetworkConnectors().iterator(); iter.hasNext();) {
                    NetworkConnector connector = iter.next();
                    connector.setLocalUri(uri);
                    connector.setBrokerName(getBrokerName());
                    connector.setDurableDestinations(durableDestinations);
                    if (getDefaultSocketURI() != null) {
                        connector.setBrokerURL(getDefaultSocketURI().toString());
                    }
                    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

       
        BrokerService broker = new BrokerService();
        broker.setDedicatedTaskRunner(true);
        broker.setPersistent(false);
        broker.addConnector("tcp://localhost:61616");
        NetworkConnector networkConnector = broker.addNetworkConnector("static:(tcp://wrongHostname1:61617,tcp://wrongHostname2:61618)?useExponentialBackOff=false");
        networkConnector.setDuplex(true);
        broker.start();
       
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(new URI(VM_BROKER_URI));
        cf.createConnection("system", "manager").start();
       
View Full Code Here

        createBroker(new URI("broker:(tcp://localhost:61617)/BrokerB?persistent=false&useJmx=true"));
        createBroker(new URI("broker:(tcp://localhost:61618)/BrokerC?persistent=false&useJmx=true"));
    }

    protected NetworkConnector bridgeBrokers(String localBrokerName, String remoteBrokerName, boolean dynamicOnly, int networkTTL) throws Exception {
      NetworkConnector connector = super.bridgeBrokers(localBrokerName, remoteBrokerName, dynamicOnly, networkTTL);
      connector.setBridgeTempDestinations(enableTempDestinationBridging);
      return connector;
    }
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);
            MAX_SETUP_TIME = 2000;
            return connector;
        } else {
            throw new Exception("Remote broker has no registered connectors.");
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.