Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.TransportConnector


    protected void configureNetwork(BrokerService answer, String uri) throws Exception {
        answer.setBrokerName(BROKER_B_NAME);
        answer.setPersistent(false);
        NetworkConnector network = answer.addNetworkConnector("static://" + brokerA.getTransportConnectors().get(0).getPublishableConnectString());
        network.setDuplex(true);
        TransportConnector connector = answer.addConnector(uri);
        connector.setRebalanceClusterClients(true);
        connector.setUpdateClusterClients(true);
        answer.setUseShutdownHook(false);
    }
View Full Code Here


    @Override
    protected void setUp() throws Exception {
        bs = new BrokerService();
        bs.setPersistent(false);
        bs.setUseJmx(true);
        TransportConnector connector = bs.addConnector("tcp://localhost:0");
        bs.start();
        tcpUri = connector.getConnectUri();

        workers = new Worker[WORKER_COUNT];
        for (int i = 0; i < WORKER_COUNT; i++) {
            workers[i] = new Worker(""+i);
            workers[i].start();
View Full Code Here

        Transport transport = TransportFactory.connect(remoteConnector.getServer().getConnectURI());
        return transport;
    }
   
    protected TransportConnector createConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getLocalURI())));
    }
View Full Code Here

    protected TransportConnector createConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getLocalURI())));
    }
   
    protected TransportConnector createRemoteConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getRemoteURI())));
    }
View Full Code Here

    private PooledConnectionFactory pooledFactory;

    protected void setUp() throws Exception {
        broker = new BrokerService();
        broker.setPersistent(false);
        TransportConnector connector = broker.addConnector("tcp://localhost:0");
        broker.start();
        factory = new ActiveMQConnectionFactory("mock:" + connector.getConnectUri());
        pooledFactory = new PooledConnectionFactory(factory);
        pooledFactory.setMaxConnections(1);
    }
View Full Code Here

    private PooledConnectionFactory pooledFactory;

    protected void setUp() throws Exception {
        broker = new BrokerService();
        broker.setPersistent(false);
        TransportConnector connector = broker.addConnector("tcp://localhost:0");
        broker.start();
        factory = new ActiveMQConnectionFactory("mock:" + connector.getConnectUri() + "?closeAsync=false");
        pooledFactory = new PooledConnectionFactory(factory);
    }
View Full Code Here

        assertEquals(listener, connection.getExceptionListener());
    }
   
    public void testPooledConnectionAfterInactivity() throws Exception {
        BrokerService broker = new BrokerService();
        TransportConnector networkConnector = broker.addConnector("tcp://localhost:0");
        broker.setPersistent(false);
        broker.setUseJmx(false);
        broker.start();
       
        SocketProxy proxy = new SocketProxy(networkConnector.getConnectUri());
       
        PooledConnectionFactory pcf = new PooledConnectionFactory();
        String uri = proxy.getUrl().toString() + "?trace=true&wireFormat.maxInactivityDuration=500&wireFormat.maxInactivityDurationInitalDelay=500";
        pcf.setConnectionFactory(new ActiveMQConnectionFactory(uri));
       
View Full Code Here

                }

                server = SERVERS.get(host);
                if (server == null) {
                    server = (VMTransportServer)bind(location, true);
                    TransportConnector connector = new TransportConnector(server);
                    connector.setBrokerService(broker);
                    connector.setUri(location);
                    connector.setTaskRunnerFactory(broker.getTaskRunnerFactory());
                    connector.start();
                    CONNECTORS.put(host, connector);
                }

            }
        }
View Full Code Here

        stopped(host);
    }

    public static void stopped(String host) {
        SERVERS.remove(host);
        TransportConnector connector = CONNECTORS.remove(host);
        if (connector != null) {
            LOG.debug("Shutting down VM connectors for broker: " + host);
            ServiceSupport.dispose(connector);
            BrokerService broker = BROKERS.remove(host);
            if (broker != null) {
View Full Code Here

    private boolean validateBroker(String host) {
        boolean result = true;
        if (BROKERS.containsKey(host) || SERVERS.containsKey(host) || CONNECTORS.containsKey(host)) {
            // check the broker is still in the BrokerRegistry
            TransportConnector connector = CONNECTORS.get(host);
            if (BrokerRegistry.getInstance().lookup(host) == null
                || (connector != null && connector.getBroker().isStopped())) {
                result = false;
                // clean-up
                BROKERS.remove(host);
                SERVERS.remove(host);
                if (connector != null) {
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.TransportConnector

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.