Rename ExecutorContext => SpecificationContext

This commit is contained in:
Chris Beams
2011-02-08 19:08:41 +00:00
parent c5063004eb
commit 2d76dde611
23 changed files with 133 additions and 131 deletions

View File

@@ -21,7 +21,7 @@ import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
@@ -41,7 +41,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
*/
public BeanDefinition parse(Element element, ParserContext parserContext) {
MvcAnnotationDriven spec = createSpecification(element, parserContext);
spec.execute(createExecutorContext(parserContext));
spec.execute(createSpecificationContext(parserContext));
return null;
}
@@ -87,13 +87,13 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
}
/**
* Adapt the given ParserContext instance into an ExecutorContext.
* Adapt the given ParserContext instance into an SpecificationContext.
*
* TODO SPR-7420: consider unifying the two through a superinterface.
* TODO SPR-7420: create a common ParserContext-to-ExecutorContext adapter util
* TODO SPR-7420: create a common ParserContext-to-SpecificationContext adapter util
*/
private ExecutorContext createExecutorContext(ParserContext parserContext) {
ExecutorContext executorContext = new ExecutorContext();
private SpecificationContext createSpecificationContext(ParserContext parserContext) {
SpecificationContext executorContext = new SpecificationContext();
executorContext.setRegistry(parserContext.getRegistry());
executorContext.setRegistrar(parserContext);
executorContext.setProblemReporter(parserContext.getReaderContext().getProblemReporter());

View File

@@ -19,7 +19,7 @@ package org.springframework.web.servlet.config;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter;
@@ -42,7 +42,7 @@ class DefaultServletHandlerBeanDefinitionParser implements BeanDefinitionParser
*/
public BeanDefinition parse(Element element, ParserContext parserContext) {
MvcDefaultServletHandler spec = createSpecification(element, parserContext);
spec.execute(createExecutorContext(parserContext));
spec.execute(createSpecificationContext(parserContext));
return null;
}
@@ -54,17 +54,17 @@ class DefaultServletHandlerBeanDefinitionParser implements BeanDefinitionParser
}
/**
* Adapt the given ParserContext instance into an ExecutorContext.
* Adapt the given ParserContext instance into an SpecificationContext.
*
* TODO SPR-7420: consider unifying the two through a superinterface.
* TODO SPR-7420: create a common ParserContext-to-ExecutorContext adapter util
* TODO SPR-7420: create a common ParserContext-to-SpecificationContext adapter util
*/
private ExecutorContext createExecutorContext(ParserContext parserContext) {
ExecutorContext executorContext = new ExecutorContext();
executorContext.setRegistry(parserContext.getRegistry());
executorContext.setRegistrar(parserContext);
executorContext.setProblemReporter(parserContext.getReaderContext().getProblemReporter());
return executorContext;
private SpecificationContext createSpecificationContext(ParserContext parserContext) {
SpecificationContext context = new SpecificationContext();
context.setRegistry(parserContext.getRegistry());
context.setRegistrar(parserContext);
context.setProblemReporter(parserContext.getReaderContext().getProblemReporter());
return context;
}
}

View File

@@ -154,7 +154,7 @@ public final class MvcAnnotationDriven extends AbstractFeatureSpecification {
/**
* Indicates whether or not default HttpMessageConverter registrations should
* be added in addition to the ones provided via
* {@link #messageConverters(HttpMessageConverter...).
* {@link #messageConverters(HttpMessageConverter...)}
*
* @param shouldRegister true will result in registration of defaults.
*/

View File

@@ -23,7 +23,7 @@ import org.springframework.beans.factory.parsing.CompositeComponentDefinition;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.config.AbstractSpecificationExecutor;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.format.support.FormattingConversionServiceFactoryBean;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
@@ -74,8 +74,8 @@ final class MvcAnnotationDrivenExecutor extends AbstractSpecificationExecutor<Mv
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
@Override
public void doExecute(MvcAnnotationDriven spec, ExecutorContext executorContext) {
ComponentRegistrar registrar = executorContext.getRegistrar();
public void doExecute(MvcAnnotationDriven spec, SpecificationContext specContext) {
ComponentRegistrar registrar = specContext.getRegistrar();
Object source = spec.source();
RootBeanDefinition annMappingDef = new RootBeanDefinition(DefaultAnnotationHandlerMapping.class);

View File

@@ -25,7 +25,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.config.AbstractSpecificationExecutor;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter;
@@ -45,9 +45,9 @@ final class MvcDefaultServletHandlerExecutor extends AbstractSpecificationExecut
private static final String HANDLER_ADAPTER_BEAN_NAME = "org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter";
@Override
protected void doExecute(MvcDefaultServletHandler spec, ExecutorContext executorContext) {
BeanDefinitionRegistry registry = executorContext.getRegistry();
ComponentRegistrar registrar = executorContext.getRegistrar();
protected void doExecute(MvcDefaultServletHandler spec, SpecificationContext specContext) {
BeanDefinitionRegistry registry = specContext.getRegistry();
ComponentRegistrar registrar = specContext.getRegistrar();
Object source = spec.source();
if (!registry.containsBeanDefinition(HANDLER_ADAPTER_BEAN_NAME)) {

View File

@@ -25,7 +25,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.config.AbstractSpecificationExecutor;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter;
import org.springframework.web.servlet.resource.ResourceHttpRequestHandler;
@@ -44,9 +44,9 @@ final class MvcResourcesExecutor extends AbstractSpecificationExecutor<MvcResour
private static final String HANDLER_ADAPTER_BEAN_NAME = "org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter";
@Override
protected void doExecute(MvcResources spec, ExecutorContext executorContext) {
BeanDefinitionRegistry registry = executorContext.getRegistry();
ComponentRegistrar registrar = executorContext.getRegistrar();
protected void doExecute(MvcResources spec, SpecificationContext specContext) {
BeanDefinitionRegistry registry = specContext.getRegistry();
ComponentRegistrar registrar = specContext.getRegistrar();
Object source = spec.source();
if (!registry.containsBeanDefinition(HANDLER_ADAPTER_BEAN_NAME)) {

View File

@@ -23,7 +23,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.config.AbstractSpecificationExecutor;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import org.springframework.web.servlet.mvc.ParameterizableViewController;
import org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter;
@@ -44,9 +44,9 @@ final class MvcViewControllersExecutor extends AbstractSpecificationExecutor<Mvc
private static final String HANDLER_MAPPING_BEAN_NAME = "org.springframework.web.servlet.config.viewControllerHandlerMapping";
@Override
protected void doExecute(MvcViewControllers spec, ExecutorContext executorContext) {
BeanDefinitionRegistry registry = executorContext.getRegistry();
ComponentRegistrar registrar = executorContext.getRegistrar();
protected void doExecute(MvcViewControllers spec, SpecificationContext specContext) {
BeanDefinitionRegistry registry = specContext.getRegistry();
ComponentRegistrar registrar = specContext.getRegistrar();
Object source = spec.source();
if (!registry.containsBeanDefinition(HANDLER_ADAPTER_BEAN_NAME)) {

View File

@@ -19,7 +19,7 @@ package org.springframework.web.servlet.config;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;
@@ -40,7 +40,7 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
public BeanDefinition parse(Element element, ParserContext parserContext) {
MvcResources spec = createSpecification(element, parserContext);
if (spec != null) {
spec.execute(createExecutorContext(parserContext));
spec.execute(createSpecificationContext(parserContext));
}
return null;
}
@@ -71,17 +71,17 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
}
/**
* Adapt the given ParserContext instance into an ExecutorContext.
* Adapt the given ParserContext instance into an SpecificationContext.
*
* TODO SPR-7420: consider unifying the two through a superinterface.
* TODO SPR-7420: create a common ParserContext-to-ExecutorContext adapter util
* TODO SPR-7420: create a common ParserContext-to-SpecificationContext adapter util
*/
private ExecutorContext createExecutorContext(ParserContext parserContext) {
ExecutorContext executorContext = new ExecutorContext();
executorContext.setRegistry(parserContext.getRegistry());
executorContext.setRegistrar(parserContext);
executorContext.setProblemReporter(parserContext.getReaderContext().getProblemReporter());
return executorContext;
private SpecificationContext createSpecificationContext(ParserContext parserContext) {
SpecificationContext context = new SpecificationContext();
context.setRegistry(parserContext.getRegistry());
context.setRegistrar(parserContext);
context.setProblemReporter(parserContext.getReaderContext().getProblemReporter());
return context;
}
}

View File

@@ -19,7 +19,7 @@ package org.springframework.web.servlet.config;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.context.config.ExecutorContext;
import org.springframework.context.config.SpecificationContext;
import org.springframework.web.servlet.mvc.ParameterizableViewController;
import org.w3c.dom.Element;
@@ -43,22 +43,22 @@ class ViewControllerBeanDefinitionParser implements BeanDefinitionParser {
new MvcViewControllers(path, viewName.isEmpty() ? null : viewName)
.source(parserContext.extractSource(element))
.sourceName(element.getTagName())
.execute(createExecutorContext(parserContext));
.execute(createSpecificationContext(parserContext));
return null;
}
/**
* Adapt the given ParserContext instance into an ExecutorContext.
* Adapt the given ParserContext instance into an SpecificationContext.
*
* TODO SPR-7420: consider unifying the two through a superinterface.
* TODO SPR-7420: create a common ParserContext-to-ExecutorContext adapter util
* TODO SPR-7420: create a common ParserContext-to-SpecificationContext adapter util
*/
private ExecutorContext createExecutorContext(ParserContext parserContext) {
ExecutorContext executorContext = new ExecutorContext();
executorContext.setRegistry(parserContext.getRegistry());
executorContext.setRegistrar(parserContext);
executorContext.setProblemReporter(parserContext.getReaderContext().getProblemReporter());
return executorContext;
private SpecificationContext createSpecificationContext(ParserContext parserContext) {
SpecificationContext context = new SpecificationContext();
context.setRegistry(parserContext.getRegistry());
context.setRegistrar(parserContext);
context.setProblemReporter(parserContext.getReaderContext().getProblemReporter());
return context;
}
}