Package org.switchyard.runtime.event

Examples of org.switchyard.runtime.event.ExchangeCompletionEvent


        if (isDone(sendPhase)) {
         // Publish exchange completion event
            long duration = System.nanoTime() - _exchange.getProperty(ExchangeInitiatedEvent.EXCHANGE_INITIATED_TIME, 0, Long.class);
            getContext().setProperty(ExchangeCompletionEvent.EXCHANGE_DURATION, TimeUnit.NANOSECONDS.toMillis(duration))
                .addLabels(BehaviorLabel.TRANSIENT.label());
            domain.getEventPublisher().publish(new ExchangeCompletionEvent(this));
        }
    }
View Full Code Here


        // Publish exchange completion event
        if (isDone(sendPhase)) {
            long duration = System.nanoTime() - _startTime;
            getContext().setProperty(ExchangeCompletionEvent.EXCHANGE_DURATION,
                    TimeUnit.MILLISECONDS.convert(duration, TimeUnit.NANOSECONDS)).addLabels(BehaviorLabel.TRANSIENT.label());
            _domain.getEventPublisher().publish(new ExchangeCompletionEvent(this));
        }
    }
View Full Code Here

    @Test
    public void testSwitchyardLevelCollection() {
        Exchange ex = createMock();
        defaultExpectations(ex);

        _builder.notify(new ExchangeCompletionEvent(ex));

        assertEquals(1, _switchYard.getMessageMetrics().getSuccessCount());
        assertEquals(10.0, _switchYard.getMessageMetrics().getAverageProcessingTime(), 0);
    }
View Full Code Here

        Exchange ex = createMock();
        defaultExpectations(ex);

        Mockito.when(ex.getContract().getProviderOperation().getName()).thenReturn(OPERATION_NAME);

        _builder.notify(new ExchangeCompletionEvent(ex));

        assertEquals(1, _switchYard.getMessageMetrics().getSuccessCount());
        assertEquals(10.0, _switchYard.getMessageMetrics().getAverageProcessingTime(), 0);
        ComponentService componentService = _switchYard.getApplication(TEST_APP).getComponentService(TEST_PROMOTED_SERVICE);
        assertEquals(10.0, componentService.getMessageMetrics().getAverageProcessingTime(), 0);
View Full Code Here

TOP

Related Classes of org.switchyard.runtime.event.ExchangeCompletionEvent

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.