From 0b3f0257076e94fddb0ac969d373dfa8046f576c Mon Sep 17 00:00:00 2001 From: nebhale Date: Mon, 18 Feb 2008 15:21:33 +0000 Subject: [PATCH] Moved the fist namespace to execution from core --- .../BatchCoreNamespaceHandler.java | 24 +++++++++++++++++++ .../JobBeanDefinitionParser.java | 21 ++++++++++++++++ .../main/resources/META-INF/spring.handlers | 1 + .../main/resources/META-INF/spring.schemas | 1 + .../config/spring-batch-execution-1.0.xsd | 4 ++-- 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchCoreNamespaceHandler.java create mode 100644 spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/JobBeanDefinitionParser.java create mode 100644 spring-batch-execution/src/main/resources/META-INF/spring.handlers create mode 100644 spring-batch-execution/src/main/resources/META-INF/spring.schemas rename spring-batch-core/src/main/resources/org/springframework/batch/core/config/spring-batch-core.xsd => spring-batch-execution/src/main/resources/org/springframework/batch/execution/config/spring-batch-execution-1.0.xsd (96%) diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchCoreNamespaceHandler.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchCoreNamespaceHandler.java new file mode 100644 index 000000000..1339ca06f --- /dev/null +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchCoreNamespaceHandler.java @@ -0,0 +1,24 @@ +package org.springframework.batch.execution.configuration; + +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.beans.factory.xml.NamespaceHandlerSupport; + +/** + * NamespaceHandler for the batch namespace. + * + *

Provides a {@link BeanDefinitionParser} for the <batch:job> tag. A job + * tag can include nested chunked-step and tasklet-step tags. + * + * @author Ben Hale + */ +public class BatchCoreNamespaceHandler extends NamespaceHandlerSupport { + + /** + * Register the {@link BeanDefinitionParser BeanDefinitionParser} for the + * 'job', tag. + */ + public void init() { + registerBeanDefinitionParser("job", new JobBeanDefinitionParser()); + } + +} diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/JobBeanDefinitionParser.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/JobBeanDefinitionParser.java new file mode 100644 index 000000000..c4d42229e --- /dev/null +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/JobBeanDefinitionParser.java @@ -0,0 +1,21 @@ +package org.springframework.batch.execution.configuration; + +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.w3c.dom.Element; + +class JobBeanDefinitionParser implements BeanDefinitionParser { + + private static final String JOB = "job"; + + private static final String CHUNKING_STEP = "chunking-step"; + + private static final String TASKLET_STEP ="tasklet-step"; + + public BeanDefinition parse(Element element, ParserContext parserContext) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException(); + } + +} diff --git a/spring-batch-execution/src/main/resources/META-INF/spring.handlers b/spring-batch-execution/src/main/resources/META-INF/spring.handlers new file mode 100644 index 000000000..c3d371f98 --- /dev/null +++ b/spring-batch-execution/src/main/resources/META-INF/spring.handlers @@ -0,0 +1 @@ +http\://www.springframework.org/schema/batch-execution=org.springframework.batch.execution.config.BatchCoreNamespaceHandler diff --git a/spring-batch-execution/src/main/resources/META-INF/spring.schemas b/spring-batch-execution/src/main/resources/META-INF/spring.schemas new file mode 100644 index 000000000..b9b173a13 --- /dev/null +++ b/spring-batch-execution/src/main/resources/META-INF/spring.schemas @@ -0,0 +1 @@ +http\://www.springframework.org/schema/batch/spring-batch-execution-1.0.xsd=org/springframework/batch/core/config/spring-batch-execution-1.0.xsd diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/config/spring-batch-core.xsd b/spring-batch-execution/src/main/resources/org/springframework/batch/execution/config/spring-batch-execution-1.0.xsd similarity index 96% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/config/spring-batch-core.xsd rename to spring-batch-execution/src/main/resources/org/springframework/batch/execution/config/spring-batch-execution-1.0.xsd index 93013f159..ae1e6107f 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/config/spring-batch-core.xsd +++ b/spring-batch-execution/src/main/resources/org/springframework/batch/execution/config/spring-batch-execution-1.0.xsd @@ -1,7 +1,7 @@ -