View Javadoc

1   package org.springframework.batch.core.configuration.xml;
2   
3   import org.springframework.batch.core.listener.AbstractListenerFactoryBean;
4   import org.springframework.beans.factory.support.BeanDefinitionBuilder;
5   import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
6   import org.springframework.beans.factory.xml.ParserContext;
7   import org.w3c.dom.Element;
8   
9   /**
10   * Parse <step-listener/> elements in the batch namespace.
11   * 
12   * @author Dan Garrette
13   * @since 2.0
14   */
15  public class TopLevelStepListenerParser extends AbstractSingleBeanDefinitionParser {
16  
17  	private static final StepListenerParser stepListenerParser = new StepListenerParser();
18  
19  	@Override
20  	protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
21  		CoreNamespaceUtils.autoregisterBeansForNamespace(parserContext, element);
22  		stepListenerParser.doParse(element, parserContext, builder);
23  	}
24  
25  	@Override
26  	protected Class<? extends AbstractListenerFactoryBean> getBeanClass(Element element) {
27  		return stepListenerParser.getBeanClass();
28  	}
29  
30  }