Package org.activemq.transport.vm

Examples of org.activemq.transport.vm.VmTransportChannel


       
        ActiveMQConnectionFactory factory2 = new ActiveMQConnectionFactory("vm://localhost");
        ActiveMQConnection connection2 = (ActiveMQConnection) factory2.createConnection();
        assertNotNull(connection2);
       
        VmTransportChannel transportChannel = (VmTransportChannel) connection.getTransportChannel();
        BrokerClientImpl brokerClient = (BrokerClientImpl)transportChannel.getSendListener();
        Broker broker = brokerClient.getBrokerConnector().getBrokerContainer().getBroker();
       
        VmTransportChannel transportChannel2 = (VmTransportChannel) connection2.getTransportChannel();
        BrokerClientImpl brokerClient2 = (BrokerClientImpl)transportChannel2.getSendListener();
        Broker broker2 = brokerClient2.getBrokerConnector().getBrokerContainer().getBroker();
       
        assertTrue( broker == broker2 );
       
    }
View Full Code Here


        InitialContext ctx2 = new InitialContext(props2);
        ActiveMQConnectionFactory factory2 = (ActiveMQConnectionFactory) ctx2.lookup("ConnectionFactory");
        ActiveMQConnection connection2 = (ActiveMQConnection) factory2.createConnection();
        assertNotNull(connection2);
       
        VmTransportChannel transportChannel = (VmTransportChannel) connection.getTransportChannel();
        BrokerClientImpl brokerClient = (BrokerClientImpl)transportChannel.getSendListener();
        Broker broker = brokerClient.getBrokerConnector().getBrokerContainer().getBroker();
       
        VmTransportChannel transportChannel2 = (VmTransportChannel) connection2.getTransportChannel();
        BrokerClientImpl brokerClient2 = (BrokerClientImpl)transportChannel2.getSendListener();
        Broker broker2 = brokerClient2.getBrokerConnector().getBrokerContainer().getBroker();
       
        assertTrue( broker == broker2 );
       
    }
View Full Code Here

        return channel;
    }

    private void ensureVmServerIsAvailable(TransportChannel channel, BrokerConnector brokerConnector) throws JMSException {
        if (channel instanceof VmTransportChannel && brokerConnector instanceof TransportChannelListener) {
            VmTransportChannel answer = (VmTransportChannel) channel;
            answer.connect(brokerConnector);
        }
    }
View Full Code Here

        return channel;
    }

    private void ensureVmServerIsAvailable(TransportChannel channel, BrokerConnector brokerConnector) throws JMSException {
        if (channel instanceof VmTransportChannel && brokerConnector instanceof TransportChannelListener) {
            VmTransportChannel answer = (VmTransportChannel) channel;
            answer.connect(brokerConnector);
        }
    }
View Full Code Here

       
        ActiveMQConnectionFactory factory2 = new ActiveMQConnectionFactory("vm://localhost");
        ActiveMQConnection connection2 = (ActiveMQConnection) factory2.createConnection();
        assertNotNull(connection2);
       
        VmTransportChannel transportChannel = (VmTransportChannel) connection.getTransportChannel();
        BrokerClientImpl brokerClient = (BrokerClientImpl)transportChannel.getSendListener();
        Broker broker = brokerClient.getBrokerConnector().getBrokerContainer().getBroker();
       
        VmTransportChannel transportChannel2 = (VmTransportChannel) connection2.getTransportChannel();
        BrokerClientImpl brokerClient2 = (BrokerClientImpl)transportChannel2.getSendListener();
        Broker broker2 = brokerClient2.getBrokerConnector().getBrokerContainer().getBroker();
       
        assertTrue( broker == broker2 );
       
    }
View Full Code Here

        InitialContext ctx2 = new InitialContext(props2);
        ActiveMQConnectionFactory factory2 = (ActiveMQConnectionFactory) ctx2.lookup("ConnectionFactory");
        ActiveMQConnection connection2 = (ActiveMQConnection) factory2.createConnection();
        assertNotNull(connection2);
       
        VmTransportChannel transportChannel = (VmTransportChannel) connection.getTransportChannel();
        BrokerClientImpl brokerClient = (BrokerClientImpl)transportChannel.getSendListener();
        Broker broker = brokerClient.getBrokerConnector().getBrokerContainer().getBroker();
       
        VmTransportChannel transportChannel2 = (VmTransportChannel) connection2.getTransportChannel();
        BrokerClientImpl brokerClient2 = (BrokerClientImpl)transportChannel2.getSendListener();
        Broker broker2 = brokerClient2.getBrokerConnector().getBrokerContainer().getBroker();
       
        assertTrue( broker == broker2 );
       
    }
View Full Code Here

public class TransportChannelProviderTest extends TestCase {
    public void testVmChannelWithProperties() throws Exception {
        TransportChannel channel = createChannel("vm://localhost:0?asyncSend=true&sendCapacity=100&receiveCapacity=20");
        assertTrue(channel instanceof VmTransportChannel);

        VmTransportChannel vmChannel = (VmTransportChannel) channel;
        assertEquals("sendCapacity", 100, vmChannel.getSendCapacity());
        assertEquals("receiveCapacity", 20, vmChannel.getReceiveCapacity());
        assertEquals("asyncSend", true, vmChannel.isAsyncSend());
        vmChannel.start();
        assertTrue("has send channel", vmChannel.getSendChannel() != null);
        assertTrue("has receive channel", vmChannel.getReceiveChannel() != null);
        vmChannel.stop();

        vmChannel = (VmTransportChannel) createChannel("vm://localhost?receiveCapacity=20");
        vmChannel.start();
        assertTrue("has no send channel", vmChannel.getSendChannel() == null);
        assertTrue("has receive channel", vmChannel.getReceiveChannel() == null);
        vmChannel.stop();
    }
View Full Code Here

            } catch ( JMSException e ) {
                Thread.sleep(100);
            }
        }
       
        VmTransportChannel subChannel = (VmTransportChannel) channel.getChannel();
        assertNotNull("VM channel exists", subChannel);

        assertEquals("sendCapacity for uri: " + uriText, sendCapacity, subChannel.getSendCapacity());
    }
View Full Code Here

        return channel;
    }

    private void ensureVmServerIsAvailable(TransportChannel channel, BrokerConnector brokerConnector) throws JMSException {
        if (channel instanceof VmTransportChannel && brokerConnector instanceof TransportChannelListener) {
            VmTransportChannel answer = (VmTransportChannel) channel;
            answer.connect(brokerConnector);
        }
    }
View Full Code Here

TOP

Related Classes of org.activemq.transport.vm.VmTransportChannel

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.