use of org.mule.runtime.core.privileged.processor.MessageProcessorBuilder 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.MessageProcessorBuilder 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.MessageProcessorBuilder in project mule by mulesoft.
the class ResponseMessageProcessorsFactoryBean method doGetObject.
@Override
public ResponseMessageProcessorAdapter doGetObject() throws Exception {
DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
builder.setName("'response' child processor 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");
}
}
ResponseMessageProcessorAdapter responseAdapter = new ResponseMessageProcessorAdapter();
responseAdapter.setProcessor(newLazyProcessorChainBuilder(builder, muleContext, () -> getProcessingStrategy(locator, getRootContainerLocation()).orElse(null)));
responseAdapter.setMuleContext(muleContext);
return responseAdapter;
}
Aggregations