//build new dynamic chains
DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder(flow);
builder.chain(preMessageProcessors);
builder.chain(staticChain);
builder.chain(postMessageProcessors);
MessageProcessorChain newChain = builder.build();
Lifecycle preChainOld = preChain;
Lifecycle postChainOld = postChain;
preChain = new SimpleMessageProcessorChain(preMessageProcessors);