View Javadoc

1   /*
2    * $Id: MuleDefinitionParser.java 19191 2010-08-25 21:05:23Z tcarlson $
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;
12  
13  import org.springframework.beans.factory.support.AbstractBeanDefinition;
14  import org.springframework.beans.factory.xml.BeanDefinitionParser;
15  import org.springframework.beans.factory.xml.ParserContext;
16  import org.w3c.dom.Element;
17  
18  /**
19   * This is the interface all Mule BDPs implement. It is a bit odd because it had to be retro-fitted
20   * to existing code. In particular {@link BeanDefinitionParser#parse(Element, ParserContext)}
21   * and {@link #muleParse(Element, ParserContext)} seem to duplicate each other. This is because 
22   * many Mule classes subclass a Spring helper which makes <code>parse()</code> final. So instead 
23   * we need to use {@link #muleParse(Element, ParserContext)}, to allow over-rides.
24   * <p>
25   * In case that's not clear - always call {@link #muleParse(Element, ParserContext)} rather than 
26   * {@link BeanDefinitionParser#parse(Element, ParserContext)}. The {@link BeanDefinitionParser} 
27   * is here only to allow the BDP to be handed over to Spring.
28   */
29  public interface MuleDefinitionParser extends BeanDefinitionParser, MuleDefinitionParserConfiguration
30  {
31  
32      AbstractBeanDefinition muleParse(Element element, ParserContext parserContext);
33  
34      String getBeanName(Element element);
35  
36  }