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