1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config.spring.parsers.specific; |
8 | |
|
9 | |
import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser; |
10 | |
import org.mule.config.spring.parsers.PostProcessor; |
11 | |
import org.mule.config.spring.parsers.assembly.BeanAssembler; |
12 | |
import org.mule.routing.MessageFilter; |
13 | |
import org.springframework.beans.factory.xml.ParserContext; |
14 | |
import org.w3c.dom.Element; |
15 | |
|
16 | |
public class MessageFilterDefinitionParser extends MessageProcessorDefinitionParser implements PostProcessor |
17 | |
{ |
18 | |
private static final String ATTRIBUTE_UNACCEPTED = "onUnaccepted"; |
19 | |
|
20 | |
public MessageFilterDefinitionParser() |
21 | |
{ |
22 | 0 | super(MessageFilter.class); |
23 | 0 | addIgnored(AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME); |
24 | 0 | addIgnored(ATTRIBUTE_UNACCEPTED); |
25 | 0 | registerPostProcessor(this); |
26 | 0 | } |
27 | |
|
28 | |
public void postProcess(ParserContext context, BeanAssembler assembler, Element element) |
29 | |
{ |
30 | 0 | String onUnaccepted = element.getAttribute(ATTRIBUTE_UNACCEPTED); |
31 | 0 | if (onUnaccepted != null) |
32 | |
{ |
33 | 0 | assembler.extendBean("unacceptedMessageProcessor", onUnaccepted, true); |
34 | |
} |
35 | 0 | } |
36 | |
} |