Coverage Report - org.mule.transport.bpm.config.BpmNamespaceHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
BpmNamespaceHandler
100%
6/6
N/A
1
BpmNamespaceHandler$BpmOutboundRouterDefinitionParser
43%
3/7
N/A
1
 
 1  
 /*
 2  
  * $Id: BpmNamespaceHandler.java 11659 2008-04-30 02:18:29Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.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  
  * Registers a Bean Definition Parsers for the "bpm" namespace.
 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  
         // TODO MULE-3205
 35  
         //registerBeanDefinitionParser("component", new ComponentDefinitionParser(ProcessComponent.class));
 36  4
     }
 37  
 
 38  
     /**
 39  
      * This is merely a shortcut for:
 40  
      *   <endpoint-selector-router evaluator="header" expression="MULE_BPM_ENDPOINT"> 
 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