View Javadoc

1   /*
2    * $Id: FlowDefinitionParser.java 22557 2011-07-25 22:48:27Z 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  
11  package org.mule.config.spring.parsers.specific;
12  
13  import org.mule.api.config.MuleProperties;
14  import org.mule.config.spring.parsers.generic.OrphanDefinitionParser;
15  import org.mule.config.spring.util.ProcessingStrategyUtils;
16  import org.mule.construct.Flow;
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  public class FlowDefinitionParser extends OrphanDefinitionParser
23  {
24      public FlowDefinitionParser()
25      {
26          super(Flow.class, true);
27          addIgnored("abstract");
28          addIgnored("name");
29          addIgnored("processingStrategy");
30      }
31  
32      @java.lang.Override
33      protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
34      {
35          builder.addConstructorArgValue(element.getAttribute(ATTRIBUTE_NAME));
36          builder.addConstructorArgReference(MuleProperties.OBJECT_MULE_CONTEXT);
37          ProcessingStrategyUtils.configureProcessingStrategy(element, builder,
38              ProcessingStrategyUtils.QUEUED_ASYNC_PROCESSING_STRATEGY);
39          super.doParse(element, parserContext, builder);
40      }
41  }