1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.transport.bpm.config; |
11 | |
|
12 | |
import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler; |
13 | |
import org.mule.config.spring.parsers.specific.RouterDefinitionParser; |
14 | |
import org.mule.endpoint.URIBuilder; |
15 | |
import org.mule.routing.outbound.EndpointSelector; |
16 | |
import org.mule.transport.bpm.ProcessConnector; |
17 | |
|
18 | |
import org.springframework.beans.factory.support.BeanDefinitionBuilder; |
19 | |
import org.springframework.beans.factory.xml.ParserContext; |
20 | |
import org.w3c.dom.Element; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | 4 | public class BpmNamespaceHandler extends AbstractMuleNamespaceHandler |
26 | |
{ |
27 | |
public static final String PROCESS = "process"; |
28 | |
|
29 | |
public void init() |
30 | |
{ |
31 | 4 | registerStandardTransportEndpoints(ProcessConnector.PROTOCOL, new String[]{PROCESS}).addAlias(PROCESS, URIBuilder.PATH); |
32 | 4 | registerConnectorDefinitionParser(ProcessConnector.class); |
33 | 4 | registerBeanDefinitionParser("outbound-router", new BpmOutboundRouterDefinitionParser()); |
34 | |
|
35 | |
|
36 | 4 | } |
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | 4 | class BpmOutboundRouterDefinitionParser extends RouterDefinitionParser |
43 | |
{ |
44 | |
public BpmOutboundRouterDefinitionParser() |
45 | 4 | { |
46 | 4 | super(EndpointSelector.class); |
47 | 4 | } |
48 | |
|
49 | |
protected void parseChild(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) |
50 | |
{ |
51 | 0 | builder.addPropertyValue("evaluator", "header"); |
52 | 0 | builder.addPropertyValue("expression", ProcessConnector.PROPERTY_ENDPOINT); |
53 | 0 | super.parseChild(element, parserContext, builder); |
54 | 0 | } |
55 | |
|
56 | |
} |
57 | |
} |
58 | |
|