Search in sources :

Example 1 with AsynchronousExecutionEvent

use of org.apache.synapse.aspects.flow.statistics.log.templates.AsynchronousExecutionEvent in project wso2-synapse by wso2.

the class OpenEventCollector method reportFlowAsynchronousEvent.

/**
 * Enqueue StatisticOpenEvent for asynchronous invocation.
 *
 * @param messageContext synapse message context.
 */
public static void reportFlowAsynchronousEvent(MessageContext messageContext) {
    if (shouldReportStatistic(messageContext)) {
        BasicStatisticDataUnit dataUnit = new BasicStatisticDataUnit();
        dataUnit.setStatisticId(StatisticDataCollectionHelper.getStatisticTraceId(messageContext));
        dataUnit.setCurrentIndex(StatisticDataCollectionHelper.getParentFlowPosition(messageContext, null));
        AsynchronousExecutionEvent asynchronousExecutionEvent = new AsynchronousExecutionEvent(dataUnit);
        if (isOpenTracingEnabled()) {
            OpenTracingManagerHolder.getOpenTracingManager().getHandler().handleOpenFlowAsynchronousEvent(dataUnit, messageContext);
        }
        addEventAndIncrementCount(messageContext, asynchronousExecutionEvent);
    }
}
Also used : AsynchronousExecutionEvent(org.apache.synapse.aspects.flow.statistics.log.templates.AsynchronousExecutionEvent) BasicStatisticDataUnit(org.apache.synapse.aspects.flow.statistics.data.raw.BasicStatisticDataUnit)

Aggregations

BasicStatisticDataUnit (org.apache.synapse.aspects.flow.statistics.data.raw.BasicStatisticDataUnit)1 AsynchronousExecutionEvent (org.apache.synapse.aspects.flow.statistics.log.templates.AsynchronousExecutionEvent)1