use of org.mule.runtime.core.api.construct.Pipeline in project mule by mulesoft.
the class MessageProcessingFlowTraceManagerTestCase method buildPipelineNotification.
protected PipelineMessageNotification buildPipelineNotification(CoreEvent event, String name) {
Pipeline flowConstruct = mock(Pipeline.class, withSettings().extraInterfaces(Component.class));
when(flowConstruct.getName()).thenReturn(name);
return new PipelineMessageNotification(createInfo(event, null, flowConstruct), flowConstruct.getName(), PROCESS_START);
}
use of org.mule.runtime.core.api.construct.Pipeline in project mule by mulesoft.
the class AsyncDelegateMessageProcessor method initialise.
@Override
public void initialise() throws InitialisationException {
Object rootContainer = getFromAnnotatedObject(componentLocator, this).orElse(null);
if (rootContainer instanceof FlowConstruct) {
if (maxConcurrency != null && rootContainer instanceof Pipeline) {
ProcessingStrategyFactory flowPsFactory = ((Pipeline) rootContainer).getProcessingStrategyFactory();
if (flowPsFactory instanceof AsyncProcessingStrategyFactory) {
((AsyncProcessingStrategyFactory) flowPsFactory).setMaxConcurrency(maxConcurrency);
} else {
logger.warn("{} does not support 'maxConcurrency'. Ignoring the value.", flowPsFactory.getClass().getSimpleName());
}
processingStrategy = flowPsFactory.create(muleContext, getLocation().getLocation());
ownProcessingStrategy = true;
} else {
processingStrategy = ((FlowConstruct) rootContainer).getProcessingStrategy();
}
} else {
processingStrategy = DIRECT_PROCESSING_STRATEGY_INSTANCE;
}
if (delegateBuilder == null) {
throw new InitialisationException(objectIsNull("delegate message processor"), this);
}
delegateBuilder.setProcessingStrategy(processingStrategy);
delegate = delegateBuilder.build();
initialiseIfNeeded(delegate, muleContext);
super.initialise();
}
Aggregations