}
private MessageProcessor wrapMessageProcessorInAsyncChain(MessageProcessor messageProcessor)
throws MuleException
{
AsyncMessageProcessorsFactoryBean asyncMessageProcessorsFactoryBean = new AsyncMessageProcessorsFactoryBean();
asyncMessageProcessorsFactoryBean.setMuleContext(muleContext);
asyncMessageProcessorsFactoryBean.setMessageProcessors(Arrays.asList(messageProcessor));
asyncMessageProcessorsFactoryBean.setProcessingStrategy(new AsynchronousProcessingStrategy());
try
{
return ((MessageProcessor) asyncMessageProcessorsFactoryBean.getObject());
}
catch (Exception e)
{
throw new FlowConstructInvalidException(e);
}