Package org.apache.activemq.network

Examples of org.apache.activemq.network.NetworkConnector


       
        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


    public DiscoveryBrokerAgentImpl() throws Exception {
    }

    public void connectTo(BrokerAgent remoteBroker) throws Exception {
        NetworkConnector connector = getBroker().addNetworkConnector("rendezvous");
        if (isStarted()) {
            connector.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 void testAddRemoveNetworkWithJMX() throws Exception {
    BrokerService service = new BrokerService();
    service.setPersistent(false);
    service.setUseJmx(true);
    NetworkConnector connector = service.addNetworkConnector("multicast://default");
    service.start();
   
    service.removeNetworkConnector(connector);
    connector.stop();
    service.stop();
  }
View Full Code Here

 
  public void testAddRemoveNetworkWithoutJMX() throws Exception {
    BrokerService service = new BrokerService();
    service.setPersistent(false);
    service.setUseJmx(false);
    NetworkConnector connector = service.addNetworkConnector("multicast://default");
    service.start();
   
    service.removeNetworkConnector(connector);
    connector.stop();
    service.stop();
  }
View Full Code Here

     *
     * @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

    }

  protected void stopAllConnectors(ServiceStopper stopper) {
   
    for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) {
            NetworkConnector connector = (NetworkConnector) iter.next();
            unregisterNetworkConnectorMBean(connector);
            stopper.stop(connector);
        }

        for (Iterator iter = getProxyConnectors().iterator(); iter.hasNext();) {
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

              this.transportConnectors.clear();
              setTransportConnectors(al);
            }           

            for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) {
                NetworkConnector connector = (NetworkConnector) iter.next();
                connector.setBrokerName(getBrokerName());
                connector.setDurableDestinations(getBroker().getDurableDestinations());
                connector.start();
            }
           
            for (Iterator iter = getProxyConnectors().iterator(); iter.hasNext();) {
                ProxyConnector connector = (ProxyConnector) iter.next();
                connector.start();
            }
           
            for (Iterator iter = jmsConnectors.iterator(); iter.hasNext();) {
                JmsConnector connector = (JmsConnector) iter.next();
                connector.start();
            }
           
            if (services != null) {
                for (int i = 0; i < services.length; i++) {
                    Service service = services[i];
View Full Code Here

                brokerService1.setBrokerName("one");
                brokerService1.setUseJmx(false);
                brokerService1
                        .setPersistenceAdapter(new MemoryPersistenceAdapter());
                brokerService1.addConnector("nio://0.0.0.0:61616");
                final NetworkConnector network1 = brokerService1
                        .addNetworkConnector("static:(tcp://localhost:51515)");
                network1.setName("network1");
                network1.setDynamicOnly(true);
                network1.setNetworkTTL(3);
                network1.setPrefetchSize(networkBridgePrefetch);
                network1.setConduitSubscriptions(false);
                network1.setDecreaseNetworkConsumerPriority(false);
                brokerService1.start();
            }
            {
                brokerService2 = new BrokerService();
                brokerService2.setBrokerName("two");
                brokerService2.setUseJmx(false);
                brokerService2
                        .setPersistenceAdapter(new MemoryPersistenceAdapter());
                brokerService2.addConnector("nio://0.0.0.0:51515");
                final NetworkConnector network2 = brokerService2
                        .addNetworkConnector("static:(tcp://localhost:61616)");
                network2.setName("network1");
                network2.setDynamicOnly(true);
                network2.setNetworkTTL(3);
                network2.setPrefetchSize(networkBridgePrefetch);
                network2.setConduitSubscriptions(false);
                network2.setDecreaseNetworkConsumerPriority(false);
                brokerService2.start();
            }
            final ExecutorService pool = Executors.newSingleThreadExecutor();
            final ActiveMQConnectionFactory connectionFactory1 = new ActiveMQConnectionFactory(
                    "vm://one");
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.