use of org.mule.runtime.core.internal.routing.MessageProcessorExpressionPair 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.internal.routing.MessageProcessorExpressionPair in project mule by mulesoft.
the class AbstractSelectiveRouterObjectFactory method doGetObject.
@Override
public AbstractSelectiveRouter doGetObject() throws Exception {
final AbstractSelectiveRouter router = newAbstractSelectiveRouter();
router.setAnnotations(getAnnotations());
router.setDefaultRoute(defaultProcessor);
router.setMuleContext(muleContext);
for (final MessageProcessorExpressionPair mpfp : conditionalMessageProcessors) {
router.addRoute(mpfp.getExpression(), mpfp.getMessageProcessor());
}
return router;
}
Aggregations