BATCH-955: removed class references
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,18 +17,17 @@ package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.batch.core.job.flow.support.StateTransition;
|
||||
import org.springframework.batch.core.job.flow.support.state.DecisionState;
|
||||
import org.springframework.batch.core.job.flow.support.state.JobExecutionDecider;
|
||||
import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* Internal parser for the <decision/> elements inside a job. A decision
|
||||
* element references a bean definition for a {@link JobExecutionDecider} and
|
||||
* goes on to list a set of transitions to other states with <next
|
||||
* element references a bean definition for a
|
||||
* {@link org.springframework.batch.core.job.flow.support.state.JobExecutionDecider}
|
||||
* and goes on to list a set of transitions to other states with <next
|
||||
* on="pattern" to="stepName"/>. Used by the {@link JobParser}.
|
||||
*
|
||||
* @see JobParser
|
||||
@@ -43,7 +42,8 @@ public class DecisionParser {
|
||||
*
|
||||
* @param element the <decision/gt; element to parse
|
||||
* @param parserContext the parser context for the bean factory
|
||||
* @return a collection of bean definitions for {@link StateTransition}
|
||||
* @return a collection of bean definitions for
|
||||
* {@link org.springframework.batch.core.job.flow.support.StateTransition}
|
||||
* instances objects
|
||||
*/
|
||||
public Collection<RuntimeBeanReference> parse(Element element, ParserContext parserContext) {
|
||||
@@ -51,7 +51,8 @@ public class DecisionParser {
|
||||
String refAttribute = element.getAttribute("decider");
|
||||
String idAttribute = element.getAttribute("id");
|
||||
|
||||
BeanDefinitionBuilder stateBuilder = BeanDefinitionBuilder.genericBeanDefinition(DecisionState.class);
|
||||
BeanDefinitionBuilder stateBuilder =
|
||||
BeanDefinitionBuilder.genericBeanDefinition("org.springframework.batch.core.job.flow.support.state.DecisionState");
|
||||
stateBuilder.addConstructorArgValue(new RuntimeBeanReference(refAttribute));
|
||||
stateBuilder.addConstructorArgValue(idAttribute);
|
||||
return StepParser.getNextElements(parserContext, stateBuilder.getBeanDefinition(), element);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,14 +18,13 @@ package org.springframework.batch.core.configuration.xml;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.core.job.flow.Flow;
|
||||
import org.springframework.batch.core.job.flow.support.SimpleFlow;
|
||||
import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.ManagedList;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.util.xml.DomUtils;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
@@ -38,7 +37,7 @@ public class FlowParser {
|
||||
* @param element the top level element containing a flow definition
|
||||
* @param parserContext the {@link ParserContext}
|
||||
* @param flowName the name of the flow
|
||||
* @return a bean definition for a {@link Flow}
|
||||
* @return a bean definition for a {@link org.springframework.batch.core.job.flow.Flow}
|
||||
*/
|
||||
public AbstractBeanDefinition parse(Element element, ParserContext parserContext, String flowName) {
|
||||
List<RuntimeBeanReference> stateTransitions = new ArrayList<RuntimeBeanReference>();
|
||||
@@ -64,7 +63,8 @@ public class FlowParser {
|
||||
stateTransitions.addAll(splitParser.parse(stepElement, parserContext));
|
||||
}
|
||||
|
||||
BeanDefinitionBuilder flowBuilder = BeanDefinitionBuilder.genericBeanDefinition(SimpleFlow.class);
|
||||
BeanDefinitionBuilder flowBuilder =
|
||||
BeanDefinitionBuilder.genericBeanDefinition("org.springframework.batch.core.job.flow.support.SimpleFlow");
|
||||
flowBuilder.addConstructorArgValue(flowName );
|
||||
ManagedList managedList = new ManagedList();
|
||||
@SuppressWarnings( { "unchecked", "unused" })
|
||||
|
||||
@@ -21,8 +21,6 @@ import static org.springframework.util.StringUtils.hasText;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.core.JobExecutionListener;
|
||||
import org.springframework.batch.core.listener.JobListenerFactoryBean;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.config.BeanReference;
|
||||
import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
@@ -35,11 +33,12 @@ import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.util.xml.DomUtils;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
|
||||
/**
|
||||
* {@link BeanDefinitionParser} for {@link JobExecutionListener}s
|
||||
* {@link BeanDefinitionParser} for {@link org.springframework.batch.core.JobExecutionListener}s
|
||||
*
|
||||
* @author Lucas Ward
|
||||
*
|
||||
@@ -52,7 +51,8 @@ public class JobExecutionListenerParser {
|
||||
List<BeanReference> listeners = new ArrayList<BeanReference>();
|
||||
List<Element> listenerElements = (List<Element>) DomUtils.getChildElementsByTagName(element, "listener");
|
||||
for(Element listenerElement : listenerElements){
|
||||
BeanDefinitionBuilder listenerBuilder = BeanDefinitionBuilder.genericBeanDefinition(JobListenerFactoryBean.class);
|
||||
BeanDefinitionBuilder listenerBuilder =
|
||||
BeanDefinitionBuilder.genericBeanDefinition("org.springframework.batch.core.listener.JobListenerFactoryBean");
|
||||
String id = listenerElement.getAttribute("id");
|
||||
String listenerRef = listenerElement.getAttribute("ref");
|
||||
String className = listenerElement.getAttribute("class");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.job.flow.FlowJob;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.ManagedList;
|
||||
@@ -25,11 +22,12 @@ import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.util.xml.DomUtils;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* Parser for the lt;job/gt; element in the Batch namespace. Sets up and returns
|
||||
* a bean definition for a {@link Job}.
|
||||
* a bean definition for a {@link org.springframework.batch.core.Job}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
@@ -37,9 +35,9 @@ import org.w3c.dom.Element;
|
||||
public class JobParser extends AbstractBeanDefinitionParser {
|
||||
|
||||
/**
|
||||
* Create a bean definition for a {@link FlowJob}. The
|
||||
* Create a bean definition for a {@link org.springframework.batch.core.job.flow.FlowJob}. The
|
||||
* <code>jobRepository</code> attribute is a reference to a
|
||||
* {@link JobRepository} and defaults to "jobRepository". Nested step
|
||||
* {@link org.springframework.batch.core.repository.JobRepository} and defaults to "jobRepository". Nested step
|
||||
* elements are delegated to a {@link StepParser}.
|
||||
*
|
||||
* @see AbstractBeanDefinitionParser#parseInternal(Element, ParserContext)
|
||||
@@ -47,7 +45,7 @@ public class JobParser extends AbstractBeanDefinitionParser {
|
||||
@Override
|
||||
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
|
||||
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(FlowJob.class);
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition("org.springframework.batch.core.job.flow.FlowJob");
|
||||
String jobName = element.getAttribute("id");
|
||||
builder.addConstructorArgValue(jobName);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,20 +19,19 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.core.job.flow.support.StateTransition;
|
||||
import org.springframework.batch.core.job.flow.support.state.JobExecutionDecider;
|
||||
import org.springframework.batch.core.job.flow.support.state.SplitState;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.ManagedList;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.util.xml.DomUtils;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* Internal parser for the <split/> elements inside a job. A split element
|
||||
* references a bean definition for a {@link JobExecutionDecider} and goes on to
|
||||
* references a bean definition for a
|
||||
* {@link org.springframework.batch.core.job.flow.support.state.JobExecutionDecider} and goes on to
|
||||
* list a set of transitions to other states with <next on="pattern"
|
||||
* to="stepName"/>. Used by the {@link JobParser}.
|
||||
*
|
||||
@@ -48,7 +47,8 @@ public class SplitParser {
|
||||
*
|
||||
* @param element the <split/gt; element to parse
|
||||
* @param parserContext the parser context for the bean factory
|
||||
* @return a collection of bean definitions for {@link StateTransition}
|
||||
* @return a collection of bean definitions for
|
||||
* {@link org.springframework.batch.core.job.flow.support.StateTransition}
|
||||
* instances objects
|
||||
*/
|
||||
public Collection<RuntimeBeanReference> parse(Element element, ParserContext parserContext) {
|
||||
@@ -58,7 +58,8 @@ public class SplitParser {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Element> flowElements = (List<Element>) DomUtils.getChildElementsByTagName(element, "flow");
|
||||
|
||||
BeanDefinitionBuilder stateBuilder = BeanDefinitionBuilder.genericBeanDefinition(SplitState.class);
|
||||
BeanDefinitionBuilder stateBuilder =
|
||||
BeanDefinitionBuilder.genericBeanDefinition("org.springframework.batch.core.job.flow.support.state.SplitState");
|
||||
|
||||
Collection<BeanDefinition> flows = new ArrayList<BeanDefinition>();
|
||||
FlowParser flowParser = new FlowParser();
|
||||
|
||||
Reference in New Issue
Block a user