1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.module.bpm.config; |
11 | |
|
12 | |
import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler; |
13 | |
import org.mule.config.spring.parsers.collection.ChildMapEntryDefinitionParser; |
14 | |
import org.mule.config.spring.parsers.generic.MuleOrphanDefinitionParser; |
15 | |
import org.mule.config.spring.parsers.specific.ComponentDefinitionParser; |
16 | |
import org.mule.module.bpm.ProcessComponent; |
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | 0 | public class BpmNamespaceHandler extends AbstractMuleNamespaceHandler |
22 | |
{ |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
public static final String JBPM_WRAPPER_CLASS = "org.mule.module.jbpm.Jbpm"; |
28 | |
|
29 | |
public void init() |
30 | |
{ |
31 | 0 | registerBeanDefinitionParser("process", new ProcessComponentDefinitionParser()); |
32 | |
|
33 | 0 | registerMuleBeanDefinitionParser("process-definition", new ChildMapEntryDefinitionParser("processDefinitions", "name", "resource")); |
34 | |
|
35 | |
try |
36 | |
{ |
37 | 0 | registerBeanDefinitionParser("jbpm", new MuleOrphanDefinitionParser(Class.forName(JBPM_WRAPPER_CLASS), true)); |
38 | |
} |
39 | 0 | catch (ClassNotFoundException e) |
40 | |
{ |
41 | 0 | logger.warn(e.getMessage()); |
42 | 0 | } |
43 | 0 | } |
44 | |
|
45 | 0 | class ProcessComponentDefinitionParser extends ComponentDefinitionParser |
46 | |
{ |
47 | |
public ProcessComponentDefinitionParser() |
48 | 0 | { |
49 | 0 | super(ProcessComponent.class); |
50 | 0 | addAlias("processName", "name"); |
51 | 0 | addAlias("processDefinition", "resource"); |
52 | 0 | } |
53 | |
} |
54 | |
} |
55 | |
|