Coverage Report - org.mule.module.bpm.config.BpmNamespaceHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
BpmNamespaceHandler
0%
0/9
N/A
1.5
BpmNamespaceHandler$ProcessComponentDefinitionParser
0%
0/5
N/A
1.5
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.module.bpm.config;
 8  
 
 9  
 import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
 10  
 import org.mule.config.spring.parsers.collection.ChildMapEntryDefinitionParser;
 11  
 import org.mule.config.spring.parsers.generic.MuleOrphanDefinitionParser;
 12  
 import org.mule.config.spring.parsers.specific.ComponentDefinitionParser;
 13  
 import org.mule.module.bpm.ProcessComponent;
 14  
 
 15  
 /**
 16  
  * Registers a Bean Definition Parsers for the "bpm" namespace.
 17  
  */
 18  0
 public class BpmNamespaceHandler extends AbstractMuleNamespaceHandler
 19  
 {
 20  
     /** 
 21  
      * Allows simple configuration of jBPM from the generic "bpm" namespace.  Otherwise you would need to include both the 
 22  
      * "bpm" and "jbpm" namespaces in your config, which is not really justified.
 23  
      */
 24  
     public static final String JBPM_WRAPPER_CLASS = "org.mule.module.jbpm.Jbpm";
 25  
 
 26  
     public void init()
 27  
     {
 28  0
         registerBeanDefinitionParser("process", new ProcessComponentDefinitionParser());
 29  
 
 30  0
         registerMuleBeanDefinitionParser("process-definition", new ChildMapEntryDefinitionParser("processDefinitions", "name", "resource"));
 31  
 
 32  
         try
 33  
         {
 34  0
             registerBeanDefinitionParser("jbpm", new MuleOrphanDefinitionParser(Class.forName(JBPM_WRAPPER_CLASS), true));
 35  
         }
 36  0
         catch (ClassNotFoundException e)
 37  
         {
 38  0
             logger.warn(e.getMessage());
 39  0
         }
 40  0
     }
 41  
     
 42  0
     class ProcessComponentDefinitionParser extends ComponentDefinitionParser
 43  
     {
 44  
         public ProcessComponentDefinitionParser()
 45  0
         {
 46  0
             super(ProcessComponent.class);
 47  0
             addAlias("processName", "name");
 48  0
             addAlias("processDefinition", "resource");
 49  0
         }
 50  
     }
 51  
 }
 52