Polishing
Issue: SPR-11262
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -87,7 +87,7 @@ public class LocalTaskExecutorThreadPool implements ThreadPool {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int blockForAvailableThreads() {
|
public int blockForAvailableThreads() {
|
||||||
// The present implementation always returns 1, making Quartz (1.6)
|
// The present implementation always returns 1, making Quartz
|
||||||
// always schedule any tasks that it feels like scheduling.
|
// always schedule any tasks that it feels like scheduling.
|
||||||
// This could be made smarter for specific TaskExecutors,
|
// This could be made smarter for specific TaskExecutors,
|
||||||
// for example calling {@code getMaximumPoolSize() - getActiveCount()}
|
// for example calling {@code getMaximumPoolSize() - getActiveCount()}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
|
|||||||
* in combination with the Trigger.
|
* in combination with the Trigger.
|
||||||
* @see #setTriggers
|
* @see #setTriggers
|
||||||
* @see org.quartz.JobDetail
|
* @see org.quartz.JobDetail
|
||||||
* @see JobDetailBean
|
|
||||||
* @see JobDetailAwareTrigger
|
|
||||||
*/
|
*/
|
||||||
public void setJobDetails(JobDetail... jobDetails) {
|
public void setJobDetails(JobDetail... jobDetails) {
|
||||||
// Use modifiable ArrayList here, to allow for further adding of
|
// Use modifiable ArrayList here, to allow for further adding of
|
||||||
@@ -180,15 +178,11 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
|
|||||||
* "jobDetails" property of this FactoryBean.
|
* "jobDetails" property of this FactoryBean.
|
||||||
* @see #setJobDetails
|
* @see #setJobDetails
|
||||||
* @see org.quartz.JobDetail
|
* @see org.quartz.JobDetail
|
||||||
* @see JobDetailAwareTrigger
|
|
||||||
* @see CronTriggerBean
|
|
||||||
* @see SimpleTriggerBean
|
|
||||||
*/
|
*/
|
||||||
public void setTriggers(Trigger... triggers) {
|
public void setTriggers(Trigger... triggers) {
|
||||||
this.triggers = Arrays.asList(triggers);
|
this.triggers = Arrays.asList(triggers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify Quartz SchedulerListeners to be registered with the Scheduler.
|
* Specify Quartz SchedulerListeners to be registered with the Scheduler.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ public class SimpleTriggerFactoryBean implements FactoryBean<SimpleTrigger>, Bea
|
|||||||
sti.setRepeatCount(this.repeatCount);
|
sti.setRepeatCount(this.repeatCount);
|
||||||
sti.setPriority(this.priority);
|
sti.setPriority(this.priority);
|
||||||
sti.setMisfireInstruction(this.misfireInstruction);
|
sti.setMisfireInstruction(this.misfireInstruction);
|
||||||
cti.setDescription(this.description);
|
sti.setDescription(this.description);
|
||||||
this.simpleTrigger = sti;
|
this.simpleTrigger = sti;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.http.converter.support;
|
package org.springframework.http.converter.support;
|
||||||
|
|
||||||
import javax.xml.transform.Source;
|
import javax.xml.transform.Source;
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat
|
|||||||
this.messageConverters.add(new ResourceHttpMessageConverter());
|
this.messageConverters.add(new ResourceHttpMessageConverter());
|
||||||
this.messageConverters.add(new SourceHttpMessageConverter<Source>());
|
this.messageConverters.add(new SourceHttpMessageConverter<Source>());
|
||||||
this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());
|
this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());
|
||||||
|
|
||||||
if (romePresent) {
|
if (romePresent) {
|
||||||
this.messageConverters.add(new AtomFeedHttpMessageConverter());
|
this.messageConverters.add(new AtomFeedHttpMessageConverter());
|
||||||
this.messageConverters.add(new RssChannelHttpMessageConverter());
|
this.messageConverters.add(new RssChannelHttpMessageConverter());
|
||||||
|
|||||||
@@ -133,6 +133,9 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
private static final boolean javaxValidationPresent = ClassUtils.isPresent(
|
private static final boolean javaxValidationPresent = ClassUtils.isPresent(
|
||||||
"javax.validation.Validator", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
"javax.validation.Validator", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
||||||
|
|
||||||
|
private static boolean romePresent =
|
||||||
|
ClassUtils.isPresent("com.sun.syndication.feed.WireFeed", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
||||||
|
|
||||||
private static final boolean jaxb2Present =
|
private static final boolean jaxb2Present =
|
||||||
ClassUtils.isPresent("javax.xml.bind.Binder", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
ClassUtils.isPresent("javax.xml.bind.Binder", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
||||||
|
|
||||||
@@ -144,9 +147,6 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
ClassUtils.isPresent("org.codehaus.jackson.map.ObjectMapper", AnnotationDrivenBeanDefinitionParser.class.getClassLoader()) &&
|
ClassUtils.isPresent("org.codehaus.jackson.map.ObjectMapper", AnnotationDrivenBeanDefinitionParser.class.getClassLoader()) &&
|
||||||
ClassUtils.isPresent("org.codehaus.jackson.JsonGenerator", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
ClassUtils.isPresent("org.codehaus.jackson.JsonGenerator", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
||||||
|
|
||||||
private static boolean romePresent =
|
|
||||||
ClassUtils.isPresent("com.sun.syndication.feed.WireFeed", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||||
@@ -338,7 +338,6 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void configurePathMatchingProperties(RootBeanDefinition handlerMappingDef, Element element) {
|
private void configurePathMatchingProperties(RootBeanDefinition handlerMappingDef, Element element) {
|
||||||
|
|
||||||
Element pathMatchingElement = DomUtils.getChildElementByTagName(element, "path-matching");
|
Element pathMatchingElement = DomUtils.getChildElementByTagName(element, "path-matching");
|
||||||
if(pathMatchingElement != null) {
|
if(pathMatchingElement != null) {
|
||||||
if (pathMatchingElement.hasAttribute("suffix-pattern")) {
|
if (pathMatchingElement.hasAttribute("suffix-pattern")) {
|
||||||
@@ -370,12 +369,12 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
props.put("atom", MediaType.APPLICATION_ATOM_XML_VALUE);
|
props.put("atom", MediaType.APPLICATION_ATOM_XML_VALUE);
|
||||||
props.put("rss", "application/rss+xml");
|
props.put("rss", "application/rss+xml");
|
||||||
}
|
}
|
||||||
if (jackson2Present || jacksonPresent) {
|
|
||||||
props.put("json", MediaType.APPLICATION_JSON_VALUE);
|
|
||||||
}
|
|
||||||
if (jaxb2Present) {
|
if (jaxb2Present) {
|
||||||
props.put("xml", MediaType.APPLICATION_XML_VALUE);
|
props.put("xml", MediaType.APPLICATION_XML_VALUE);
|
||||||
}
|
}
|
||||||
|
if (jackson2Present || jacksonPresent) {
|
||||||
|
props.put("json", MediaType.APPLICATION_JSON_VALUE);
|
||||||
|
}
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,7 +484,6 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
if (jaxb2Present) {
|
if (jaxb2Present) {
|
||||||
messageConverters.add(createConverterDefinition(Jaxb2RootElementHttpMessageConverter.class, source));
|
messageConverters.add(createConverterDefinition(Jaxb2RootElementHttpMessageConverter.class, source));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jackson2Present) {
|
if (jackson2Present) {
|
||||||
messageConverters.add(createConverterDefinition(MappingJackson2HttpMessageConverter.class, source));
|
messageConverters.add(createConverterDefinition(MappingJackson2HttpMessageConverter.class, source));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.xml.transform.Source;
|
import javax.xml.transform.Source;
|
||||||
@@ -143,6 +142,9 @@ import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolv
|
|||||||
*/
|
*/
|
||||||
public class WebMvcConfigurationSupport implements ApplicationContextAware, ServletContextAware {
|
public class WebMvcConfigurationSupport implements ApplicationContextAware, ServletContextAware {
|
||||||
|
|
||||||
|
private static boolean romePresent =
|
||||||
|
ClassUtils.isPresent("com.sun.syndication.feed.WireFeed", WebMvcConfigurationSupport.class.getClassLoader());
|
||||||
|
|
||||||
private static final boolean jaxb2Present =
|
private static final boolean jaxb2Present =
|
||||||
ClassUtils.isPresent("javax.xml.bind.Binder", WebMvcConfigurationSupport.class.getClassLoader());
|
ClassUtils.isPresent("javax.xml.bind.Binder", WebMvcConfigurationSupport.class.getClassLoader());
|
||||||
|
|
||||||
@@ -154,8 +156,6 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
|
|||||||
ClassUtils.isPresent("org.codehaus.jackson.map.ObjectMapper", WebMvcConfigurationSupport.class.getClassLoader()) &&
|
ClassUtils.isPresent("org.codehaus.jackson.map.ObjectMapper", WebMvcConfigurationSupport.class.getClassLoader()) &&
|
||||||
ClassUtils.isPresent("org.codehaus.jackson.JsonGenerator", WebMvcConfigurationSupport.class.getClassLoader());
|
ClassUtils.isPresent("org.codehaus.jackson.JsonGenerator", WebMvcConfigurationSupport.class.getClassLoader());
|
||||||
|
|
||||||
private static boolean romePresent =
|
|
||||||
ClassUtils.isPresent("com.sun.syndication.feed.WireFeed", WebMvcConfigurationSupport.class.getClassLoader());
|
|
||||||
|
|
||||||
private ServletContext servletContext;
|
private ServletContext servletContext;
|
||||||
|
|
||||||
@@ -225,9 +225,9 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
|
|||||||
InterceptorRegistry registry = new InterceptorRegistry();
|
InterceptorRegistry registry = new InterceptorRegistry();
|
||||||
addInterceptors(registry);
|
addInterceptors(registry);
|
||||||
registry.addInterceptor(new ConversionServiceExposingInterceptor(mvcConversionService()));
|
registry.addInterceptor(new ConversionServiceExposingInterceptor(mvcConversionService()));
|
||||||
interceptors = registry.getInterceptors();
|
this.interceptors = registry.getInterceptors();
|
||||||
}
|
}
|
||||||
return interceptors.toArray();
|
return this.interceptors.toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -264,12 +264,12 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
|
|||||||
map.put("atom", MediaType.APPLICATION_ATOM_XML);
|
map.put("atom", MediaType.APPLICATION_ATOM_XML);
|
||||||
map.put("rss", MediaType.valueOf("application/rss+xml"));
|
map.put("rss", MediaType.valueOf("application/rss+xml"));
|
||||||
}
|
}
|
||||||
if (jackson2Present || jacksonPresent) {
|
|
||||||
map.put("json", MediaType.APPLICATION_JSON);
|
|
||||||
}
|
|
||||||
if (jaxb2Present) {
|
if (jaxb2Present) {
|
||||||
map.put("xml", MediaType.APPLICATION_XML);
|
map.put("xml", MediaType.APPLICATION_XML);
|
||||||
}
|
}
|
||||||
|
if (jackson2Present || jacksonPresent) {
|
||||||
|
map.put("json", MediaType.APPLICATION_JSON);
|
||||||
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,6 +552,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
|
|||||||
messageConverters.add(new ResourceHttpMessageConverter());
|
messageConverters.add(new ResourceHttpMessageConverter());
|
||||||
messageConverters.add(new SourceHttpMessageConverter<Source>());
|
messageConverters.add(new SourceHttpMessageConverter<Source>());
|
||||||
messageConverters.add(new AllEncompassingFormHttpMessageConverter());
|
messageConverters.add(new AllEncompassingFormHttpMessageConverter());
|
||||||
|
|
||||||
if (romePresent) {
|
if (romePresent) {
|
||||||
messageConverters.add(new AtomFeedHttpMessageConverter());
|
messageConverters.add(new AtomFeedHttpMessageConverter());
|
||||||
messageConverters.add(new RssChannelHttpMessageConverter());
|
messageConverters.add(new RssChannelHttpMessageConverter());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -209,7 +209,7 @@ public class MappingJackson2JsonView extends AbstractView {
|
|||||||
/**
|
/**
|
||||||
* Set whether to serialize models containing a single attribute as a map or whether to
|
* Set whether to serialize models containing a single attribute as a map or whether to
|
||||||
* extract the single value from the model and serialize it directly.
|
* extract the single value from the model and serialize it directly.
|
||||||
* <p>The effect of setting this flag is similar to using {@code MappingJacksonHttpMessageConverter}
|
* <p>The effect of setting this flag is similar to using {@code MappingJackson2HttpMessageConverter}
|
||||||
* with an {@code @ResponseBody} request-handling method.
|
* with an {@code @ResponseBody} request-handling method.
|
||||||
* <p>Default is {@code false}.
|
* <p>Default is {@code false}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user