Examples of ExchangeListener


Examples of org.apache.servicemix.jbi.event.ExchangeListener

    }

    public void init(JBIContainer container) throws JBIException {
        initComponentListener(container);
        initEndpointListener(container);
        exchangeListener = new ExchangeListener() {
            public void exchangeSent(ExchangeEvent event) {
                onExchangeSent(event);
            }
            public void exchangeAccepted(ExchangeEvent event) {
                onExchangeAccepted(event);
View Full Code Here

Examples of org.apache.servicemix.jbi.event.ExchangeListener

    }

    public void init(JBIContainer container) throws JBIException {
        initComponentListener(container);
        initEndpointListener(container);
        exchangeListener = new ExchangeListener() {
            public void exchangeSent(ExchangeEvent event) {
                onExchangeSent(event);
            }
            public void exchangeAccepted(ExchangeEvent event) {
                onExchangeAccepted(event);
View Full Code Here

Examples of org.apache.servicemix.jbi.event.ExchangeListener

            }
            public void componentShutDown(ComponentEvent event) {
                onComponentShutDown(event);
            }
        };
        exchangeListener = new ExchangeListener() {
            public void exchangeSent(ExchangeEvent event) {
                onExchangeSent(event);
            }
            public void exchangeAccepted(ExchangeEvent event) {
                onExchangeAccepted(event);
View Full Code Here

Examples of org.apache.servicemix.jbi.event.ExchangeListener

    }

    public void init(JBIContainer container) throws JBIException {
        initComponentListener(container);
        initEndpointListener(container);
        exchangeListener = new ExchangeListener() {
            public void exchangeSent(ExchangeEvent event) {
                onExchangeSent(event);
            }
            public void exchangeAccepted(ExchangeEvent event) {
                onExchangeAccepted(event);
View Full Code Here

Examples of org.apache.servicemix.jbi.event.ExchangeListener

            }
            public void componentShutDown(ComponentEvent event) {
                onComponentShutDown(event);
            }
        };
        exchangeListener = new ExchangeListener() {
            public void exchangeSent(ExchangeEvent event) {
                onExchangeSent(event);
            }
            public void exchangeAccepted(ExchangeEvent event) {
                onExchangeAccepted(event);
View Full Code Here

Examples of org.apache.servicemix.nmr.api.event.ExchangeListener

    }

    public void testDispatchAsync() throws Exception {

        IMocksControl control = EasyMock.createControl();
        ExchangeListener listener = control.createMock(ExchangeListener.class);
        control.makeThreadSafe(true);
        nmr.getListenerRegistry().register(listener, null);

        final Exchange e = ep1.channel.createExchange(Pattern.InOnly);

        listener.exchangeSent(same(e));
        listener.exchangeDelivered(same(e));
        replay(listener);

        e.setTarget(ep1.channel.getNMR().getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "ep2")));
        ep1.channel.send(e);
        Thread.sleep(1000);
        verify(listener);

        reset(listener);
        control.makeThreadSafe(true);
        listener.exchangeSent(same(e));
        listener.exchangeDelivered(same(e));
        replay(listener);

        synchronized (ep1) {
            ep2.done();
            ep1.wait();
View Full Code Here

Examples of org.apache.servicemix.nmr.api.event.ExchangeListener

    }

    public void testDispatchSync() throws Exception {

        IMocksControl control = EasyMock.createControl();
        ExchangeListener listener = control.createMock(ExchangeListener.class);
        control.makeThreadSafe(true);
        nmr.getListenerRegistry().register(listener, null);

        final Exchange e = ep1.channel.createExchange(Pattern.InOnly);
        final CountDownLatch latch = new CountDownLatch(1);

        listener.exchangeSent(same(e));
        listener.exchangeDelivered(same(e));
        replay(listener);

        synchronized (ep2) {
            new Thread() {
                public void run() {
                    e.setTarget(ep1.channel.getNMR().getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "ep2")));
                    ep1.channel.sendSync(e);
                    latch.countDown();
                }
            }.start();
            ep2.wait();
        }

        verify(listener);

        reset(listener);
        control.makeThreadSafe(true);
        listener.exchangeSent(same(e));
        listener.exchangeDelivered(same(e));
        replay(listener);

        ep2.done();
        latch.await();
View Full Code Here

Examples of org.apache.servicemix.nmr.api.event.ExchangeListener

        verify(listener);
    }

    public void testDispatchFailure() throws Exception {
        IMocksControl control = EasyMock.createControl();
        ExchangeListener listener = control.createMock(ExchangeListener.class);
        control.makeThreadSafe(true);
        nmr.getListenerRegistry().register(listener, null);

        Channel channel = nmr.createChannel();
        Exchange e = channel.createExchange(Pattern.InOnly);
        e.setTarget(nmr.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "zz")));

        listener.exchangeSent(same(e));
        listener.exchangeFailed(same(e));

        replay(listener);

        try {
            channel.send(e);
View Full Code Here

Examples of org.apache.servicemix.nmr.api.event.ExchangeListener

        verify(listener);
    }

    public void testProcessingFailure() throws Exception {
        IMocksControl control = EasyMock.createControl();
        ExchangeListener listener = control.createMock(ExchangeListener.class);
        control.makeThreadSafe(true);
        nmr.getListenerRegistry().register(listener, null);

        final Exchange e = ep1.channel.createExchange(Pattern.InOnly);

        listener.exchangeSent(same(e));
        listener.exchangeDelivered(same(e));
        listener.exchangeSent(same(e));
        listener.exchangeDelivered(same(e));
        replay(listener);

        ep2.throwException = true;
        e.setTarget(ep1.channel.getNMR().getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "ep2")));
        ep1.channel.sendSync(e);
View Full Code Here

Examples of org.apache.servicemix.nmr.api.event.ExchangeListener

    public void testChangeThreadNameForSyncExchange() throws Exception {
        final BlockingEndpoint blocking = new BlockingEndpoint();
        final CountDownLatch sent = new CountDownLatch(1);
        final Map<String, Object> props = ServiceHelper.createMap(Endpoint.NAME, "blocking");
        nmr.getEndpointRegistry().register(blocking, props);
        nmr.getListenerRegistry().register(new ExchangeListener() {

            public void exchangeDelivered(Exchange exchange) {}

            public void exchangeFailed(Exchange exchange) {}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.