use of org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder in project mule by mulesoft.
the class AsyncMessageProcessorsFactoryBean method getObject.
@Override
public AsyncDelegateMessageProcessor getObject() throws Exception {
DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
builder.setName("'async' child chain");
for (Object processor : messageProcessors) {
if (processor instanceof Processor) {
builder.chain((Processor) processor);
} else if (processor instanceof MessageProcessorBuilder) {
builder.chain((MessageProcessorBuilder) processor);
} else {
throw new IllegalArgumentException("MessageProcessorBuilder should only have MessageProcessor's or MessageProcessorBuilder's configured");
}
}
AsyncDelegateMessageProcessor delegate = new AsyncDelegateMessageProcessor(builder, name);
delegate.setAnnotations(getAnnotations());
if (getMaxConcurrency() != null) {
delegate.setMaxConcurrency(getMaxConcurrency());
}
return delegate;
}
use of org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder in project mule by mulesoft.
the class MessageProcessorFilterPairFactoryBean method doGetObject.
@Override
public MessageProcessorExpressionPair doGetObject() throws Exception {
final DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
for (Object processor : messageProcessors) {
if (processor instanceof Processor) {
builder.chain((Processor) processor);
} else if (processor instanceof MessageProcessorBuilder) {
builder.chain((MessageProcessorBuilder) processor);
} else {
throw new IllegalArgumentException("MessageProcessorBuilder should only have MessageProcessors or MessageProcessorBuilders configured");
}
}
MessageProcessorExpressionPair filterPair = new MessageProcessorExpressionPair(expression, newLazyProcessorChainBuilder(builder, muleContext, () -> getProcessingStrategy(locator, getRootContainerLocation()).orElse(null)));
return filterPair;
}
use of org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder in project mule by mulesoft.
the class ProcessorChainBenchmark method setup.
@Setup
public void setup() throws Exception {
DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
for (int i = 0; i < NUM_PROCESSORS; i++) {
builder.chain(event -> event);
}
chain = builder.build();
chain.setMuleContext(createMuleContextWithServices());
event = builder(create("", "", CONNECTOR_LOCATION, NullExceptionHandler.getInstance())).message(of(PAYLOAD)).build();
}
use of org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder in project mule by mulesoft.
the class AsyncRequestReplyRequesterTestCase method createAsyncMessageProcessor.
protected AsyncDelegateMessageProcessor createAsyncMessageProcessor(SensingNullMessageProcessor target) throws InitialisationException {
DefaultMessageProcessorChainBuilder delegateBuilder = new DefaultMessageProcessorChainBuilder();
delegateBuilder.chain(target);
asyncMP = new AsyncDelegateMessageProcessor(delegateBuilder);
asyncMP.setAnnotations(getAppleFlowComponentLocationAnnotations());
initialiseIfNeeded(asyncMP, true, muleContext);
return asyncMP;
}
use of org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder in project mule by mulesoft.
the class MessageProcessorChainObjectFactory method getBuilderInstance.
protected MessageProcessorChainBuilder getBuilderInstance() {
DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
builder.setName("processor chain '" + name + "'");
return builder;
}
Aggregations