Package org.codehaus.activemq.transport.vm

Examples of org.codehaus.activemq.transport.vm.VmTransportChannel


        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

public class TransportChannelProviderTest extends TestCase {
    public void testVmChannelWithProperties() throws Exception {
        TransportChannel channel = createChannel("vm://localhost?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

        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

        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

    }

    private void ensureVmServerIsAvailable(TransportChannel channel, BrokerConnector brokerConnector) throws JMSException {
        if (channel instanceof VmTransportChannel && brokerConnector instanceof TransportChannelListener) {
            TransportChannelListener listener = (TransportChannelListener) brokerConnector;
            VmTransportChannel answer = (VmTransportChannel) channel;

            listener.addClient(answer.createServerSide());
        }
    }
View Full Code Here

    protected void assertVmSendCapacity(String uriText, int sendCapacity) throws JMSException {
        URI uri = URI.create(uriText);
        channel = (CompositeTransportChannel) TransportChannelProvider.create(wireFormat, uri);
        channel.start();

        VmTransportChannel subChannel = (VmTransportChannel) channel.getChannel();
        assertNotNull("VM channel exists", subChannel);

        assertEquals("sendCapacity for uri: " + uriText, sendCapacity, subChannel.getSendCapacity());
    }
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

        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.codehaus.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.