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  
  * $Id: BpmNamespaceHandler.java 20321 2010-11-24 15:21:24Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 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  
  * Registers a Bean Definition Parsers for the "bpm" namespace.
 20  
  */
 21  0
 public class BpmNamespaceHandler extends AbstractMuleNamespaceHandler
 22  
 {
 23  
     /** 
 24  
      * Allows simple configuration of jBPM from the generic "bpm" namespace.  Otherwise you would need to include both the 
 25  
      * "bpm" and "jbpm" namespaces in your config, which is not really justified.
 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