language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -35,11 +35,12 @@ * implementations of the {@link ContextLoader} SPI. Provides a * <em>Template Method</em> based approach for {@link #processLocations processing} * resource locations. - * + * * <p>As of Spring 3.1, <code>AbstractContextLoader</code> also provides a basis * for all concrete implementations of the {@link SmartContextLoader} SPI. For - * backwards compatibility with the {@code ContextLoader} SPI, - * {@link #processContextConfiguration()} delegates to {@link #processLocations()}. + * backwards compatibility with the {@code ContextLoader} SPI, + * {@link #processContextConfiguration(ContextConfigurationAttributes)} delegates + * to {@link #processLocations(Class, String...)}. * * @author Sam Brannen * @author Juergen Hoeller @@ -59,7 +60,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader { /** * For backwards compatibility with the {@link ContextLoader} SPI, the - * default implementation simply delegates to {@link #processLocations()}, + * default implementation simply delegates to {@link #processLocations(Class, String...)}, * passing it the {@link ContextConfigurationAttributes#getDeclaringClass() * declaring class} and {@link ContextConfigurationAttributes#getLocations() * resource locations} retrieved from the supplied @@ -70,7 +71,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader { * <p>Can be overridden in subclasses &mdash; for example, to process * configuration classes instead of resource locations. * @since 3.1 - * @see #processLocations() + * @see #processLocations(Class, String...) */ public void processContextConfiguration(ContextConfigurationAttributes configAttributes) { String[] processedLocations = processLocations(configAttributes.getDeclaringClass(), @@ -96,10 +97,10 @@ public void processContextConfiguration(ContextConfigurationAttributes configAtt * @return a processed array of application context resource locations * @since 2.5 * @see #isGenerateDefaultLocations() - * @see #generateDefaultLocations() - * @see #modifyLocations() - * @see org.springframework.test.context.ContextLoader#processLocations() - * @see #processContextConfiguration() + * @see #generateDefaultLocations(Class) + * @see #modifyLocations(Class, String...) + * @see org.springframework.test.context.ContextLoader#processLocations(Class, String...) + * @see #processContextConfiguration(ContextConfigurationAttributes) */ public final String[] processLocations(Class<?> clazz, String... locations) { return (ObjectUtils.isEmpty(locations) && isGenerateDefaultLocations()) ? generateDefaultLocations(clazz) @@ -115,7 +116,7 @@ public final String[] processLocations(Class<?> clazz, String... locations) { * where <code>&lt;suffix&gt;</code> is the value of the * {@link #getResourceSuffix() resource suffix} string. * <p>As of Spring 3.1, the implementation of this method adheres to the - * contract defined in the {@link SmartContextLoader} SPI. Specifically, + * contract defined in the {@link SmartContextLoader} SPI. Specifically, * this method will <em>preemptively</em> verify that the generated default * location actually exists. If it does not exist, this method will log a * warning and return an empty array. @@ -189,14 +190,15 @@ else if (!ResourcePatternUtils.isUrl(path)) { /** * Determine whether or not <em>default</em> resource locations should be * generated if the <code>locations</code> provided to - * {@link #processLocations()} are <code>null</code> or empty. + * {@link #processLocations(Class, String...)} are <code>null</code> or empty. * <p>As of Spring 3.1, the semantics of this method have been overloaded * to include detection of either default resource locations or default - * configuration classes. Consequently, this method can also be used to + * configuration classes. Consequently, this method can also be used to * determine whether or not <em>default</em> configuration classes should be * detected if the <code>classes</code> present in the * {@link ContextConfigurationAttributes configuration attributes} supplied - * to {@link #processContextConfiguration()} are <code>null</code> or empty. + * to {@link #processContextConfiguration(ContextConfigurationAttributes)} + * are <code>null</code> or empty. * <p>Can be overridden by subclasses to change the default behavior. * @return always <code>true</code> by default * @since 2.5 @@ -211,7 +213,7 @@ protected boolean isGenerateDefaultLocations() { * <p>Must be implemented by subclasses. * @return the resource suffix; should not be <code>null</code> or empty * @since 2.5 - * @see #generateDefaultLocations() + * @see #generateDefaultLocations(Class) */ protected abstract String getResourceSuffix();
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -29,7 +29,7 @@ /** * Abstract, generic extension of {@link AbstractContextLoader} that loads a * {@link GenericApplicationContext}. - * + * * <ul> * <li>If instances of concrete subclasses are invoked via the * {@link org.springframework.test.context.ContextLoader ContextLoader} SPI, the @@ -38,7 +38,7 @@ * <li>If instances of concrete subclasses are invoked via the * {@link org.springframework.test.context.SmartContextLoader SmartContextLoader} * SPI, the context will be loaded from the {@link MergedContextConfiguration} - * provided to {@link #loadContext(MergedContextConfiguration)}. In such cases, a + * provided to {@link #loadContext(MergedContextConfiguration)}. In such cases, a * <code>SmartContextLoader</code> will decide whether to load the context from * <em>locations</em> or * {@link org.springframework.context.annotation.Configuration configuration classes}.</li> @@ -68,17 +68,17 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader * <li>Sets the <em>active bean definition profiles</em> from the supplied * <code>MergedContextConfiguration</code> in the * {@link org.springframework.core.env.Environment Environment} of the context.</li> - * <li>Calls {@link #prepareContext()} to allow for customizing the context + * <li>Calls {@link #prepareContext(GenericApplicationContext)} to allow for customizing the context * before bean definitions are loaded.</li> - * <li>Calls {@link #customizeBeanFactory()} to allow for customizing the + * <li>Calls {@link #customizeBeanFactory(DefaultListableBeanFactory)} to allow for customizing the * context's <code>DefaultListableBeanFactory</code>.</li> - * <li>Delegates to {@link #loadBeanDefinitions()} to populate the context - * from the configuration locations or classes in the supplied + * <li>Delegates to {@link #loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration)} + * to populate the context from the configuration locations or classes in the supplied * <code>MergedContextConfiguration</code>.</li> * <li>Delegates to {@link AnnotationConfigUtils} for * {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering} * annotation configuration processors.</li> - * <li>Calls {@link #customizeContext()} to allow for customizing the context + * <li>Calls {@link #customizeContext(GenericApplicationContext)} to allow for customizing the context * before it is refreshed.</li> * <li>{@link ConfigurableApplicationContext#refresh Refreshes} the * context and registers a JVM shutdown hook for it.</li> @@ -110,17 +110,17 @@ public final ConfigurableApplicationContext loadContext(MergedContextConfigurati * <p>Implementation details: * <ul> * <li>Creates a {@link GenericApplicationContext} instance.</li> - * <li>Calls {@link #prepareContext()} to allow for customizing the context + * <li>Calls {@link #prepareContext(GenericApplicationContext)} to allow for customizing the context * before bean definitions are loaded.</li> - * <li>Calls {@link #customizeBeanFactory()} to allow for customizing the + * <li>Calls {@link #customizeBeanFactory(DefaultListableBeanFactory)} to allow for customizing the * context's <code>DefaultListableBeanFactory</code>.</li> - * <li>Delegates to {@link #createBeanDefinitionReader()} to create a + * <li>Delegates to {@link #createBeanDefinitionReader(GenericApplicationContext)} to create a * {@link BeanDefinitionReader} which is then used to populate the context * from the specified config locations.</li> * <li>Delegates to {@link AnnotationConfigUtils} for * {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering} * annotation configuration processors.</li> - * <li>Calls {@link #customizeContext()} to allow for customizing the context + * <li>Calls {@link #customizeContext(GenericApplicationContext)} to allow for customizing the context * before it is refreshed.</li> * <li>{@link ConfigurableApplicationContext#refresh Refreshes} the * context and registers a JVM shutdown hook for it.</li> @@ -188,16 +188,16 @@ protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory) { * from the configuration locations or classes in the supplied * <code>MergedContextConfiguration</code>.</li> * <p>The default implementation delegates to the {@link BeanDefinitionReader} - * returned by {@link #createBeanDefinitionReader()} to + * returned by {@link #createBeanDefinitionReader(GenericApplicationContext)} to * {@link BeanDefinitionReader#loadBeanDefinitions(String) load} the * bean definitions. * <p>Subclasses must provide an appropriate implementation of - * {@link #createBeanDefinitionReader()}. Alternatively subclasses may + * {@link #createBeanDefinitionReader(GenericApplicationContext)}. Alternatively subclasses may * provide a <em>no-op</em> implementation of {@code createBeanDefinitionReader()} * and override this method to provide a custom strategy for loading or * registering bean definitions. * @param context the context into which the bean definitions should be loaded - * @param mergedConfig the merged context configuration + * @param mergedConfig the merged context configuration * @see #loadContext(MergedContextConfiguration) * @since 3.1 */
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -35,7 +35,7 @@ * Concrete implementation of {@link AbstractGenericContextLoader} that loads * bean definitions from * {@link org.springframework.context.annotation.Configuration configuration classes}. - * + * * <p>Note: <code>AnnotationConfigContextLoader</code> supports * {@link org.springframework.context.annotation.Configuration configuration classes} * rather than the String-based resource locations defined by the legacy @@ -46,13 +46,13 @@ * <code>AbstractContextLoader</code> or <code>AbstractGenericContextLoader</code>. * Consequently, <code>AnnotationConfigContextLoader</code> should chiefly be * considered a {@link org.springframework.test.context.SmartContextLoader SmartContextLoader} - * rather than a {@link org.springframework.test.context.ContextLoader ContextLoader}. - * + * rather than a {@link org.springframework.test.context.ContextLoader ContextLoader}. + * * @author Sam Brannen * @since 3.1 - * @see #processContextConfiguration() - * @see #detectDefaultConfigurationClasses() - * @see #loadBeanDefinitions() + * @see #processContextConfiguration(ContextConfigurationAttributes) + * @see #detectDefaultConfigurationClasses(Class) + * @see #loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration) */ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader { @@ -72,9 +72,9 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader * supplied configuration attributes. Otherwise, properties in the supplied * configuration attributes will not be modified. * @param configAttributes the context configuration attributes to process - * @see org.springframework.test.context.SmartContextLoader#processContextConfiguration() + * @see org.springframework.test.context.SmartContextLoader#processContextConfiguration(ContextConfigurationAttributes) * @see #isGenerateDefaultLocations() - * @see #detectDefaultConfigurationClasses() + * @see #detectDefaultConfigurationClasses(Class) */ public void processContextConfiguration(ContextConfigurationAttributes configAttributes) { if (ObjectUtils.isEmpty(configAttributes.getClasses()) && isGenerateDefaultLocations()) { @@ -117,7 +117,7 @@ private boolean isDefaultConfigurationClassCandidate(Class<?> clazz) { * {@link Configuration @Configuration}. * <p>The implementation of this method adheres to the contract defined in the * {@link org.springframework.test.context.SmartContextLoader SmartContextLoader} - * SPI. Specifically, this method uses introspection to detect default + * SPI. Specifically, this method uses introspection to detect default * configuration classes that comply with the constraints required of * {@code @Configuration} class implementations. If a potential candidate * configuration class does meet these requirements, this method will log a @@ -187,7 +187,7 @@ protected String[] generateDefaultLocations(Class<?> clazz) { } /** - * <code>AnnotationConfigContextLoader</code> should be used as a + * <code>AnnotationConfigContextLoader</code> should be used as a * {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}, * not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}. * Consequently, this method is not supported. @@ -226,7 +226,7 @@ protected void loadBeanDefinitions(GenericApplicationContext context, MergedCont } /** - * <code>AnnotationConfigContextLoader</code> should be used as a + * <code>AnnotationConfigContextLoader</code> should be used as a * {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}, * not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}. * Consequently, this method is not supported.
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-tx/src/main/java/org/springframework/jca/work/jboss/JBossWorkManagerUtils.java
@@ -53,7 +53,7 @@ public static WorkManager getWorkManager() { /** * Obtain the default JBoss JCA WorkManager through a JMX lookup * for the JBossWorkManagerMBean. - * @param workManagerObjectName the JMX object name to use + * @param mbeanName the JMX object name to use * @see org.jboss.resource.work.JBossWorkManagerMBean */ public static WorkManager getWorkManager(String mbeanName) {
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -157,7 +157,7 @@ /** * Indicate how transactional advice should be applied. The default is - * {@link AdviceMode.PROXY}. + * {@link AdviceMode#PROXY}. * @see AdviceMode */ AdviceMode mode() default AdviceMode.PROXY;
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -156,7 +156,6 @@ public void setTransactionAttributes(Properties transactionAttributes) { * @see TransactionAttributeSourceEditor * @see MethodMapTransactionAttributeSource * @see NameMatchTransactionAttributeSource - * @see AttributesTransactionAttributeSource * @see org.springframework.transaction.annotation.AnnotationTransactionAttributeSource */ public void setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource) {
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-tx/src/main/java/org/springframework/transaction/support/DelegatingTransactionDefinition.java
@@ -37,7 +37,7 @@ public abstract class DelegatingTransactionDefinition implements TransactionDefi /** * Create a DelegatingTransactionAttribute for the given target attribute. - * @param targetAttribute the target TransactionAttribute to delegate to + * @param targetDefinition the target TransactionAttribute to delegate to */ public DelegatingTransactionDefinition(TransactionDefinition targetDefinition) { Assert.notNull(targetDefinition, "Target definition must not be null");
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/http/client/ClientHttpRequestInterceptor.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -22,7 +22,7 @@ /** * Intercepts client-side HTTP requests. Implementations of this interface can be {@linkplain - * org.springframework.web.client.RestTemplate#setInterceptors(ClientHttpRequestInterceptor[]) registered} with the + * org.springframework.web.client.RestTemplate#setInterceptors(java.util.List) registered} with the * {@link org.springframework.web.client.RestTemplate RestTemplate}, as to modify the outgoing {@link ClientHttpRequest} * and/or the incoming {@link ClientHttpResponse}. *
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotWritableException.java
@@ -18,7 +18,8 @@ /** * Thrown by {@link org.springframework.http.converter.HttpMessageConverter} implementations when the - * {@link org.springframework.http.converter.HttpMessageConverter#write(Object, org.springframework.http.HttpOutputMessage) write} method fails. + * {@link org.springframework.http.converter.HttpMessageConverter#write(Object, org.springframework.http.MediaType, + * org.springframework.http.HttpOutputMessage) write} method fails. * * @author Arjen Poutsma * @since 3.0
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java
@@ -35,7 +35,8 @@ * @see RequestParam * @see RequestHeader * @see org.springframework.web.bind.annotation.RequestMapping - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter + * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter + * @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter * @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter */ @Target(ElementType.PARAMETER)
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/bind/annotation/PathVariable.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -29,7 +29,8 @@ * * @author Arjen Poutsma * @see RequestMapping - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter + * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter + * @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter * @since 3.0 */ @Target(ElementType.PARAMETER)
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/bind/annotation/RequestBody.java
@@ -25,17 +25,18 @@ import org.springframework.http.converter.HttpMessageConverter; /** - * Annotation indicating a method parameter should be bound to the body of the web request. - * The body of the request is passed through an {@link HttpMessageConverter} to resolve the - * method argument depending on the content type of the request. Optionally, automatic + * Annotation indicating a method parameter should be bound to the body of the web request. + * The body of the request is passed through an {@link HttpMessageConverter} to resolve the + * method argument depending on the content type of the request. Optionally, automatic * validation can be applied by annotating the argument with {@code @Valid}. - * + * * <p>Supported for annotated handler methods in Servlet environments. * * @author Arjen Poutsma * @see RequestHeader * @see ResponseBody - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter + * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter + * @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter * @since 3.0 */ @Target(ElementType.PARAMETER)
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java
@@ -31,7 +31,7 @@ * @see RequestMapping * @see RequestParam * @see CookieValue - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter + * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter * @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter */ @Target(ElementType.PARAMETER)
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java
@@ -57,7 +57,7 @@ * As a consequence, such an argument will never be <code>null</code>. * <i>Note that session access may not be thread-safe, in particular in a * Servlet environment: Consider switching the - * {@link org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter#setSynchronizeOnSession "synchronizeOnSession"} + * {@link org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#setSynchronizeOnSession "synchronizeOnSession"} * flag to "true" if multiple requests are allowed to access a session concurrently.</i> * <li>{@link org.springframework.web.context.request.WebRequest} or * {@link org.springframework.web.context.request.NativeWebRequest}. @@ -242,8 +242,7 @@ * @see SessionAttributes * @see InitBinder * @see org.springframework.web.context.request.WebRequest - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodMapping - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter + * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter * @see org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping * @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter */
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java
@@ -26,14 +26,15 @@ * Annotation which indicates that a method parameter should be bound to a web * request parameter. Supported for annotated handler methods in Servlet and * Portlet environments. - * + * * @author Arjen Poutsma * @author Juergen Hoeller * @since 2.5 * @see RequestMapping * @see RequestHeader * @see CookieValue - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter + * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter + * @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter * @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter */ @Target(ElementType.PARAMETER)
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/bind/support/ConfigurableWebBindingInitializer.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -62,7 +62,7 @@ public class ConfigurableWebBindingInitializer implements WebBindingInitializer * when accessing an out-of-bounds index. * <p>Default is "true" on a standard DataBinder. Note that this feature is only supported * for bean property access (DataBinder's default mode), not for field access. - * @see #initBeanPropertyAccess() + * @see org.springframework.validation.DataBinder#initBeanPropertyAccess() * @see org.springframework.validation.DataBinder#setAutoGrowNestedPaths */ public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) {
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/context/ContextLoader.java
@@ -202,7 +202,7 @@ public class ContextLoader { * ContextLoaderListener} subclass as a {@code <listener>} within {@code web.xml}, as * a no-arg constructor is required. * <p>The created application context will be registered into the ServletContext under - * the attribute name {@link WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} + * the attribute name {@link WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} * and subclasses are free to call the {@link #closeWebApplicationContext} method on * container shutdown to close the application context. * @see #ContextLoader(WebApplicationContext) @@ -238,7 +238,7 @@ public ContextLoader() { * <p>See {@link org.springframework.web.WebApplicationInitializer} for usage examples. * <p>In any case, the given application context will be registered into the * ServletContext under the attribute name {@link - * WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and subclasses are + * WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and subclasses are * free to call the {@link #closeWebApplicationContext} method on container shutdown * to close the application context. * @param context the application context to manage @@ -325,7 +325,6 @@ else if (ccl != null) { * <p>In addition, {@link #customizeContext} gets called prior to refreshing the * context, allowing subclasses to perform custom modifications to the context. * @param sc current servlet context - * @param parent the parent ApplicationContext to use, or <code>null</code> if none * @return the root WebApplicationContext * @see ConfigurableWebApplicationContext */ @@ -343,7 +342,7 @@ protected WebApplicationContext createWebApplicationContext(ServletContext sc) { /** * @deprecated as of Spring 3.1 in favor of * {@link #createWebApplicationContext(ServletContext)} and - * {@link #configureAndRefreshWebApplicationContext(WebApplicationContext, ServletContext)} + * {@link #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext, ServletContext)} */ @Deprecated protected WebApplicationContext createWebApplicationContext(ServletContext sc, ApplicationContext parent) {
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -52,7 +52,7 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte * as a {@code <listener>} within {@code web.xml}, where a no-arg constructor is * required. * <p>The created application context will be registered into the ServletContext under - * the attribute name {@link WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} + * the attribute name {@link WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} * and the Spring application context will be closed when the {@link #contextDestroyed} * lifecycle method is invoked on this listener. * @see ContextLoader @@ -66,21 +66,22 @@ public ContextLoaderListener() { /** * Create a new {@code ContextLoaderListener} with the given application context. This * constructor is useful in Servlet 3.0+ environments where instance-based - * registration of listeners is possible through the {@link ServletContext#addListener} + * registration of listeners is possible through the {@link javax.servlet.ServletContext#addListener} * API. * <p>The context may or may not yet be {@linkplain - * ConfigurableApplicationContext#refresh() refreshed}. If it (a) is an implementation - * of {@link ConfigurableWebApplicationContext} and (b) has <strong>not</strong> - * already been refreshed (the recommended approach), then the following will occur: + * org.springframework.context.ConfigurableApplicationContext#refresh() refreshed}. If it + * (a) is an implementation of {@link ConfigurableWebApplicationContext} and + * (b) has <strong>not</strong> already been refreshed (the recommended approach), + * then the following will occur: * <ul> * <li>If the given context has not already been assigned an {@linkplain - * ConfigurableApplicationContext#setId id}, one will be assigned to it</li> + * org.springframework.context.ConfigurableApplicationContext#setId id}, one will be assigned to it</li> * <li>{@code ServletContext} and {@code ServletConfig} objects will be delegated to * the application context</li> * <li>{@link #customizeContext} will be called</li> - * <li>Any {@link ApplicationContextInitializer}s specified through the - * "contextInitializerClasses" init-param will be applied.</li> - * <li>{@link ConfigurableApplicationContext#refresh refresh()} will be called</li> + * <li>Any {@link org.springframework.context.ApplicationContextInitializer ApplicationContextInitializer}s + * specified through the "contextInitializerClasses" init-param will be applied.</li> + * <li>{@link org.springframework.context.ConfigurableApplicationContext#refresh refresh()} will be called</li> * </ul> * If the context has already been refreshed or does not implement * {@code ConfigurableWebApplicationContext}, none of the above will occur under the @@ -89,7 +90,7 @@ public ContextLoaderListener() { * <p>See {@link org.springframework.web.WebApplicationInitializer} for usage examples. * <p>In any case, the given application context will be registered into the * ServletContext under the attribute name {@link - * WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and the Spring + * WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and the Spring * application context will be closed when the {@link #contextDestroyed} lifecycle * method is invoked on this listener. * @param context the application context to manage
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -137,7 +137,7 @@ public void setConfigLocations(String[] locations) { * <p>Calls to {@link #register} are idempotent; adding the same * annotated class more than once has no additional effect. * @param annotatedClasses one or more annotated classes, - * e.g. {@link Configuration @Configuration} classes + * e.g. {@link org.springframework.context.annotation.Configuration @Configuration} classes * @see #scan(String...) * @see #loadBeanDefinitions(DefaultListableBeanFactory) * @see #setConfigLocation(String) @@ -179,8 +179,8 @@ public void scan(String... basePackages) { * annotation. * @see #register(Class...) * @see #scan(String...) - * @see #setConfigLocation() - * @see #setConfigLocations() + * @see #setConfigLocation(String) + * @see #setConfigLocations(String[]) * @see AnnotatedBeanDefinitionReader * @see ClassPathBeanDefinitionScanner */ @@ -267,7 +267,7 @@ protected BeanNameGenerator getBeanNameGenerator() { /** * Set the {@link ScopeMetadataResolver} to use for detected bean classes. - * <p>The default is an {@link AnnotationScopeMetadataResolver}. + * <p>The default is an {@link org.springframework.context.annotation.AnnotationScopeMetadataResolver}. */ public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver) { this.scopeMetadataResolver = scopeMetadataResolver;
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/DispatcherPortlet.java
@@ -963,7 +963,6 @@ protected ActionRequest checkMultipart(ActionRequest request) throws MultipartEx * Return the HandlerExecutionChain for this request. * Try all handler mappings in order. * @param request current portlet request - * @param cache whether to cache the HandlerExecutionChain in a request attribute * @return the HandlerExceutionChain, or null if no handler could be found */ protected HandlerExecutionChain getHandler(PortletRequest request) throws Exception {
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/AbstractRefreshablePortletApplicationContext.java
@@ -91,7 +91,7 @@ public AbstractRefreshablePortletApplicationContext() { * {@inheritDoc} * <p>The parent {@linkplain #getEnvironment() environment} is * delegated to this (child) context if the parent is a - * {@link ConfigurableApplicationContext} implementation. + * {@link org.springframework.context.ConfigurableApplicationContext} implementation. * <p>The parent {@linkplain #getServletContext() servlet context} is * delegated to this (child) context if the parent is a {@link WebApplicationContext} * implementation.
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextScope.java
@@ -54,7 +54,7 @@ public class PortletContextScope implements Scope, DisposableBean { /** * Create a new Scope wrapper for the given PortletContext. - * @param PortletContext the PortletContext to wrap + * @param portletContext the PortletContext to wrap */ public PortletContextScope(PortletContext portletContext) { Assert.notNull(portletContext, "PortletContext must not be null");
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/StaticPortletApplicationContext.java
@@ -88,7 +88,7 @@ protected void initPropertySources() { * {@inheritDoc} * <p>The parent {@linkplain #getEnvironment() environment} is * delegated to this (child) context if the parent is a - * {@link ConfigurableApplicationContext} implementation. + * {@link org.springframework.context.ConfigurableApplicationContext} implementation. * <p>The parent {@linkplain #getServletContext() servlet context} is * delegated to this (child) context if the parent is a {@link WebApplicationContext} * implementation.
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletRequestMethodNotSupportedException.java
@@ -55,7 +55,6 @@ public PortletRequestMethodNotSupportedException(String method, String[] support /** * Create a new PortletRequestMethodNotSupportedException. - * @param method the unsupported HTTP request method * @param supportedMethods the actually supported HTTP methods */ public PortletRequestMethodNotSupportedException(String[] supportedMethods) {
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java
@@ -330,7 +330,7 @@ public String getNamespace() { * Specify the set of fully-qualified {@link ApplicationContextInitializer} class * names, per the optional "contextInitializerClasses" servlet init-param. * @see #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext) - * @see #applyInitializers(ConfigurableWebApplicationContext) + * @see #applyInitializers(ConfigurableApplicationContext) */ public void setContextInitializerClasses(String contextInitializerClasses) { this.contextInitializerClasses = contextInitializerClasses; @@ -340,7 +340,7 @@ public void setContextInitializerClasses(String contextInitializerClasses) { * Specify which {@link ApplicationContextInitializer} instances should be used * to initialize the application context used by this {@code FrameworkServlet}. * @see #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext) - * @see #applyInitializers(ConfigurableWebApplicationContext) + * @see #applyInitializers(ConfigurableApplicationContext) */ public void setContextInitializers(ApplicationContextInitializer<ConfigurableApplicationContext>... contextInitializers) { for (ApplicationContextInitializer<ConfigurableApplicationContext> initializer : contextInitializers) { @@ -691,12 +691,12 @@ protected void applyInitializers(ConfigurableApplicationContext wac) { * <p>The default implementation is empty. <code>refresh()</code> will * be called automatically after this method returns. * <p>Note that this method is designed to allow subclasses to modify the application - * context, while {@link #initializeWebApplicationContext} is designed to allow + * context, while {@link #initWebApplicationContext} is designed to allow * end-users to modify the context through the use of * {@link ApplicationContextInitializer}s. * @param wac the configured WebApplicationContext (not refreshed yet) * @see #createWebApplicationContext - * @see #initializeWebApplicationContext + * @see #initWebApplicationContext * @see ConfigurableWebApplicationContext#refresh() */ protected void postProcessWebApplicationContext(ConfigurableWebApplicationContext wac) {
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/DispatcherServletWebRequest.java
@@ -47,7 +47,7 @@ public DispatcherServletWebRequest(HttpServletRequest request) { /** * Create a new DispatcherServletWebRequest instance for the given request and response. * @param request current HTTP request - * @param request current HTTP response + * @param response current HTTP response */ public DispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response) { super(request, response);
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -443,7 +443,7 @@ protected ModelAndView invokeHandlerMethod(HttpServletRequest request, HttpServl /** * This method always returns -1 since an annotated controller can have many methods, * each requiring separate lastModified calculations. Instead, an - * @{@link RequestMapping}-annotated method can calculate the lastModified value, call + * {@link RequestMapping}-annotated method can calculate the lastModified value, call * {@link org.springframework.web.context.request.WebRequest#checkNotModified(long)} * to check it, and return {@code null} if that returns {@code true}. * @see org.springframework.web.context.request.WebRequest#checkNotModified(long) @@ -483,7 +483,7 @@ private ServletHandlerMethodResolver getMethodResolver(Object handler) { * @return the ServletRequestDataBinder instance to use * @throws Exception in case of invalid state or arguments * @see ServletRequestDataBinder#bind(javax.servlet.ServletRequest) - * @see ServletRequestDataBinder#convertIfNecessary(Object, Class, org.springframework.core.MethodParameter) + * @see ServletRequestDataBinder#convertIfNecessary(Object, Class, org.springframework.core.MethodParameter) */ protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object target, String objectName) throws Exception { return new ServletRequestDataBinder(target, objectName);
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/RequestCondition.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -22,48 +22,48 @@ /** * The contract for request conditions. - * - * <p>Request conditions can be combined via {@link #combine(Object)}, matched to - * a request via {@link #getMatchingCondition(HttpServletRequest)}, and compared - * to each other via {@link #compareTo(Object, HttpServletRequest)} to determine + * + * <p>Request conditions can be combined via {@link #combine(Object)}, matched to + * a request via {@link #getMatchingCondition(HttpServletRequest)}, and compared + * to each other via {@link #compareTo(Object, HttpServletRequest)} to determine * which matches a request more closely. - * - * @param <T> The type of objects that this RequestCondition can be combined + * + * @param <T> The type of objects that this RequestCondition can be combined * with compared to. - * + * * @author Rossen Stoyanchev * @author Arjen Poutsma * @since 3.1 */ public interface RequestCondition<T> { /** - * Defines the rules for combining this condition (i.e. the current instance) - * with another condition. For example combining type- and method-level - * {@link RequestMapping} conditions. - * + * Defines the rules for combining this condition (i.e. the current instance) + * with another condition. For example combining type- and method-level + * {@link RequestMapping} conditions. + * * @param other the condition to combine with. - * @returns a request condition instance that is the result of combining + * @return a request condition instance that is the result of combining * the two condition instances. */ T combine(T other); /** - * Checks if this condition matches the given request and returns a - * potentially new request condition with content tailored to the - * current request. For example a condition with URL patterns might - * return a new condition that contains matching patterns sorted + * Checks if this condition matches the given request and returns a + * potentially new request condition with content tailored to the + * current request. For example a condition with URL patterns might + * return a new condition that contains matching patterns sorted * with best matching patterns on top. - * - * @return a condition instance in case of a match; + * + * @return a condition instance in case of a match; * or {@code null} if there is no match. */ T getMatchingCondition(HttpServletRequest request); /** - * Compares this condition to another condition in the context of - * a specific request. This method assumes both instances have - * been obtained via {@link #getMatchingCondition(HttpServletRequest)} + * Compares this condition to another condition in the context of + * a specific request. This method assumes both instances have + * been obtained via {@link #getMatchingCondition(HttpServletRequest)} * to ensure they have content relevant to current request only. */ int compareTo(T other, HttpServletRequest request);
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMapping.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -54,10 +54,10 @@ protected Set<String> getMappingPathPatterns(RequestMappingInfo info) { } /** - * Check if the given RequestMappingInfo matches the current request and - * return a (potentially new) instance with conditions that match the + * Check if the given RequestMappingInfo matches the current request and + * return a (potentially new) instance with conditions that match the * current request -- for example with a subset of URL patterns. - * @returns an info in case of a match; or {@code null} otherwise. + * @return an info in case of a match; or {@code null} otherwise. */ @Override protected RequestMappingInfo getMatchingMapping(RequestMappingInfo info, HttpServletRequest request) { @@ -101,17 +101,17 @@ protected void handleMatch(RequestMappingInfo info, String lookupPath, HttpServl /** * Iterate all RequestMappingInfos once again, look if any match by URL at * least and raise exceptions accordingly. - * - * @throws HttpRequestMethodNotSupportedException + * + * @throws HttpRequestMethodNotSupportedException * if there are matches by URL but not by HTTP method - * @throws HttpMediaTypeNotAcceptableException + * @throws HttpMediaTypeNotAcceptableException * if there are matches by URL but not by consumable media types - * @throws HttpMediaTypeNotAcceptableException + * @throws HttpMediaTypeNotAcceptableException * if there are matches by URL but not by producible media types */ @Override - protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> requestMappingInfos, - String lookupPath, + protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> requestMappingInfos, + String lookupPath, HttpServletRequest request) throws ServletException { Set<String> allowedMethods = new HashSet<String>(6); Set<MediaType> consumableMediaTypes = new HashSet<MediaType>();
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -32,8 +32,8 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; /** - * Creates {@link RequestMappingInfo} instances from type and method-level - * {@link RequestMapping @RequestMapping} annotations in + * Creates {@link RequestMappingInfo} instances from type and method-level + * {@link RequestMapping @RequestMapping} annotations in * {@link Controller @Controller} classes. * * @author Arjen Poutsma @@ -49,7 +49,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi /** * Whether to use suffix pattern match (".*") when matching patterns to * requests. If enabled a method mapped to "/users" also matches to "/users.*". - * <p>The default value is {@code true}. + * <p>The default value is {@code true}. */ public void setUseSuffixPatternMatch(boolean useSuffixPatternMatch) { this.useSuffixPatternMatch = useSuffixPatternMatch; @@ -78,7 +78,7 @@ public boolean useTrailingSlashMatch() { } /** - * {@inheritDoc} + * {@inheritDoc} * Expects a handler to have a type-level @{@link Controller} annotation. */ @Override @@ -89,10 +89,10 @@ protected boolean isHandler(Class<?> beanType) { /** * Uses method and type-level @{@link RequestMapping} annotations to create * the RequestMappingInfo. - * + * * @return the created RequestMappingInfo, or {@code null} if the method * does not have a {@code @RequestMapping} annotation. - * + * * @see #getCustomMethodCondition(Method) * @see #getCustomTypeCondition(Class) */ @@ -114,9 +114,9 @@ protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handler /** * Provide a custom method-level request condition. - * The custom {@link RequestCondition} can be of any type so long as the + * The custom {@link RequestCondition} can be of any type so long as the * same condition type is returned from all calls to this method in order - * to ensure custom request conditions can be combined and compared. + * to ensure custom request conditions can be combined and compared. * @param method the handler method for which to create the condition * @return the condition, or {@code null} */ @@ -126,10 +126,10 @@ protected RequestCondition<?> getCustomMethodCondition(Method method) { /** * Provide a custom type-level request condition. - * The custom {@link RequestCondition} can be of any type so long as the + * The custom {@link RequestCondition} can be of any type so long as the * same condition type is returned from all calls to this method in order - * to ensure custom request conditions can be combined and compared. - * @param method the handler method for which to create the condition + * to ensure custom request conditions can be combined and compared. + * @param handlerType the handler type for which to create the condition * @return the condition, or {@code null} */ protected RequestCondition<?> getCustomTypeCondition(Class<?> handlerType) { @@ -141,13 +141,13 @@ protected RequestCondition<?> getCustomTypeCondition(Class<?> handlerType) { */ private RequestMappingInfo createRequestMappingInfo(RequestMapping annotation, RequestCondition<?> customCondition) { return new RequestMappingInfo( - new PatternsRequestCondition(annotation.value(), + new PatternsRequestCondition(annotation.value(), getUrlPathHelper(), getPathMatcher(), this.useSuffixPatternMatch, this.useTrailingSlashMatch), new RequestMethodsRequestCondition(annotation.method()), new ParamsRequestCondition(annotation.params()), new HeadersRequestCondition(annotation.headers()), new ConsumesRequestCondition(annotation.consumes(), annotation.headers()), - new ProducesRequestCondition(annotation.produces(), annotation.headers()), + new ProducesRequestCondition(annotation.produces(), annotation.headers()), customCondition); }
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletModelAttributeMethodProcessor.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -37,8 +37,8 @@ /** * A Servlet-specific {@link org.springframework.web.method.annotation.ModelAttributeMethodProcessor} that applies data - * binding through a WebDataBinder of type {@link ServletRequestDataBinder}. - * + * binding through a WebDataBinder of type {@link ServletRequestDataBinder}. + * * <p>Also adds a fall-back strategy to instantiate the model attribute from a * URI template variable or from a request parameter if the name matches the * model attribute name and there is an appropriate type conversion strategy. @@ -50,7 +50,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr /** * @param annotationNotRequired if "true", non-simple method arguments and - * return values are considered model attributes with or without a + * return values are considered model attributes with or without a * {@code @ModelAttribute} annotation. */ public ServletModelAttributeMethodProcessor(boolean annotationNotRequired) { @@ -62,12 +62,12 @@ public ServletModelAttributeMethodProcessor(boolean annotationNotRequired) { * request parameter if the name matches to the model attribute name and * if there is an appropriate type conversion strategy. If none of these * are true delegate back to the base class. - * @see #createAttributeFromUriValue + * @see #createAttributeFromRequestValue(String, String, MethodParameter, WebDataBinderFactory, NativeWebRequest) */ @Override - protected final Object createAttribute(String attributeName, - MethodParameter parameter, - WebDataBinderFactory binderFactory, + protected final Object createAttribute(String attributeName, + MethodParameter parameter, + WebDataBinderFactory binderFactory, NativeWebRequest request) throws Exception { String value = getRequestValueForAttribute(attributeName, request); @@ -83,7 +83,7 @@ protected final Object createAttribute(String attributeName, /** * Obtain a value from the request that may be used to instantiate the - * model attribute through type conversion from String to the target type. + * model attribute through type conversion from String to the target type. * <p>The default implementation looks for the attribute name to match * a URI variable first and then a request parameter. * @param attributeName the model attribute name @@ -105,7 +105,7 @@ else if (StringUtils.hasText(request.getParameter(attributeName))) { @SuppressWarnings("unchecked") protected final Map<String, String> getUriTemplateVariables(NativeWebRequest request) { - Map<String, String> variables = + Map<String, String> variables = (Map<String, String>) request.getAttribute( HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST); return (variables != null) ? variables : Collections.<String, String>emptyMap(); @@ -114,7 +114,7 @@ protected final Map<String, String> getUriTemplateVariables(NativeWebRequest req /** * Create a model attribute from a String request value (e.g. URI template * variable, request parameter) using type conversion. - * <p>The default implementation converts only if there a registered + * <p>The default implementation converts only if there a registered * {@link Converter} that can perform the conversion. * @param sourceValue the source value to create the model attribute from * @param attributeName the name of the attribute, never {@code null} @@ -125,9 +125,9 @@ protected final Map<String, String> getUriTemplateVariables(NativeWebRequest req * @throws Exception */ protected Object createAttributeFromRequestValue(String sourceValue, - String attributeName, - MethodParameter parameter, - WebDataBinderFactory binderFactory, + String attributeName, + MethodParameter parameter, + WebDataBinderFactory binderFactory, NativeWebRequest request) throws Exception { DataBinder binder = binderFactory.createBinder(request, null, attributeName); ConversionService conversionService = binder.getConversionService();
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java
@@ -30,7 +30,8 @@ /** * An {@link HttpRequestHandler} for serving static files using the Servlet container's "default" Servlet. * - * <p>This handler is intended to be used with a "/*" mapping when the {@link DispatcherServlet} + * <p>This handler is intended to be used with a "/*" mapping when the + * {@link org.springframework.web.servlet.DispatcherServlet DispatcherServlet} * is mapped to "/", thus overriding the Servlet container's default handling of static resources. * The mapping to this handler should generally be ordered as the last in the chain so that it will * only execute when no other more specific mappings (i.e., to controllers) can be matched.
true
Other
spring-projects
spring-framework
effb762558f152ed60f5bd6aedb4c7b5ea65db4a.json
Fix javadoc warnings Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java
@@ -50,16 +50,16 @@ /** * Context holder for request-specific state, like current web application context, current locale, current theme, and * potential binding errors. Provides easy access to localized messages and Errors instances. - * + * * <p>Suitable for exposition to views, and usage within JSP's "useBean" tag, JSP scriptlets, JSTL EL, Velocity * templates, etc. Necessary for views that do not have access to the servlet request, like Velocity templates. - * + * * <p>Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's * "requestContextAttribute" property. - * + * * <p>Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext and using an * appropriate fallback for the locale (the HttpServletRequest's primary locale). - * + * * @author Juergen Hoeller * @since 03.03.2003 * @see org.springframework.web.servlet.DispatcherServlet @@ -83,8 +83,8 @@ public class RequestContext { public static final String WEB_APPLICATION_CONTEXT_ATTRIBUTE = RequestContext.class.getName() + ".CONTEXT"; /** - * The name of the bean to use to look up in an implementation of - * {@link RequestDataValueProcessor} has been configured. + * The name of the bean to use to look up in an implementation of + * {@link RequestDataValueProcessor} has been configured. */ private static final String REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME = "requestDataValueProcessor"; @@ -148,7 +148,7 @@ public RequestContext(HttpServletRequest request, ServletContext servletContext) * @param model the model attributes for the current view (can be <code>null</code>, using the request attributes * for Errors retrieval) * @see org.springframework.web.servlet.DispatcherServlet - * @see #RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext, Map) + * @see #RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext, Map) */ public RequestContext(HttpServletRequest request, Map<String, Object> model) { initContext(request, null, null, model); @@ -226,7 +226,7 @@ protected void initContext(HttpServletRequest request, HttpServletResponse respo try { this.requestDataValueProcessor = this.webApplicationContext.getBean( REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME, RequestDataValueProcessor.class); - } + } catch (NoSuchBeanDefinitionException ex) { // Ignored } @@ -366,7 +366,7 @@ public UrlPathHelper getUrlPathHelper() { } /** - * Return the RequestDataValueProcessor instance to use obtained from the + * Return the RequestDataValueProcessor instance to use obtained from the * WebApplicationContext under the name {@code "requestDataValueProcessor"}. * Or {@code null} if no matching bean was found. */ @@ -402,9 +402,9 @@ public String getContextUrl(String relativeUrl) { * Return a context-aware URl for the given relative URL with placeholders (named keys with braces <code>{}</code>). * For example, send in a relative URL <code>foo/{bar}?spam={spam}</code> and a parameter map * <code>{bar=baz,spam=nuts}</code> and the result will be <code>[contextpath]/foo/baz?spam=nuts</code>. - * + * * @param relativeUrl the relative URL part - * @param a map of parameters to insert as placeholders in the url + * @param params a map of parameters to insert as placeholders in the url * @return a URL that points back to the server with an absolute path (also URL-encoded accordingly) */ public String getContextUrl(String relativeUrl, Map<String, ?> params) { @@ -418,9 +418,9 @@ public String getContextUrl(String relativeUrl, Map<String, ?> params) { } /** - * Return the path to URL mappings within the current servlet including the + * Return the path to URL mappings within the current servlet including the * context path and the servlet path of the original request. This is useful - * for building links to other resources within the application where a + * for building links to other resources within the application where a * servlet mapping of the style {@code "/main/*"} is used. * <p>Delegates to the UrlPathHelper for decoding the context path. * @see javax.servlet.http.HttpServletRequest#getContextPath
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/main/java/org/springframework/web/context/request/async/AsyncExecutionChain.java
@@ -143,7 +143,7 @@ private void startAsync() { } private Callable<Object> buildChain() { - Assert.state(this.callable != null, "The callable field is required to complete the chain"); + Assert.state(this.callable != null, "The last callable is required to build the async chain"); this.delegatingCallables.add(new StaleAsyncRequestCheckingCallable(asyncWebRequest)); Callable<Object> result = this.callable; for (int i = this.delegatingCallables.size() - 1; i >= 0; i--) { @@ -165,25 +165,39 @@ private Callable<Object> buildChain() { * the threading model, i.e. whether a TaskExecutor is used. * @see DeferredResult */ - public void startDeferredResultProcessing(DeferredResult deferredResult) { - Assert.notNull(deferredResult, "A DeferredResult is required"); + public void startDeferredResultProcessing(final DeferredResult deferredResult) { + Assert.notNull(deferredResult, "DeferredResult is required"); startAsync(); - deferredResult.setValueProcessor(new DeferredResultHandler() { - public void handle(Object value) { + deferredResult.init(new DeferredResultHandler() { + public void handle(Object result) { if (asyncWebRequest.isAsyncCompleted()) { throw new StaleAsyncWebRequestException("Async request processing already completed"); } - setCallable(getSimpleCallable(value)); + setCallable(new PassThroughCallable(result)); new AsyncExecutionChainRunnable(asyncWebRequest, buildChain()).run(); } }); + if (deferredResult.canHandleTimeout()) { + this.asyncWebRequest.setTimeoutHandler(new Runnable() { + public void run() { + deferredResult.handleTimeout(); + } + }); + } } - private Callable<Object> getSimpleCallable(final Object value) { - return new Callable<Object>() { - public Object call() throws Exception { - return value; - } - }; + + private static class PassThroughCallable implements Callable<Object> { + + private final Object value; + + public PassThroughCallable(Object value) { + this.value = value; + } + + public Object call() throws Exception { + return this.value; + } } + }
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/main/java/org/springframework/web/context/request/async/AsyncExecutionChainRunnable.java
@@ -49,7 +49,6 @@ public class AsyncExecutionChainRunnable implements Runnable { public AsyncExecutionChainRunnable(AsyncWebRequest asyncWebRequest, Callable<?> callable) { Assert.notNull(asyncWebRequest, "An AsyncWebRequest is required"); Assert.notNull(callable, "A Callable is required"); - Assert.state(asyncWebRequest.isAsyncStarted(), "Not an async request"); this.asyncWebRequest = asyncWebRequest; this.callable = callable; }
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/main/java/org/springframework/web/context/request/async/AsyncWebRequest.java
@@ -35,6 +35,12 @@ public interface AsyncWebRequest extends NativeWebRequest { */ void setTimeout(Long timeout); + /** + * Invoked on a timeout to complete the response instead of the default + * behavior that sets the status to 503 (SERVICE_UNAVAILABLE). + */ + void setTimeoutHandler(Runnable runnable); + /** * Mark the start of async request processing for example ensuring the * request remains open in order to be completed in a separate thread.
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java
@@ -16,72 +16,135 @@ package org.springframework.web.context.request.async; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; import org.springframework.core.task.AsyncTaskExecutor; import org.springframework.util.Assert; /** - * DeferredResult provides an alternative to using a Callable to complete async - * request processing. Whereas with a Callable the framework manages a thread on - * behalf of the application through an {@link AsyncTaskExecutor}, with a - * DeferredResult the application can produce a value using a thread of its choice. + * DeferredResult provides an alternative to using a Callable for async request + * processing. With a Callable the framework manages a thread on behalf of the + * application through an {@link AsyncTaskExecutor}. With a DeferredResult the + * application sets the result in a thread of its choice. * - * <p>The following sequence describes typical use of a DeferredResult: + * <p>The following sequence describes the intended use scenario: * <ol> - * <li>Application method (e.g. controller method) returns a DeferredResult instance - * <li>The framework completes initialization of the returned DeferredResult in the same thread - * <li>The application calls {@link DeferredResult#set(Object)} from another thread - * <li>The framework completes request processing in the thread in which it is invoked + * <li>thread-1: framework calls application method + * <li>thread-1: application method returns a DeferredResult + * <li>thread-1: framework initializes DeferredResult + * <li>thread-2: application calls {@link #set(Object)} + * <li>thread-2: framework completes async processing with given result * </ol> * - * <p><strong>Note:</strong> {@link DeferredResult#set(Object)} will block if - * called before the DeferredResult is fully initialized (by the framework). - * Application code should never create a DeferredResult and set it immediately: - * - * <pre> - * DeferredResult value = new DeferredResult(); - * value.set(1); // blocks - * </pre> + * <p>If the application calls {@link #set(Object)} in thread-2 before the + * DeferredResult is initialized by the framework in thread-1, then thread-2 + * will block and wait for the initialization to complete. Therefore an + * application should never create and set the DeferredResult in the same + * thread because the initialization will never complete.</p> * * @author Rossen Stoyanchev * @since 3.2 */ public final class DeferredResult { - private final AtomicReference<Object> value = new AtomicReference<Object>(); + private final static Object TIMEOUT_RESULT_NONE = new Object(); + + private Object result; + + private final Object timeoutResult; + + private DeferredResultHandler resultHandler; + + private final CountDownLatch readySignal = new CountDownLatch(1); + + private final ReentrantLock timeoutLock = new ReentrantLock(); + + /** + * Create a new instance. + */ + public DeferredResult() { + this(TIMEOUT_RESULT_NONE); + } + + /** + * Create a new instance and also provide a default result to use if a + * timeout occurs before {@link #set(Object)} is called. + */ + public DeferredResult(Object timeoutResult) { + this.timeoutResult = timeoutResult; + } - private final BlockingQueue<DeferredResultHandler> handlers = new ArrayBlockingQueue<DeferredResultHandler>(1); + boolean canHandleTimeout() { + return this.timeoutResult != TIMEOUT_RESULT_NONE; + } /** - * Provide a value to use to complete async request processing. - * This method should be invoked only once and usually from a separate - * thread to allow the framework to fully initialize the created - * DeferrredValue. See the class level documentation for more details. + * Complete async processing with the given result. If the DeferredResult is + * not yet fully initialized, this method will block and wait for that to + * occur before proceeding. See the class level javadoc for more details. * * @throws StaleAsyncWebRequestException if the underlying async request - * ended due to a timeout or an error before the value was set. + * has already timed out or ended due to a network error. */ - public void set(Object value) throws StaleAsyncWebRequestException { - Assert.isNull(this.value.get(), "Value already set"); - this.value.set(value); + public void set(Object result) throws StaleAsyncWebRequestException { + if (this.timeoutLock.tryLock() && (this.result != this.timeoutResult)) { + try { + handle(result); + } + finally { + this.timeoutLock.unlock(); + } + } + else { + // A timeout is in progress + throw new StaleAsyncWebRequestException("Async request already timed out"); + } + } + + /** + * Invoked to complete async processing when a timeout occurs before + * {@link #set(Object)} is called. Or if {@link #set(Object)} is already in + * progress, this method blocks, waits for it to complete, and then returns. + */ + void handleTimeout() { + Assert.state(canHandleTimeout(), "Can't handle timeout"); + this.timeoutLock.lock(); + try { + if (this.result == null) { + handle(this.timeoutResult); + } + } + finally { + this.timeoutLock.unlock(); + } + } + + private void handle(Object result) throws StaleAsyncWebRequestException { + Assert.isNull(this.result, "A deferred result can be set once only"); + this.result = result; try { - this.handlers.take().handle(value); + this.readySignal.await(10, TimeUnit.SECONDS); } catch (InterruptedException e) { - throw new IllegalStateException("Failed to process deferred return value: " + value, e); + throw new IllegalStateException( + "Gave up on waiting for DeferredResult to be initialized. " + + "Are you perhaps creating and setting a DeferredResult in the same thread? " + + "The DeferredResult must be fully initialized before you can set it. " + + "See the class javadoc for more details"); } + this.resultHandler.handle(result); } - void setValueProcessor(DeferredResultHandler handler) { - this.handlers.add(handler); + void init(DeferredResultHandler handler) { + this.resultHandler = handler; + this.readySignal.countDown(); } /** - * Puts the set value through processing wiht the async execution chain. + * Completes processing when {@link DeferredResult#set(Object)} is called. */ interface DeferredResultHandler {
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/main/java/org/springframework/web/context/request/async/NoOpAsyncWebRequest.java
@@ -39,6 +39,9 @@ public NoOpAsyncWebRequest(HttpServletRequest request, HttpServletResponse respo public void setTimeout(Long timeout) { } + public void setTimeoutHandler(Runnable runnable) { + } + public boolean isAsyncStarted() { return false; }
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/main/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequest.java
@@ -48,6 +48,8 @@ public class StandardServletAsyncWebRequest extends ServletWebRequest implements private AtomicBoolean asyncCompleted = new AtomicBoolean(false); + private Runnable timeoutHandler; + public StandardServletAsyncWebRequest(HttpServletRequest request, HttpServletResponse response) { super(request, response); } @@ -64,6 +66,10 @@ public boolean isAsyncCompleted() { return this.asyncCompleted.get(); } + public void setTimeoutHandler(Runnable timeoutHandler) { + this.timeoutHandler = timeoutHandler; + } + public void startAsync() { Assert.state(getRequest().isAsyncSupported(), "Async support must be enabled on a servlet and for all filters involved " + @@ -111,8 +117,13 @@ private void assertNotStale() { // --------------------------------------------------------------------- public void onTimeout(AsyncEvent event) throws IOException { + if (this.timeoutHandler == null) { + getResponse().sendError(HttpStatus.SERVICE_UNAVAILABLE.value()); + } + else { + this.timeoutHandler.run(); + } completeInternal(); - getResponse().sendError(HttpStatus.SERVICE_UNAVAILABLE.value()); } public void onError(AsyncEvent event) throws IOException {
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/test/java/org/springframework/web/context/request/async/AsyncExecutionChainTests.java
@@ -123,7 +123,7 @@ public void startCallableChainProcessing_requiredCallable() { fail("Expected exception"); } catch (IllegalStateException ex) { - assertThat(ex.getMessage(), containsString("The callable field is required")); + assertThat(ex.getMessage(), containsString("last callable is required")); } } @@ -171,7 +171,7 @@ public void startDeferredResultProcessing_requiredDeferredResult() { fail("Expected exception"); } catch (IllegalArgumentException ex) { - assertThat(ex.getMessage(), containsString("A DeferredResult is required")); + assertThat(ex.getMessage(), containsString("DeferredResult is required")); } } @@ -186,6 +186,10 @@ public SimpleAsyncWebRequest(HttpServletRequest request, HttpServletResponse res super(request, response); } + public void setTimeout(Long timeout) { } + + public void setTimeoutHandler(Runnable runnable) { } + public void startAsync() { this.asyncStarted = true; } @@ -194,8 +198,6 @@ public boolean isAsyncStarted() { return this.asyncStarted; } - public void setTimeout(Long timeout) { } - public void complete() { this.asyncStarted = false; this.asyncCompleted = true;
true
Other
spring-projects
spring-framework
7ee821d3d153c7d528cc29b2ebf295c3877a5dff.json
Add ability to handle a timeout to DeferredResult When a controller returns a DeferredResult, the underlying async request will eventually time out. Until now the default behavior was to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable in all cases. For example if waiting on an event, a timeout simply means there is no new information to send. To handle those cases a DeferredResult now accespts a timeout result Object in its constructor. If the timeout occurs before the DeferredResult is set, the timeout result provided to the constructor is used instead. Issue: SPR-8617
spring-web/src/test/java/org/springframework/web/context/request/async/DeferredResultTests.java
@@ -0,0 +1,119 @@ +/* + * Copyright 2002-2012 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.web.context.request.async; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.reset; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import org.junit.Test; +import org.springframework.web.context.request.async.DeferredResult.DeferredResultHandler; + +/** + * DeferredResult tests. + * + * @author Rossen Stoyanchev + */ +public class DeferredResultTests { + + @Test + public void canHandleTimeout() { + assertFalse(new DeferredResult().canHandleTimeout()); + assertTrue(new DeferredResult("foo").canHandleTimeout()); + } + + @Test + public void set() { + DeferredResultHandler resultHandler = createMock(DeferredResultHandler.class); + DeferredResult deferredResult = new DeferredResult(); + deferredResult.init(resultHandler); + + resultHandler.handle("foo"); + replay(resultHandler); + + deferredResult.set("foo"); + + verify(resultHandler); + } + + @Test + public void handleTimeout() { + DeferredResultHandler resultHandler = createMock(DeferredResultHandler.class); + DeferredResult deferredResult = new DeferredResult("foo"); + deferredResult.init(resultHandler); + + resultHandler.handle("foo"); + replay(resultHandler); + + deferredResult.handleTimeout(); + + verify(resultHandler); + } + + @Test(expected=IllegalStateException.class) + public void handleTimeout_timeoutResultNone() { + new DeferredResult().handleTimeout(); + } + + @Test + public void setAfterHandleTimeout() { + DeferredResultHandler resultHandler = createMock(DeferredResultHandler.class); + DeferredResult deferredResult = new DeferredResult("foo"); + deferredResult.init(resultHandler); + + resultHandler.handle("foo"); + replay(resultHandler); + + deferredResult.handleTimeout(); + + verify(resultHandler); + + try { + deferredResult.set("foo"); + fail("Expected exception"); + } + catch (StaleAsyncWebRequestException ex) { + // expected + } + } + + @Test + public void setBeforeHandleTimeout() { + DeferredResultHandler resultHandler = createMock(DeferredResultHandler.class); + DeferredResult deferredResult = new DeferredResult("foo"); + deferredResult.init(resultHandler); + + resultHandler.handle("foo"); + replay(resultHandler); + + deferredResult.set("foo"); + + verify(resultHandler); + + reset(resultHandler); + replay(resultHandler); + + deferredResult.handleTimeout(); + + verify(resultHandler); + } + +}
true
Other
spring-projects
spring-framework
b51caae0df871c5c1bbf4b2e11174658a3f0cad9.json
Fix broken test Issue: SPR-8517
spring-web/src/test/java/org/springframework/web/context/request/async/AsyncExecutionChainTests.java
@@ -140,38 +140,38 @@ public void startCallableChainProcessing_requiredAsyncWebRequest() { } @Test - public void startDeferredValueProcessing() throws Exception { + public void startDeferredResultProcessing() throws Exception { this.chain.addDelegatingCallable(new IntegerIncrementingCallable()); this.chain.addDelegatingCallable(new IntegerIncrementingCallable()); - DeferredResult deferredValue = new DeferredResult(); - this.chain.startDeferredResultProcessing(deferredValue); + DeferredResult deferredResult = new DeferredResult(); + this.chain.startDeferredResultProcessing(deferredResult); assertTrue(this.asyncWebRequest.isAsyncStarted()); - deferredValue.set(1); + deferredResult.set(1); assertEquals(3, this.resultSavingCallable.result); } @Test(expected=StaleAsyncWebRequestException.class) - public void startDeferredValueProcessing_staleRequest() throws Exception { + public void startDeferredResultProcessing_staleRequest() throws Exception { this.asyncWebRequest.startAsync(); this.asyncWebRequest.complete(); - DeferredResult deferredValue = new DeferredResult(); - this.chain.startDeferredResultProcessing(deferredValue); - deferredValue.set(1); + DeferredResult deferredResult = new DeferredResult(); + this.chain.startDeferredResultProcessing(deferredResult); + deferredResult.set(1); } @Test - public void startDeferredValueProcessing_requiredDeferredValue() { + public void startDeferredResultProcessing_requiredDeferredResult() { try { this.chain.startDeferredResultProcessing(null); fail("Expected exception"); } catch (IllegalArgumentException ex) { - assertThat(ex.getMessage(), containsString("A DeferredValue is required")); + assertThat(ex.getMessage(), containsString("A DeferredResult is required")); } }
false
Other
spring-projects
spring-framework
6d5a630c4491f9b2790095cef4d37f6cdd2d7456.json
Fix transitive dependency issue with slf4j-api Before this change, IDE settings generated via import-into-eclipse.sh created a classpath dependency on slf4j-api version 1.6.1 and slf4j-log4j12 version 1.5.10. As a result running tests inside the IDE resulted in a NoSuchMethodException. build.gradle sets the variable slf4jLog4jVersion to '1.5.10'. However, the hibernate-validator dependency in spring-context pulls in slf4j-api version 1.6.1. The change ensures the version specified in the build script variable is used consistently. Whether it should be 1.5.10 or 1.6.1 is a separate concern.
build.gradle
@@ -213,9 +213,13 @@ project('spring-context') { compile("org.beanshell:bsh:2.0b4", optional) compile("org.codehaus.groovy:groovy-all:1.6.3", optional) compile("org.jruby:jruby:1.4.0", optional) - compile("org.hibernate:hibernate-validator:4.2.0.Final", optional) + compile("org.hibernate:hibernate-validator:4.2.0.Final") { dep -> + optional dep + exclude group: 'org.slf4j', module: 'slf4j-api' + } compile("joda-time:joda-time:1.6", optional) compile("net.sf.ehcache:ehcache-core:2.0.0", optional) + compile("org.slf4j:slf4j-api:${slf4jLog4jVersion}", optional) compile("org.codehaus.jsr166-mirror:jsr166:1.7.0", provided) testCompile "commons-dbcp:commons-dbcp:1.2.2" testCompile("javax.xml:jaxrpc-api:1.1")
false
Other
spring-projects
spring-framework
57b89e03889a9ec8a797ae16dcebb6ccd014bb82.json
Fix typo in ApplicationContext reference doc
src/reference/docbook/beans.xml
@@ -86,7 +86,7 @@ The footnote should x-ref to first section in that chapter but I can't find the ><classname>FileSystemXmlApplicationContext</classname></ulink>. <!-- MLP: Beverly to review --> While XML has been the traditional format for defining configuration metadata you can instruct the container to use - Java annotations or code as the metadata format by providng a small amount + Java annotations or code as the metadata format by providing a small amount of XML configuration to declaratively enable support for these additional metadata formats.</para>
false
Other
spring-projects
spring-framework
0ab9e9a0c64a252fb8d8590bc302e82b8c8926c6.json
Upgrade AspectJ from 1.6.8 to 1.6.12 - Spring remains compatible against AJ version 1.6.8, but is now compiling and testing against 1.6.12 - Encountered what appears to be an AJ bug introduced in 1.6.10: an assertion in org.aspectj.weaver.UnresolvedType causes a false negative failure when encountering org.springframework.io.Resource arrays, e.g. "[org.springframework.io.Resource@xxx". This problem has been reported to the AJ team and in the meantime, the recommended workaround is to disable assertions either completely, or at least selectively with -disableassertions:org.aspectj.weaver.UnresolvedType Issue: SPR-7989, SPR-9272
build.gradle
@@ -18,6 +18,7 @@ configure(allprojects) { targetCompatibility=1.5 ext.slf4jLog4jVersion = '1.5.10' + ext.aspectjVersion = '1.6.12' [compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:none'] @@ -133,7 +134,7 @@ project('spring-core') { builtBy project(":spring-asm").jar } compile "commons-logging:commons-logging:1.1.1" - compile("org.aspectj:aspectjweaver:1.6.8", optional) + compile("org.aspectj:aspectjweaver:${aspectjVersion}", optional) compile("net.sf.jopt-simple:jopt-simple:3.0") { dep -> optional dep exclude group: 'org.apache.ant', module: 'ant' @@ -220,6 +221,10 @@ project('spring-context') { testCompile("javax.xml:jaxrpc-api:1.1") testCompile("javax.inject:com.springsource.org.atinject.tck:1.0.0") } + + test { + jvmArgs = ['-disableassertions:org.aspectj.weaver.UnresolvedType'] // SPR-7989 + } } project('spring-tx') { @@ -439,8 +444,8 @@ project('spring-aspects') { dependencies { compile project(":spring-orm") aspects project(":spring-orm") - ajc "org.aspectj:aspectjtools:1.6.8" - compile "org.aspectj:aspectjrt:1.6.8" + ajc "org.aspectj:aspectjtools:${aspectjVersion}" + compile "org.aspectj:aspectjrt:${aspectjVersion}" testCompile project(":spring-test") } eclipse.project {
true
Other
spring-projects
spring-framework
0ab9e9a0c64a252fb8d8590bc302e82b8c8926c6.json
Upgrade AspectJ from 1.6.8 to 1.6.12 - Spring remains compatible against AJ version 1.6.8, but is now compiling and testing against 1.6.12 - Encountered what appears to be an AJ bug introduced in 1.6.10: an assertion in org.aspectj.weaver.UnresolvedType causes a false negative failure when encountering org.springframework.io.Resource arrays, e.g. "[org.springframework.io.Resource@xxx". This problem has been reported to the AJ team and in the meantime, the recommended workaround is to disable assertions either completely, or at least selectively with -disableassertions:org.aspectj.weaver.UnresolvedType Issue: SPR-7989, SPR-9272
src/dist/changelog.txt
@@ -5,6 +5,7 @@ http://www.springsource.org Changes in version 3.2 M1 ------------------------------------- +* upgraded to AspectJ 1.6.12 * better handling on failure to parse invalid 'Content-Type' or 'Accept' headers * handle a controller method's return value based on the actual returned value (vs declared type) * fix issue with combining identical controller and method level request mapping paths
true
Other
spring-projects
spring-framework
f6003b5102b81a83fa5995104dda8983b65f24ae.json
Fix typo in reference documentation Issue: SPR-9321
src/reference/docbook/beans.xml
@@ -356,7 +356,7 @@ The footnote should x-ref to first section in that chapter but I can't find the <para>The <interfacename>ApplicationContext</interfacename> is the interface for an advanced factory capable of maintaining a registry of different beans and their dependencies. Using the method <methodname>T - getBean(Stringname, Class&lt;T&gt; requiredType)</methodname> you can + getBean(String name, Class&lt;T&gt; requiredType)</methodname> you can retrieve instances of your beans.</para> <para>The <interfacename>ApplicationContext</interfacename> enables you to
false
Other
spring-projects
spring-framework
cfe2af76906039e42b12dc24cf4fca7b91c9b910.json
Use the type of the actual return value in @MVC The new @MVC support classes select a HandlerMethodArgumentResolver and a HandlerMethodReturnValueHandler statically, i.e. based on the signature of the method, which means that a controller method can't declare a more general return type like Object but actually return a more specific one, e.g. String vs RedirectView, and expect the right handler to be used. The fix ensures that a HandlerMethodReturnValueHandler is selected based on the actual return value type, which is something that was supported with the old @MVC support classes. One consequence of the change is the selected HandlerMethodReturnValueHandler can no longer be cached but that matches the behavior of the old @MVC support classes. Issues: SPR-9218
spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -29,13 +29,13 @@ import org.springframework.util.ClassUtils; /** - * Encapsulates information about a bean method consisting of a {@linkplain #getMethod() method} and a - * {@linkplain #getBean() bean}. Provides convenient access to method parameters, the method return value, + * Encapsulates information about a bean method consisting of a {@linkplain #getMethod() method} and a + * {@linkplain #getBean() bean}. Provides convenient access to method parameters, the method return value, * method annotations. * * <p>The class may be created with a bean instance or with a bean name (e.g. lazy bean, prototype bean). * Use {@link #createWithResolvedBean()} to obtain an {@link HandlerMethod} instance with a bean instance - * initialized through the bean factory. + * initialized through the bean factory. * * @author Arjen Poutsma * @author Rossen Stoyanchev @@ -49,7 +49,7 @@ public class HandlerMethod { private final Object bean; private final Method method; - + private final BeanFactory beanFactory; private MethodParameter[] parameters; @@ -87,7 +87,7 @@ public HandlerMethod(Object bean, String methodName, Class<?>... parameterTypes) } /** - * Constructs a new handler method with the given bean name and method. The bean name will be lazily + * Constructs a new handler method with the given bean name and method. The bean name will be lazily * initialized when {@link #createWithResolvedBean()} is called. * @param beanName the bean name * @param beanFactory the bean factory to use for bean initialization @@ -120,7 +120,7 @@ public Method getMethod() { } /** - * Returns the type of the handler for this handler method. + * Returns the type of the handler for this handler method. * Note that if the bean type is a CGLIB-generated class, the original, user-defined class is returned. */ public Class<?> getBeanType() { @@ -132,7 +132,7 @@ public Class<?> getBeanType() { return ClassUtils.getUserClass(bean.getClass()); } } - + /** * If the bean method is a bridge method, this method returns the bridged (user-defined) method. * Otherwise it returns the same method as {@link #getMethod()}. @@ -149,18 +149,25 @@ public MethodParameter[] getMethodParameters() { int parameterCount = this.bridgedMethod.getParameterTypes().length; MethodParameter[] p = new MethodParameter[parameterCount]; for (int i = 0; i < parameterCount; i++) { - p[i] = new HandlerMethodParameter(this.bridgedMethod, i); + p[i] = new HandlerMethodParameter(i); } this.parameters = p; } return parameters; } /** - * Returns the method return type, as {@code MethodParameter}. + * Return the HandlerMethod return type. */ public MethodParameter getReturnType() { - return new HandlerMethodParameter(this.bridgedMethod, -1); + return new HandlerMethodParameter(-1); + } + + /** + * Return the actual return value type. + */ + public MethodParameter getReturnValueType(Object returnValue) { + return new ReturnValueMethodParameter(returnValue); } /** @@ -171,8 +178,8 @@ public boolean isVoid() { } /** - * Returns a single annotation on the underlying method traversing its super methods if no - * annotation can be found on the given method itself. + * Returns a single annotation on the underlying method traversing its super methods if no + * annotation can be found on the given method itself. * @param annotationType the type of annotation to introspect the method for. * @return the annotation, or {@code null} if none found */ @@ -181,7 +188,7 @@ public <A extends Annotation> A getMethodAnnotation(Class<A> annotationType) { } /** - * If the provided instance contains a bean name rather than an object instance, the bean name is resolved + * If the provided instance contains a bean name rather than an object instance, the bean name is resolved * before a {@link HandlerMethod} is created and returned. */ public HandlerMethod createWithResolvedBean() { @@ -192,7 +199,7 @@ public HandlerMethod createWithResolvedBean() { } return new HandlerMethod(handler, method); } - + @Override public boolean equals(Object o) { if (this == o) { @@ -216,33 +223,41 @@ public String toString() { } /** - * A {@link MethodParameter} that resolves method annotations even when the actual annotations - * are on a bridge method rather than on the current method. Annotations on super types are - * also returned via {@link AnnotationUtils#findAnnotation(Method, Class)}. + * A MethodParameter with HandlerMethod-specific behavior. */ private class HandlerMethodParameter extends MethodParameter { - - public HandlerMethodParameter(Method method, int parameterIndex) { - super(method, parameterIndex); + + protected HandlerMethodParameter(int index) { + super(HandlerMethod.this.bridgedMethod, index); } - /** - * Return {@link HandlerMethod#getBeanType()} rather than the method's class, which could be - * important for the proper discovery of generic types. - */ @Override public Class<?> getDeclaringClass() { return HandlerMethod.this.getBeanType(); } - /** - * Return the method annotation via {@link HandlerMethod#getMethodAnnotation(Class)}, which will find - * the annotation by traversing super-types and handling annotations on bridge methods correctly. - */ @Override public <T extends Annotation> T getMethodAnnotation(Class<T> annotationType) { return HandlerMethod.this.getMethodAnnotation(annotationType); } } + /** + * A MethodParameter for a HandlerMethod return type based on an actual return value. + */ + private class ReturnValueMethodParameter extends HandlerMethodParameter { + + private final Object returnValue; + + public ReturnValueMethodParameter(Object returnValue) { + super(-1); + this.returnValue = returnValue; + } + + @Override + public Class<?> getParameterType() { + return (this.returnValue != null) ? this.returnValue.getClass() : super.getParameterType(); + } + } + }
true
Other
spring-projects
spring-framework
cfe2af76906039e42b12dc24cf4fca7b91c9b910.json
Use the type of the actual return value in @MVC The new @MVC support classes select a HandlerMethodArgumentResolver and a HandlerMethodReturnValueHandler statically, i.e. based on the signature of the method, which means that a controller method can't declare a more general return type like Object but actually return a more specific one, e.g. String vs RedirectView, and expect the right handler to be used. The fix ensures that a HandlerMethodReturnValueHandler is selected based on the actual return value type, which is something that was supported with the old @MVC support classes. One consequence of the change is the selected HandlerMethodReturnValueHandler can no longer be cached but that matches the behavior of the old @MVC support classes. Issues: SPR-9218
spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerComposite.java
@@ -19,8 +19,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -42,9 +40,6 @@ public class HandlerMethodReturnValueHandlerComposite implements HandlerMethodRe private final List<HandlerMethodReturnValueHandler> returnValueHandlers = new ArrayList<HandlerMethodReturnValueHandler>(); - private final Map<MethodParameter, HandlerMethodReturnValueHandler> returnValueHandlerCache = - new ConcurrentHashMap<MethodParameter, HandlerMethodReturnValueHandler>(); - /** * Return a read-only list with the registered handlers, or an empty list. */ @@ -78,21 +73,16 @@ public void handleReturnValue( * Find a registered {@link HandlerMethodReturnValueHandler} that supports the given return type. */ private HandlerMethodReturnValueHandler getReturnValueHandler(MethodParameter returnType) { - HandlerMethodReturnValueHandler result = this.returnValueHandlerCache.get(returnType); - if (result == null) { - for (HandlerMethodReturnValueHandler returnValueHandler : returnValueHandlers) { - if (logger.isTraceEnabled()) { - logger.trace("Testing if return value handler [" + returnValueHandler + "] supports [" + - returnType.getGenericParameterType() + "]"); - } - if (returnValueHandler.supportsReturnType(returnType)) { - result = returnValueHandler; - this.returnValueHandlerCache.put(returnType, returnValueHandler); - break; - } + for (HandlerMethodReturnValueHandler returnValueHandler : returnValueHandlers) { + if (logger.isTraceEnabled()) { + logger.trace("Testing if return value handler [" + returnValueHandler + "] supports [" + + returnType.getGenericParameterType() + "]"); + } + if (returnValueHandler.supportsReturnType(returnType)) { + return returnValueHandler; } } - return result; + return null; } /**
true
Other
spring-projects
spring-framework
cfe2af76906039e42b12dc24cf4fca7b91c9b910.json
Use the type of the actual return value in @MVC The new @MVC support classes select a HandlerMethodArgumentResolver and a HandlerMethodReturnValueHandler statically, i.e. based on the signature of the method, which means that a controller method can't declare a more general return type like Object but actually return a more specific one, e.g. String vs RedirectView, and expect the right handler to be used. The fix ensures that a HandlerMethodReturnValueHandler is selected based on the actual return value type, which is something that was supported with the old @MVC support classes. One consequence of the change is the selected HandlerMethodReturnValueHandler can no longer be cached but that matches the behavior of the old @MVC support classes. Issues: SPR-9218
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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.
true
Other
spring-projects
spring-framework
cfe2af76906039e42b12dc24cf4fca7b91c9b910.json
Use the type of the actual return value in @MVC The new @MVC support classes select a HandlerMethodArgumentResolver and a HandlerMethodReturnValueHandler statically, i.e. based on the signature of the method, which means that a controller method can't declare a more general return type like Object but actually return a more specific one, e.g. String vs RedirectView, and expect the right handler to be used. The fix ensures that a HandlerMethodReturnValueHandler is selected based on the actual return value type, which is something that was supported with the old @MVC support classes. One consequence of the change is the selected HandlerMethodReturnValueHandler can no longer be cached but that matches the behavior of the old @MVC support classes. Issues: SPR-9218
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethod.java
@@ -107,7 +107,7 @@ public final void invokeAndHandle( mavContainer.setRequestHandled(false); try { - returnValueHandlers.handleReturnValue(returnValue, getReturnType(), mavContainer, request); + returnValueHandlers.handleReturnValue(returnValue, getReturnValueType(returnValue), mavContainer, request); } catch (Exception ex) { if (logger.isTraceEnabled()) { logger.trace(getReturnValueHandlingErrorMessage("Error handling return value", returnValue), ex);
true
Other
spring-projects
spring-framework
cfe2af76906039e42b12dc24cf4fca7b91c9b910.json
Use the type of the actual return value in @MVC The new @MVC support classes select a HandlerMethodArgumentResolver and a HandlerMethodReturnValueHandler statically, i.e. based on the signature of the method, which means that a controller method can't declare a more general return type like Object but actually return a more specific one, e.g. String vs RedirectView, and expect the right handler to be used. The fix ensures that a HandlerMethodReturnValueHandler is selected based on the actual return value type, which is something that was supported with the old @MVC support classes. One consequence of the change is the selected HandlerMethodReturnValueHandler can no longer be cached but that matches the behavior of the old @MVC support classes. Issues: SPR-9218
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethodTests.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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,10 @@ */ package org.springframework.web.servlet.mvc.method.annotation; -import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.lang.reflect.Method; @@ -30,17 +31,20 @@ import org.springframework.http.converter.HttpMessageNotWritableException; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.ServletWebRequest; +import org.springframework.web.method.annotation.RequestParamMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite; import org.springframework.web.method.support.HandlerMethodReturnValueHandler; import org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite; import org.springframework.web.method.support.ModelAndViewContainer; +import org.springframework.web.servlet.view.RedirectView; /** * Test fixture with {@link ServletInvocableHandlerMethod}. - * + * * @author Rossen Stoyanchev */ public class ServletInvocableHandlerMethodTests { @@ -53,15 +57,18 @@ public class ServletInvocableHandlerMethodTests { private ServletWebRequest webRequest; + private MockHttpServletRequest request; + private MockHttpServletResponse response; @Before public void setUp() throws Exception { returnValueHandlers = new HandlerMethodReturnValueHandlerComposite(); argumentResolvers = new HandlerMethodArgumentResolverComposite(); mavContainer = new ModelAndViewContainer(); + request = new MockHttpServletRequest(); response = new MockHttpServletResponse(); - webRequest = new ServletWebRequest(new MockHttpServletRequest(), response); + webRequest = new ServletWebRequest(request, response); } @Test @@ -92,29 +99,45 @@ public void nullReturnValueRequestNotModified() throws Exception { webRequest.getNativeRequest(MockHttpServletRequest.class).addHeader("If-Modified-Since", 10 * 1000 * 1000); int lastModifiedTimestamp = 1000 * 1000; webRequest.checkNotModified(lastModifiedTimestamp); - + ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("notModified"); handlerMethod.invokeAndHandle(webRequest, mavContainer); assertTrue("Null return value + 'not modified' request should result in 'request handled'", mavContainer.isRequestHandled()); } - - @Test + + @Test(expected=HttpMessageNotWritableException.class) public void exceptionWhileHandlingReturnValue() throws Exception { returnValueHandlers.addHandler(new ExceptionRaisingReturnValueHandler()); ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("handle"); - try { - handlerMethod.invokeAndHandle(webRequest, mavContainer); - fail("Expected exception"); - } catch (HttpMessageNotWritableException ex) { - // Expected.. - // Allow HandlerMethodArgumentResolver exceptions to propagate.. - } + handlerMethod.invokeAndHandle(webRequest, mavContainer); + fail("Expected exception"); } - private ServletInvocableHandlerMethod getHandlerMethod(String methodName, Class<?>... argTypes) + @Test + public void dynamicReturnValue() throws Exception { + argumentResolvers.addResolver(new RequestParamMethodArgumentResolver(null, false)); + returnValueHandlers.addHandler(new ViewMethodReturnValueHandler()); + returnValueHandlers.addHandler(new ViewNameMethodReturnValueHandler()); + + // Invoke without a request parameter (String return value) + ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("dynamicReturnValue", String.class); + handlerMethod.invokeAndHandle(webRequest, mavContainer); + + assertNotNull(mavContainer.getView()); + assertEquals(RedirectView.class, mavContainer.getView().getClass()); + + // Invoke with a request parameter (RedirectView return value) + request.setParameter("param", "value"); + handlerMethod.invokeAndHandle(webRequest, mavContainer); + + assertEquals("view", mavContainer.getViewName()); + } + + + private ServletInvocableHandlerMethod getHandlerMethod(String methodName, Class<?>... argTypes) throws NoSuchMethodException { Method method = Handler.class.getDeclaredMethod(methodName, argTypes); ServletInvocableHandlerMethod handlerMethod = new ServletInvocableHandlerMethod(new Handler(), method); @@ -133,13 +156,16 @@ public String handle() { @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "400 Bad Request") public void responseStatus() { } - + public void httpServletResponse(HttpServletResponse response) { } - + public void notModified() { } - + + public Object dynamicReturnValue(@RequestParam(required=false) String param) { + return (param != null) ? "view" : new RedirectView("redirectView"); + } } private static class ExceptionRaisingReturnValueHandler implements HandlerMethodReturnValueHandler {
true
Other
spring-projects
spring-framework
cfe2af76906039e42b12dc24cf4fca7b91c9b910.json
Use the type of the actual return value in @MVC The new @MVC support classes select a HandlerMethodArgumentResolver and a HandlerMethodReturnValueHandler statically, i.e. based on the signature of the method, which means that a controller method can't declare a more general return type like Object but actually return a more specific one, e.g. String vs RedirectView, and expect the right handler to be used. The fix ensures that a HandlerMethodReturnValueHandler is selected based on the actual return value type, which is something that was supported with the old @MVC support classes. One consequence of the change is the selected HandlerMethodReturnValueHandler can no longer be cached but that matches the behavior of the old @MVC support classes. Issues: SPR-9218
src/dist/changelog.txt
@@ -5,8 +5,11 @@ http://www.springsource.org Changes in version 3.2 M1 ------------------------------------- -* fix issue with parsing invalid Content-Type or Accept headers - +* better handling on failure to parse invalid 'Content-Type' or 'Accept' headers +* handle a controller method's return value based on the actual returned value (vs declared type) +* fix issue with combining identical controller and method level request mapping paths +* fix concurrency issue in AnnotationMethodHandlerExceptionResolver +* fix case-sensitivity issue with some containers on access to 'Content-Disposition' header Changes in version 3.1.1 (2012-02-16) -------------------------------------
true
Other
spring-projects
spring-framework
ca8b98e94724cd9a2008deb4fe1280aaace6ca8b.json
Fix issue with parsing media types Invalid Content-Type or Accept header values previously resulted in the IllegalArgumentException getting propagated. After this change such errors are detected and generally treated as a "no match", which may for example result in a 406 in the case of the Accept header. Issue: SPR-9148
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractMediaTypeExpression.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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,19 +18,23 @@ import javax.servlet.http.HttpServletRequest; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestMapping; /** * Supports media type expressions as described in: * {@link RequestMapping#consumes()} and {@link RequestMapping#produces()}. - * + * * @author Arjen Poutsma * @author Rossen Stoyanchev * @since 3.1 */ abstract class AbstractMediaTypeExpression implements Comparable<AbstractMediaTypeExpression>, MediaTypeExpression { + protected final Log logger = LogFactory.getLog(getClass()); + private final MediaType mediaType; private final boolean isNegated; @@ -60,8 +64,16 @@ public boolean isNegated() { } public final boolean match(HttpServletRequest request) { - boolean match = matchMediaType(request); - return !isNegated ? match : !match; + try { + boolean match = matchMediaType(request); + return !isNegated ? match : !match; + } + catch (IllegalArgumentException ex) { + if (logger.isDebugEnabled()) { + logger.debug("Could not parse media type header: " + ex.getMessage()); + } + return false; + } } protected abstract boolean matchMediaType(HttpServletRequest request);
true
Other
spring-projects
spring-framework
ca8b98e94724cd9a2008deb4fe1280aaace6ca8b.json
Fix issue with parsing media types Invalid Content-Type or Accept header values previously resulted in the IllegalArgumentException getting propagated. After this change such errors are detected and generally treated as a "no match", which may for example result in a 406 in the case of the Accept header. Issue: SPR-9148
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -41,7 +41,7 @@ import org.springframework.web.servlet.HandlerMapping; /** - * Extends {@link AbstractMessageConverterMethodArgumentResolver} with the ability to handle method return + * Extends {@link AbstractMessageConverterMethodArgumentResolver} with the ability to handle method return * values by writing to the response with {@link HttpMessageConverter}s. * * @author Arjen Poutsma @@ -103,7 +103,7 @@ protected <T> void writeWithMessageConverters(T returnValue, List<MediaType> acceptableMediaTypes = getAcceptableMediaTypes(inputMessage); List<MediaType> producibleMediaTypes = getProducibleMediaTypes(inputMessage.getServletRequest(), returnValueClass); - + Set<MediaType> compatibleMediaTypes = new LinkedHashSet<MediaType>(); for (MediaType a : acceptableMediaTypes) { for (MediaType p : producibleMediaTypes) { @@ -115,10 +115,10 @@ protected <T> void writeWithMessageConverters(T returnValue, if (compatibleMediaTypes.isEmpty()) { throw new HttpMediaTypeNotAcceptableException(allSupportedMediaTypes); } - + List<MediaType> mediaTypes = new ArrayList<MediaType>(compatibleMediaTypes); MediaType.sortBySpecificity(mediaTypes); - + MediaType selectedMediaType = null; for (MediaType mediaType : mediaTypes) { if (mediaType.isConcrete()) { @@ -130,7 +130,7 @@ else if (mediaType.equals(MediaType.ALL) || mediaType.equals(MEDIA_TYPE_APPLICAT break; } } - + if (selectedMediaType != null) { for (HttpMessageConverter<?> messageConverter : messageConverters) { if (messageConverter.canWrite(returnValueClass, selectedMediaType)) { @@ -166,7 +166,7 @@ else if (!allSupportedMediaTypes.isEmpty()) { if (converter.canWrite(returnValueClass, null)) { result.addAll(converter.getSupportedMediaTypes()); } - } + } return result; } else { @@ -175,8 +175,16 @@ else if (!allSupportedMediaTypes.isEmpty()) { } private List<MediaType> getAcceptableMediaTypes(HttpInputMessage inputMessage) { - List<MediaType> result = inputMessage.getHeaders().getAccept(); - return result.isEmpty() ? Collections.singletonList(MediaType.ALL) : result; + try { + List<MediaType> result = inputMessage.getHeaders().getAccept(); + return result.isEmpty() ? Collections.singletonList(MediaType.ALL) : result; + } + catch (IllegalArgumentException ex) { + if (logger.isDebugEnabled()) { + logger.debug("Could not parse Accept header: " + ex.getMessage()); + } + return Collections.emptyList(); + } } /**
true
Other
spring-projects
spring-framework
ca8b98e94724cd9a2008deb4fe1280aaace6ca8b.json
Fix issue with parsing media types Invalid Content-Type or Accept header values previously resulted in the IllegalArgumentException getting propagated. After this change such errors are detected and generally treated as a "no match", which may for example result in a 406 in the case of the Accept header. Issue: SPR-9148
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/ConsumesRequestConditionTests.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -44,7 +44,7 @@ public void consumesMatch() { assertNotNull(condition.getMatchingCondition(request)); } - + @Test public void negatedConsumesMatch() { ConsumesRequestCondition condition = new ConsumesRequestCondition("!text/plain"); @@ -60,7 +60,7 @@ public void getConsumableMediaTypesNegatedExpression() { ConsumesRequestCondition condition = new ConsumesRequestCondition("!application/xml"); assertEquals(Collections.emptySet(), condition.getConsumableMediaTypes()); } - + @Test public void consumesWildcardMatch() { ConsumesRequestCondition condition = new ConsumesRequestCondition("text/*"); @@ -91,6 +91,26 @@ public void consumesSingleNoMatch() { assertNull(condition.getMatchingCondition(request)); } + @Test + public void consumesParseError() { + ConsumesRequestCondition condition = new ConsumesRequestCondition("text/plain"); + + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setContentType("01"); + + assertNull(condition.getMatchingCondition(request)); + } + + @Test + public void consumesParseErrorWithNegation() { + ConsumesRequestCondition condition = new ConsumesRequestCondition("!text/plain"); + + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setContentType("01"); + + assertNull(condition.getMatchingCondition(request)); + } + @Test public void compareToSingle() { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -128,7 +148,7 @@ public void combine() { ConsumesRequestCondition result = condition1.combine(condition2); assertEquals(condition2, result); } - + @Test public void combineWithDefault() { ConsumesRequestCondition condition1 = new ConsumesRequestCondition("text/plain");
true
Other
spring-projects
spring-framework
ca8b98e94724cd9a2008deb4fe1280aaace6ca8b.json
Fix issue with parsing media types Invalid Content-Type or Accept header values previously resulted in the IllegalArgumentException getting propagated. After this change such errors are detected and generally treated as a "no match", which may for example result in a 406 in the case of the Accept header. Issue: SPR-9148
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/ProducesRequestConditionTests.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -34,7 +34,7 @@ * @author Rossen Stoyanchev */ public class ProducesRequestConditionTests { - + @Test public void producesMatch() { ProducesRequestCondition condition = new ProducesRequestCondition("text/plain"); @@ -44,7 +44,7 @@ public void producesMatch() { assertNotNull(condition.getMatchingCondition(request)); } - + @Test public void negatedProducesMatch() { ProducesRequestCondition condition = new ProducesRequestCondition("!text/plain"); @@ -60,7 +60,7 @@ public void getProducibleMediaTypesNegatedExpression() { ProducesRequestCondition condition = new ProducesRequestCondition("!application/xml"); assertEquals(Collections.emptySet(), condition.getProducibleMediaTypes()); } - + @Test public void producesWildcardMatch() { ProducesRequestCondition condition = new ProducesRequestCondition("text/*"); @@ -91,6 +91,26 @@ public void producesSingleNoMatch() { assertNull(condition.getMatchingCondition(request)); } + @Test + public void producesParseError() { + ProducesRequestCondition condition = new ProducesRequestCondition("text/plain"); + + MockHttpServletRequest request = new MockHttpServletRequest(); + request.addHeader("Accept", "bogus"); + + assertNull(condition.getMatchingCondition(request)); + } + + @Test + public void producesParseErrorWithNegation() { + ProducesRequestCondition condition = new ProducesRequestCondition("!text/plain"); + + MockHttpServletRequest request = new MockHttpServletRequest(); + request.addHeader("Accept", "bogus"); + + assertNull(condition.getMatchingCondition(request)); + } + @Test public void compareTo() { ProducesRequestCondition html = new ProducesRequestCondition("text/html"); @@ -126,12 +146,12 @@ public void compareTo() { assertTrue(html.compareTo(xml, request) > 0); assertTrue(xml.compareTo(html, request) < 0); } - + @Test public void compareToWithSingleExpression() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader("Accept", "text/plain"); - + ProducesRequestCondition condition1 = new ProducesRequestCondition("text/plain"); ProducesRequestCondition condition2 = new ProducesRequestCondition("text/*"); @@ -188,7 +208,7 @@ public void compareToMultipleExpressionsAndMultipeAcceptHeaderValues() { @Test public void compareToMediaTypeAll() { MockHttpServletRequest request = new MockHttpServletRequest(); - + ProducesRequestCondition condition1 = new ProducesRequestCondition(); ProducesRequestCondition condition2 = new ProducesRequestCondition("application/json"); @@ -202,7 +222,7 @@ public void compareToMediaTypeAll() { assertTrue(condition1.compareTo(condition2, request) < 0); assertTrue(condition2.compareTo(condition1, request) > 0); - + request.addHeader("Accept", "*/*"); condition1 = new ProducesRequestCondition(); @@ -255,7 +275,7 @@ public void combine() { ProducesRequestCondition result = condition1.combine(condition2); assertEquals(condition2, result); } - + @Test public void combineWithDefault() { ProducesRequestCondition condition1 = new ProducesRequestCondition("text/plain");
true
Other
spring-projects
spring-framework
ca8b98e94724cd9a2008deb4fe1280aaace6ca8b.json
Fix issue with parsing media types Invalid Content-Type or Accept header values previously resulted in the IllegalArgumentException getting propagated. After this change such errors are detected and generally treated as a "no match", which may for example result in a 406 in the case of the Accept header. Issue: SPR-9148
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -56,7 +56,7 @@ /** * Test fixture with {@link HttpEntityMethodProcessor} and mock {@link HttpMessageConverter}. - * + * * @author Arjen Poutsma * @author Rossen Stoyanchev */ @@ -106,7 +106,7 @@ public void setUp() throws Exception { returnTypeResponseEntityProduces = new MethodParameter(getClass().getMethod("handle4"), -1); mavContainer = new ModelAndViewContainer(); - + servletRequest = new MockHttpServletRequest(); servletResponse = new MockHttpServletResponse(); webRequest = new ServletWebRequest(servletRequest, servletResponse); @@ -219,7 +219,7 @@ public void handleReturnValueNotAcceptable() throws Exception { fail("Expected exception"); } - + @Test(expected = HttpMediaTypeNotAcceptableException.class) public void handleReturnValueNotAcceptableProduces() throws Exception { String body = "Foo"; @@ -238,6 +238,17 @@ public void handleReturnValueNotAcceptableProduces() throws Exception { fail("Expected exception"); } + // SPR-9142 + + @Test(expected=HttpMediaTypeNotAcceptableException.class) + public void handleReturnValueNotAcceptableParseError() throws Exception { + ResponseEntity<String> returnValue = new ResponseEntity<String>("Body", HttpStatus.ACCEPTED); + servletRequest.addHeader("Accept", "01"); + + processor.handleReturnValue(returnValue, returnTypeResponseEntity, mavContainer, webRequest); + fail("Expected exception"); + } + @Test public void responseHeaderNoBody() throws Exception { HttpHeaders headers = new HttpHeaders(); @@ -269,7 +280,7 @@ public void responseHeaderAndBody() throws Exception { assertEquals("headerValue", outputMessage.getValue().getHeaders().get("header").get(0)); verify(messageConverter); } - + public ResponseEntity<String> handle1(HttpEntity<String> httpEntity, ResponseEntity<String> responseEntity, int i) { return responseEntity; }
true
Other
spring-projects
spring-framework
ca8b98e94724cd9a2008deb4fe1280aaace6ca8b.json
Fix issue with parsing media types Invalid Content-Type or Accept header values previously resulted in the IllegalArgumentException getting propagated. After this change such errors are detected and generally treated as a "no match", which may for example result in a 406 in the case of the Accept header. Issue: SPR-9148
src/dist/changelog.txt
@@ -2,6 +2,11 @@ SPRING FRAMEWORK CHANGELOG ========================== http://www.springsource.org +Changes in version 3.2 M1 +------------------------------------- + +* fix issue with parsing invalid Content-Type or Accept headers + Changes in version 3.1.1 (2012-02-16) -------------------------------------
true
Other
spring-projects
spring-framework
0b0293393876934e24a5215bdb7bc2e1bf75c233.json
Fix race condition in AnntationMethodHER Issues: SPR-9138
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java
@@ -75,8 +75,7 @@ public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExceptionResolver { // dummy method placeholder - private static final Method NO_METHOD_FOUND = ClassUtils - .getMethodIfAvailable(System.class, "currentTimeMillis", null); + private static final Method NO_METHOD_FOUND = ClassUtils.getMethodIfAvailable(System.class, "currentTimeMillis", (Class<?>[]) null); private WebArgumentResolver[] customArgumentResolvers; @@ -134,10 +133,9 @@ protected ModelAndView doResolveException( private Method findBestExceptionHandlerMethod(Object handler, final Exception thrownException) { final Class<?> handlerType = handler.getClass(); final Class<? extends Throwable> thrownExceptionType = thrownException.getClass(); - Method handlerMethod = null; - Map<Class<? extends Throwable>, Method> handlers = exceptionHandlerCache - .get(handlerType); + + Map<Class<? extends Throwable>, Method> handlers = exceptionHandlerCache.get(handlerType); if (handlers != null) { handlerMethod = handlers.get(thrownExceptionType); @@ -173,7 +171,9 @@ public void doWith(Method method) { } }); - return getBestMatchingMethod(resolverMethods, thrownException); + handlerMethod = getBestMatchingMethod(resolverMethods, thrownException); + handlers.put(thrownExceptionType, (handlerMethod == null ? NO_METHOD_FOUND : handlerMethod)); + return handlerMethod; } /** @@ -204,19 +204,19 @@ protected List<Class<? extends Throwable>> getHandledExceptions(Method method) { } /** - * Returns the best matching method. Uses the {@link DepthComparator}. + * Uses the {@link DepthComparator} to find the best matching method + * @return the best matching method or {@code null}. */ private Method getBestMatchingMethod( Map<Class<? extends Throwable>, Method> resolverMethods, Exception thrownException) { - if (!resolverMethods.isEmpty()) { - Class<? extends Throwable> closestMatch = - ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); - return resolverMethods.get(closestMatch); - } - else { + if (resolverMethods.isEmpty()) { return null; } + Class<? extends Throwable> closestMatch = + ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); + Method method = resolverMethods.get(closestMatch); + return ((method == null) || (NO_METHOD_FOUND == method)) ? null : method; } /** @@ -225,13 +225,13 @@ private Method getBestMatchingMethod( private Object[] resolveHandlerArguments(Method handlerMethod, Object handler, NativeWebRequest webRequest, Exception thrownException) throws Exception { - Class[] paramTypes = handlerMethod.getParameterTypes(); + Class<?>[] paramTypes = handlerMethod.getParameterTypes(); Object[] args = new Object[paramTypes.length]; Class<?> handlerType = handler.getClass(); for (int i = 0; i < args.length; i++) { MethodParameter methodParam = new MethodParameter(handlerMethod, i); GenericTypeResolver.resolveParameterType(methodParam, handlerType); - Class paramType = methodParam.getParameterType(); + Class<?> paramType = methodParam.getParameterType(); Object argValue = resolveCommonArgument(methodParam, webRequest, thrownException); if (argValue != WebArgumentResolver.UNRESOLVED) { args[i] = argValue; @@ -267,7 +267,7 @@ protected Object resolveCommonArgument(MethodParameter methodParameter, NativeWe } // Resolution of standard parameter types... - Class paramType = methodParameter.getParameterType(); + Class<?> paramType = methodParameter.getParameterType(); Object value = resolveStandardArgument(paramType, webRequest, thrownException); if (value != WebArgumentResolver.UNRESOLVED && !ClassUtils.isAssignableValue(paramType, value)) { throw new IllegalStateException("Standard argument type [" + paramType.getName() + @@ -287,7 +287,7 @@ protected Object resolveCommonArgument(MethodParameter methodParameter, NativeWe * @param thrownException the exception thrown * @return the argument value, or {@link org.springframework.web.bind.support.WebArgumentResolver#UNRESOLVED} */ - protected Object resolveStandardArgument(Class parameterType, NativeWebRequest webRequest, + protected Object resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest, Exception thrownException) throws Exception { if (parameterType.isInstance(thrownException)) {
true
Other
spring-projects
spring-framework
0b0293393876934e24a5215bdb7bc2e1bf75c233.json
Fix race condition in AnntationMethodHER Issues: SPR-9138
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java
@@ -84,10 +84,10 @@ public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExceptionResolver { // dummy method placeholder - private static final Method NO_METHOD_FOUND = ClassUtils.getMethodIfAvailable(System.class, "currentTimeMillis", null); - - private final Map<Class<?>, Map<Class<? extends Throwable>, Method>> exceptionHandlerCache = - new ConcurrentHashMap<Class<?>, Map<Class<? extends Throwable>, Method>>(); + private static final Method NO_METHOD_FOUND = ClassUtils.getMethodIfAvailable(System.class, "currentTimeMillis", (Class<?>[]) null); + + private final Map<Class<?>, Map<Class<? extends Throwable>, Method>> exceptionHandlerCache = + new ConcurrentHashMap<Class<?>, Map<Class<? extends Throwable>, Method>>(); private WebArgumentResolver[] customArgumentResolvers; @@ -157,7 +157,7 @@ private Method findBestExceptionHandlerMethod(Object handler, final Exception th final Class<?> handlerType = ClassUtils.getUserClass(handler); final Class<? extends Throwable> thrownExceptionType = thrownException.getClass(); Method handlerMethod = null; - + Map<Class<? extends Throwable>, Method> handlers = exceptionHandlerCache.get(handlerType); if (handlers != null) { @@ -170,7 +170,7 @@ private Method findBestExceptionHandlerMethod(Object handler, final Exception th handlers = new ConcurrentHashMap<Class<? extends Throwable>, Method>(); exceptionHandlerCache.put(handlerType, handlers); } - + final Map<Class<? extends Throwable>, Method> resolverMethods = handlers; ReflectionUtils.doWithMethods(handlerType, new ReflectionUtils.MethodCallback() { @@ -228,19 +228,19 @@ protected List<Class<? extends Throwable>> getHandledExceptions(Method method) { } /** - * Returns the best matching method. Uses the {@link DepthComparator}. + * Uses the {@link DepthComparator} to find the best matching method + * @return the best matching method or {@code null}. */ private Method getBestMatchingMethod( Map<Class<? extends Throwable>, Method> resolverMethods, Exception thrownException) { - if (!resolverMethods.isEmpty()) { - Class<? extends Throwable> closestMatch = - ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); - return resolverMethods.get(closestMatch); - } - else { + if (resolverMethods.isEmpty()) { return null; } + Class<? extends Throwable> closestMatch = + ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); + Method method = resolverMethods.get(closestMatch); + return ((method == null) || (NO_METHOD_FOUND == method)) ? null : method; } /** @@ -249,13 +249,13 @@ private Method getBestMatchingMethod( private Object[] resolveHandlerArguments(Method handlerMethod, Object handler, NativeWebRequest webRequest, Exception thrownException) throws Exception { - Class[] paramTypes = handlerMethod.getParameterTypes(); + Class<?>[] paramTypes = handlerMethod.getParameterTypes(); Object[] args = new Object[paramTypes.length]; Class<?> handlerType = handler.getClass(); for (int i = 0; i < args.length; i++) { MethodParameter methodParam = new MethodParameter(handlerMethod, i); GenericTypeResolver.resolveParameterType(methodParam, handlerType); - Class paramType = methodParam.getParameterType(); + Class<?> paramType = methodParam.getParameterType(); Object argValue = resolveCommonArgument(methodParam, webRequest, thrownException); if (argValue != WebArgumentResolver.UNRESOLVED) { args[i] = argValue; @@ -290,7 +290,7 @@ protected Object resolveCommonArgument(MethodParameter methodParameter, NativeWe } // Resolution of standard parameter types... - Class paramType = methodParameter.getParameterType(); + Class<?> paramType = methodParameter.getParameterType(); Object value = resolveStandardArgument(paramType, webRequest, thrownException); if (value != WebArgumentResolver.UNRESOLVED && !ClassUtils.isAssignableValue(paramType, value)) { throw new IllegalStateException( @@ -311,7 +311,7 @@ protected Object resolveCommonArgument(MethodParameter methodParameter, NativeWe * @param thrownException the exception thrown * @return the argument value, or {@link WebArgumentResolver#UNRESOLVED} */ - protected Object resolveStandardArgument(Class parameterType, NativeWebRequest webRequest, + protected Object resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest, Exception thrownException) throws Exception { if (parameterType.isInstance(thrownException)) { @@ -395,7 +395,7 @@ else if (returnValue instanceof Model) { return new ModelAndView().addAllObjects(((Model) returnValue).asMap()); } else if (returnValue instanceof Map) { - return new ModelAndView().addAllObjects((Map) returnValue); + return new ModelAndView().addAllObjects((Map<String, Object>) returnValue); } else if (returnValue instanceof View) { return new ModelAndView((View) returnValue);
true
Other
spring-projects
spring-framework
64ee5e579adcec97122fc0ee1414031da3be0c6e.json
Fix bug with custom RequestCondition A custom RequestCondition which can be provided by overriding methods in RequestMappingHandlerMapping worked only for conditions that match and did not return null (as it should have) for conditions that don't match. Issues: SPR-9134
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/RequestConditionHolder.java
@@ -25,22 +25,22 @@ /** * A holder for a {@link RequestCondition} useful when the type of the held * request condition is not known ahead of time - e.g. custom condition. - * - * <p>An implementation of {@code RequestCondition} itself, a - * {@code RequestConditionHolder} decorates the held request condition allowing - * it to be combined and compared with other custom request conditions while + * + * <p>An implementation of {@code RequestCondition} itself, a + * {@code RequestConditionHolder} decorates the held request condition allowing + * it to be combined and compared with other custom request conditions while * ensuring type and null safety. - * + * * @author Rossen Stoyanchev * @since 3.1 */ public final class RequestConditionHolder extends AbstractRequestCondition<RequestConditionHolder> { @SuppressWarnings("rawtypes") private final RequestCondition condition; - + /** - * Create a new holder to wrap the given request condition. + * Create a new holder to wrap the given request condition. * @param requestCondition the condition to hold, may be {@code null} */ public RequestConditionHolder(RequestCondition<?> requestCondition) { @@ -65,7 +65,7 @@ protected String getToStringInfix() { } /** - * Combine the request conditions held by the two RequestConditionHolder + * Combine the request conditions held by the two RequestConditionHolder * instances after making sure the conditions are of the same type. * Or if one holder is empty, the other holder is returned. */ @@ -97,9 +97,9 @@ private void assertIsCompatible(RequestConditionHolder other) { throw new ClassCastException("Incompatible request conditions: " + clazz + " and " + otherClazz); } } - + /** - * Get the matching condition for the held request condition wrap it in a + * Get the matching condition for the held request condition wrap it in a * new RequestConditionHolder instance. Or otherwise if this is an empty * holder, return the same holder instance. */ @@ -108,11 +108,11 @@ public RequestConditionHolder getMatchingCondition(HttpServletRequest request) { return this; } RequestCondition<?> match = (RequestCondition<?>) condition.getMatchingCondition(request); - return new RequestConditionHolder(match); + return (match != null) ? new RequestConditionHolder(match) : null; } /** - * Compare the request conditions held by the two RequestConditionHolder + * Compare the request conditions held by the two RequestConditionHolder * instances after making sure the conditions are of the same type. * Or if one holder is empty, the other holder is preferred. */ @@ -132,5 +132,5 @@ else if (other.condition == null) { return condition.compareTo(other.condition, request); } } - + }
true
Other
spring-projects
spring-framework
64ee5e579adcec97122fc0ee1414031da3be0c6e.json
Fix bug with custom RequestCondition A custom RequestCondition which can be provided by overriding methods in RequestMappingHandlerMapping worked only for conditions that match and did not return null (as it should have) for conditions that don't match. Issues: SPR-9134
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/RequestConditionHolderTests.java
@@ -17,22 +17,19 @@ package org.springframework.web.servlet.mvc.condition; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import javax.servlet.http.HttpServletRequest; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.mvc.condition.HeadersRequestCondition; -import org.springframework.web.servlet.mvc.condition.ParamsRequestCondition; -import org.springframework.web.servlet.mvc.condition.RequestConditionHolder; -import org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition; /** - * A test fixture for + * A test fixture for * {code org.springframework.web.servlet.mvc.method.RequestConditionHolder} tests. - * + * * @author Rossen Stoyanchev */ public class RequestConditionHolderTests { @@ -41,7 +38,7 @@ public class RequestConditionHolderTests { public void combineEmpty() { RequestConditionHolder empty = new RequestConditionHolder(null); RequestConditionHolder notEmpty = new RequestConditionHolder(new ParamsRequestCondition("name")); - + assertSame(empty, empty.combine(new RequestConditionHolder(null))); assertSame(notEmpty, notEmpty.combine(empty)); assertSame(notEmpty, empty.combine(notEmpty)); @@ -52,7 +49,7 @@ public void combine() { RequestConditionHolder params1 = new RequestConditionHolder(new ParamsRequestCondition("name1")); RequestConditionHolder params2 = new RequestConditionHolder(new ParamsRequestCondition("name2")); RequestConditionHolder expected = new RequestConditionHolder(new ParamsRequestCondition("name1", "name2")); - + assertEquals(expected, params1.combine(params2)); } @@ -67,14 +64,24 @@ public void combineIncompatible() { public void match() { MockHttpServletRequest request = new MockHttpServletRequest("GET", "/"); request.setParameter("name1", "value1"); - + RequestMethodsRequestCondition rm = new RequestMethodsRequestCondition(RequestMethod.GET, RequestMethod.POST); RequestConditionHolder custom = new RequestConditionHolder(rm); RequestMethodsRequestCondition expected = new RequestMethodsRequestCondition(RequestMethod.GET); - + assertEquals(expected, custom.getMatchingCondition(request).getCondition()); } - + + @Test + public void noMatch() { + MockHttpServletRequest request = new MockHttpServletRequest("GET", "/"); + + RequestMethodsRequestCondition rm = new RequestMethodsRequestCondition(RequestMethod.POST); + RequestConditionHolder custom = new RequestConditionHolder(rm); + + assertNull(custom.getMatchingCondition(request)); + } + @Test public void matchEmpty() { RequestConditionHolder empty = new RequestConditionHolder(null); @@ -91,7 +98,7 @@ public void compare() { assertEquals(1, params11.compareTo(params12, request)); assertEquals(-1, params12.compareTo(params11, request)); } - + @Test public void compareEmpty() { HttpServletRequest request = new MockHttpServletRequest();
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-aop/src/main/resources/org/springframework/aop/config/spring-aop-3.2.xsd
@@ -0,0 +1,410 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/aop" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/aop" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the configuration elements for the Spring Framework's AOP support. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:element name="config"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A section (compartmentalization) of AOP-specific configuration (including + aspects, pointcuts, etc). + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="pointcut" type="pointcutType" minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A named pointcut definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="advisor" type="advisorType" minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.aop.Advisor"><![CDATA[ + A named advisor definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="aspect" type="aspectType" minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A named aspect definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Are class-based (CGLIB) proxies to be created? By default, standard + Java interface-based proxies are created. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="expose-proxy" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicate that the proxy should be exposed by the AOP framework as a + ThreadLocal for retrieval via the AopContext class. Off by default, + i.e. no guarantees that AopContext access will work. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="aspectj-autoproxy"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"><![CDATA[ + Enables the use of the @AspectJ style of Spring AOP. + + See org.springframework.context.annotation.EnableAspectJAutoProxy Javadoc + for information on code-based alternatives to this XML element. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="include" type="includeType" minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates that only @AspectJ beans with names matched by the (regex) + pattern will be considered as defining aspects to use for Spring autoproxying. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Are class-based (CGLIB) proxies to be created? By default, standard + Java interface-based proxies are created. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="expose-proxy" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicate that the proxy should be exposed by the AOP framework as a + ThreadLocal for retrieval via the AopContext class. Off by default, + i.e. no guarantees that AopContext access will work. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="scoped-proxy"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.aop.scope.ScopedProxyFactoryBean"><![CDATA[ + Marks a bean definition as being a scoped proxy. + + A bean marked as such will be exposed via a proxy, with the 'real' + bean instance being retrieved from some other source (such as a + HttpSession) as and when required. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="proxy-target-class" type="xsd:boolean" default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Are class-based (CGLIB) proxies to be created? This is the default; in order to + switch to standard Java interface-based proxies, turn this flag to "false". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="aspectType"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element name="pointcut" type="pointcutType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A named pointcut definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="declare-parents" type="declareParentsType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Allows this aspect to introduce additional interfaces that the advised + object will transparently implement. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="before" type="basicAdviceType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A before advice definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="after" type="basicAdviceType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + An after advice definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="after-returning" type="afterReturningAdviceType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + An after-returning advice definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="after-throwing" type="afterThrowingAdviceType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + An after-throwing advice definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="around" type="basicAdviceType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + An around advice definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:choice> + <xsd:attribute name="id" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The unique identifier for an aspect. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the (backing) bean that encapsulates the aspect. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="order" type="xsd:int"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[ + Controls the ordering of the execution of this aspect when multiple + advice executes at a specific joinpoint. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="includeType"> + <xsd:attribute name="name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.util.regex.Pattern"><![CDATA[ + The regular expression defining which beans are to be included in the + list of @AspectJ beans; beans with names matched by the pattern will + be included. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="pointcutType"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.aop.Pointcut"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:attribute name="id" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The unique identifier for a pointcut. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="expression" use="required" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The pointcut expression. + + For example : 'execution(* com.xyz.myapp.service.*.*(..))' + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="declareParentsType"> + <xsd:attribute name="types-matching" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.aop.aspectj.TypePatternClassFilter"><![CDATA[ + The AspectJ type expression that defines what types (classes) the + introduction is restricted to. + + An example would be 'org.springframework.beans.ITestBean+'. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="implement-interface" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The fully qualified name of the interface that will be introduced. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-impl" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The fully qualified name of the class that will be instantiated to serve + as the default implementation of the introduced interface. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="delegate-ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the bean that will serve + as the default implementation of the introduced interface. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"/> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="basicAdviceType"> + <xsd:attribute name="pointcut" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The associated pointcut expression. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="pointcut-ref" type="pointcutRefType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of an associated pointcut definition. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.aop.Pointcut"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="method" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the method that defines the logic of the advice. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="arg-names" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The comma-delimited list of advice method argument (parameter) names + that will be matched from pointcut parameters. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="afterReturningAdviceType"> + <xsd:complexContent> + <xsd:extension base="basicAdviceType"> + <xsd:attribute name="returning" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the method parameter to which the return value must + be passed. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="afterThrowingAdviceType"> + <xsd:complexContent> + <xsd:extension base="basicAdviceType"> + <xsd:attribute name="throwing" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the method parameter to which the thrown exception must + be passed. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="advisorType"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.aop.Advisor"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:attribute name="id" type="xsd:string"/> + <xsd:attribute name="advice-ref" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to an advice bean. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.aopalliance.aop.Advice"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="pointcut" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A pointcut expression. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="pointcut-ref" type="pointcutRefType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to a pointcut definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="order" type="xsd:int"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[ + Controls the ordering of the execution of this advice when multiple + advice executes at a specific joinpoint. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:simpleType name="pointcutRefType"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.aop.Pointcut"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:union memberTypes="xsd:string"/> + </xsd:simpleType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-beans/src/main/resources/org/springframework/beans/factory/xml/spring-beans-3.2.xsd
@@ -0,0 +1,1180 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/beans" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://www.springframework.org/schema/beans"> + + <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Spring XML Beans Schema, version 3.2 + Authors: Juergen Hoeller, Rob Harrop, Mark Fisher, Chris Beams + + This defines a simple and consistent way of creating a namespace + of JavaBeans objects, managed by a Spring BeanFactory, read by + XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader). + + This document type is used by most Spring functionality, including + web application contexts, which are based on bean factories. + + Each "bean" element in this document defines a JavaBean. + Typically the bean class is specified, along with JavaBean properties + and/or constructor arguments. + + A bean instance can be a "singleton" (shared instance) or a "prototype" + (independent instance). Further scopes can be provided by extended + bean factories, for example in a web environment. + + References among beans are supported, that is, setting a JavaBean property + or a constructor argument to refer to another bean in the same factory + (or an ancestor factory). + + As alternative to bean references, "inner bean definitions" can be used. + Singleton flags of such inner bean definitions are effectively ignored: + inner beans are typically anonymous prototypes. + + There is also support for lists, sets, maps, and java.util.Properties + as bean property types or constructor argument types. + ]]></xsd:documentation> + </xsd:annotation> + + <!-- base types --> + <xsd:complexType name="identifiedType" abstract="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The unique identifier for a bean. The scope of the identifier + is the enclosing bean factory. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="id" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The unique identifier for a bean. A bean id may not be used more than once + within the same <beans> element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <!-- Top-level <beans> tag --> + <xsd:element name="beans"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Container for <bean> and other elements, typically the root element in the document. + Allows the definition of default values for all nested bean definitions. May itself + be nested for the purpose of defining a subset of beans with certain default values or + to be registered only when certain profile(s) are active. Any such nested <beans> element + must be declared as the last element in the document. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="description" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="import"/> + <xsd:element ref="alias"/> + <xsd:element ref="bean"/> + <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> + </xsd:choice> + <xsd:element ref="beans" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="profile" use="optional" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The set of profiles for which this <beans> element may be parsed. Multiple profiles can be + separated by any number of spaces, commas, or semi-colons (or indeed any mixture of the three). + If one or more of the specified profiles are active at time of parsing, the <beans> element + will be parsed, and all of its <bean> elements registered, &lt;import&gt; elements followed, + etc. If none of the specified profiles are active at time of parsing, then the entire element + and its contents will be ignored. + + Profiles are activated in one of two ways: + Programmatic: + ConfigurableEnvironment#setActiveProfiles(String...) + ConfigurableEnvironment#setDefaultProfiles(String...) + + Properties (typically through -D system properties, environment variables, or servlet context init params): + spring.profiles.active=p1,p2 + spring.profiles.default=p1,p2 + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-lazy-init" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The default 'lazy-init' value; see the documentation for the + 'lazy-init' attribute of the 'bean' element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-merge" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The default 'merge' value; see the documentation for the + 'merge' attribute of the various collection elements. The default + is 'false'. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-autowire" default="default"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The default 'autowire' value; see the documentation for the + 'autowire' attribute of the 'bean' element. The default is 'default'. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="default"/> + <xsd:enumeration value="no"/> + <xsd:enumeration value="byName"/> + <xsd:enumeration value="byType"/> + <xsd:enumeration value="constructor"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="default-autowire-candidates" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A default bean name pattern for identifying autowire candidates: + e.g. "*Service", "data*", "*Service*", "data*Service". + Also accepts a comma-separated list of patterns: e.g. "*Service,*Dao". + See the documentation for the 'autowire-candidate' attribute of the + 'bean' element for the semantic details of autowire candidate beans. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-init-method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The default 'init-method' value; see the documentation for the + 'init-method' attribute of the 'bean' element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-destroy-method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The default 'destroy-method' value; see the documentation for the + 'destroy-method' attribute of the 'bean' element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="description"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Contains informative text describing the purpose of the enclosing element. + Used primarily for user documentation of XML bean definition documents. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType mixed="true"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="import"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[ + Specifies an XML bean definition resource to import. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:anyType"> + <xsd:attribute name="resource" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The relative resource location of the XML (bean definition) file to import, + for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="alias"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines an alias for a bean (which can reside in a different definition + resource). + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:anyType"> + <xsd:attribute name="name" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the bean to define an alias for. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="alias" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The alias name to define for the bean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:group name="beanElements"> + <xsd:sequence> + <xsd:element ref="description" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="meta"/> + <xsd:element ref="constructor-arg"/> + <xsd:element ref="property"/> + <xsd:element ref="qualifier"/> + <xsd:element ref="lookup-method"/> + <xsd:element ref="replaced-method"/> + <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> + </xsd:choice> + </xsd:sequence> + </xsd:group> + + <xsd:attributeGroup name="beanAttributes"> + <xsd:attribute name="name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Can be used to create one or more aliases illegal in an (XML) id. + Multiple aliases can be separated by any number of spaces, commas, + or semi-colons (or indeed any mixture of the three). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="class" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The fully qualified name of the bean's class, except if it serves only + as a parent definition for child bean definitions. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="parent" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the parent bean definition. + + Will use the bean class of the parent if none is specified, but can + also override it. In the latter case, the child bean class must be + compatible with the parent, i.e. accept the parent's property values + and constructor argument values, if any. + + A child bean definition will inherit constructor argument values, + property values and method overrides from the parent, with the option + to add new values. If init method, destroy method, factory bean and/or + factory method are specified, they will override the corresponding + parent settings. + + The remaining settings will always be taken from the child definition: + depends on, autowire mode, scope, lazy init. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scope" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The scope of this bean: typically "singleton" (one shared instance, + which will be returned by all calls to getBean with the given id), or + "prototype" (independent instance resulting from each call to getBean). + + By default, a bean will be a singleton, unless the bean has a parent + bean definition in which case it will inherit the parent's scope. + + Singletons are most commonly used, and are ideal for multi-threaded + service objects. Further scopes, such as "request" or "session", might + be supported by extended bean factories (e.g. in a web environment). + + Inner bean definitions inherit the singleton status of their containing + bean definition, unless explicitly specified: The inner bean will be a + singleton if the containing bean is a singleton, and a prototype if + the containing bean has any other scope. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="abstract" type="xsd:boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Is this bean "abstract", that is, not meant to be instantiated itself + but rather just serving as parent for concrete child bean definitions? + The default is "false". Specify "true" to tell the bean factory to not + try to instantiate that particular bean in any case. + + Note: This attribute will not be inherited by child bean definitions. + Hence, it needs to be specified per abstract bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="lazy-init" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates whether or not this bean is to be lazily initialized. + If false, it will be instantiated on startup by bean factories + that perform eager initialization of singletons. The default is + "false". + + Note: This attribute will not be inherited by child bean definitions. + Hence, it needs to be specified per concrete bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="autowire" default="default"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether bean properties are "autowired". + This is an automagical process in which bean references don't need + to be coded explicitly in the XML bean definition file, but rather the + Spring container works out dependencies. + + There are 4 modes: + + 1. "no" + The traditional Spring default. No automagical wiring. Bean references + must be defined in the XML file via the <ref/> element (or "ref" + attribute). We recommend this in most cases as it makes documentation + more explicit. + + Note that this default mode also allows for annotation-driven autowiring, + if activated. "no" refers to externally driven autowiring only, not + affecting any autowiring demands that the bean class itself expresses. + + 2. "byName" + Autowiring by property name. If a bean of class Cat exposes a "dog" + property, Spring will try to set this to the value of the bean "dog" + in the current container. If there is no matching bean by name, nothing + special happens. + + 3. "byType" + Autowiring if there is exactly one bean of the property type in the + container. If there is more than one, a fatal error is raised, and + you cannot use byType autowiring for that bean. If there is none, + nothing special happens. + + 4. "constructor" + Analogous to "byType" for constructor arguments. If there is not exactly + one bean of the constructor argument type in the bean factory, a fatal + error is raised. + + Note that explicit dependencies, i.e. "property" and "constructor-arg" + elements, always override autowiring. + + Note: This attribute will not be inherited by child bean definitions. + Hence, it needs to be specified per concrete bean definition. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="default"/> + <xsd:enumeration value="no"/> + <xsd:enumeration value="byName"/> + <xsd:enumeration value="byType"/> + <xsd:enumeration value="constructor"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="depends-on" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The names of the beans that this bean depends on being initialized. + The bean factory will guarantee that these beans get initialized + before this bean. + + Note that dependencies are normally expressed through bean properties + or constructor arguments. This property should just be necessary for + other kinds of dependencies like statics (*ugh*) or database preparation + on startup. + + Note: This attribute will not be inherited by child bean definitions. + Hence, it needs to be specified per concrete bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="autowire-candidate" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates whether or not this bean should be considered when looking + for matching candidates to satisfy another bean's autowiring requirements. + Note that this does not affect explicit references by name, which will get + resolved even if the specified bean is not marked as an autowire candidate. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="primary" type="xsd:boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies that this bean should be given preference when multiple + candidates are qualified to autowire a single-valued dependency. + If exactly one 'primary' bean exists among the candidates, it + will be the autowired value. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="init-method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the custom initialization method to invoke after setting + bean properties. The method must have no arguments, but may throw any + exception. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="destroy-method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the custom destroy method to invoke on bean factory + shutdown. The method must have no arguments, but may throw any + exception. + + Note: Only invoked on beans whose lifecycle is under the full + control of the factory - which is always the case for singletons, + but not guaranteed for any other scope. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="factory-method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of a factory method to use to create this object. Use + constructor-arg elements to specify arguments to the factory method, + if it takes arguments. Autowiring does not apply to factory methods. + + If the "class" attribute is present, the factory method will be a static + method on the class specified by the "class" attribute on this bean + definition. Often this will be the same class as that of the constructed + object - for example, when the factory method is used as an alternative + to a constructor. However, it may be on a different class. In that case, + the created object will *not* be of the class specified in the "class" + attribute. This is analogous to FactoryBean behavior. + + If the "factory-bean" attribute is present, the "class" attribute is not + used, and the factory method will be an instance method on the object + returned from a getBean call with the specified bean name. The factory + bean may be defined as a singleton or a prototype. + + The factory method can have any number of arguments. Autowiring is not + supported. Use indexed constructor-arg elements in conjunction with the + factory-method attribute. + + Setter Injection can be used in conjunction with a factory method. + Method Injection cannot, as the factory method returns an instance, + which will be used when the container creates the bean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="factory-bean" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Alternative to class attribute for factory-method usage. + If this is specified, no class attribute should be used. + This must be set to the name of a bean in the current or + ancestor factories that contains the relevant factory method. + This allows the factory itself to be configured using Dependency + Injection, and an instance (rather than static) method to be used. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:attributeGroup> + + <xsd:element name="meta" type="metaType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Arbitrary metadata attached to a bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + + <xsd:complexType name="metaType"> + <xsd:attribute name="key" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The key name of the metadata attribute being defined. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="value" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The value of the metadata attribute being defined (as a simple String). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:element name="bean"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[ + Defines a single (usually named) bean. + + A bean definition may contain nested tags for constructor arguments, + property values, lookup methods, and replaced methods. Mixing constructor + injection and setter injection on the same bean is explicitly supported. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="identifiedType"> + <xsd:group ref="beanElements"/> + <xsd:attributeGroup ref="beanAttributes"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="constructor-arg"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues"> + <![CDATA[ + Bean definitions can specify zero or more constructor arguments. + This is an alternative to "autowire constructor". + Arguments correspond to either a specific index of the constructor + argument list or are supposed to be matched generically by type. + + Note: A single generic argument value will just be used once, rather + than potentially matched multiple times (as of Spring 1.1). + + constructor-arg elements are also used in conjunction with the + factory-method element to construct beans using static or instance + factory methods. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="description" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element ref="bean"/> + <xsd:element ref="ref"/> + <xsd:element ref="idref"/> + <xsd:element ref="value"/> + <xsd:element ref="null"/> + <xsd:element ref="array"/> + <xsd:element ref="list"/> + <xsd:element ref="set"/> + <xsd:element ref="map"/> + <xsd:element ref="props"/> + <xsd:any namespace="##other" processContents="strict"/> + </xsd:choice> + </xsd:sequence> + <xsd:attribute name="index" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The exact index of the argument in the constructor argument list. + Only needed to avoid ambiguities, e.g. in case of 2 arguments of + the exact same type. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="type" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The exact type of the constructor argument. Only needed to avoid + ambiguities, e.g. in case of 2 single argument constructors + that can both be converted from a String. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The exact name of the argument in the constructor argument list. + Only needed to avoid ambiguities, e.g. in case of 2 arguments of + the exact same type. Note: This requires debug symbols to be + stored in the class file in order to introspect argument names! + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A short-cut alternative to a nested "<ref bean='...'/>" element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="value" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A short-cut alternative to a nested "<value>...<value/>" element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="property" type="propertyType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Bean definitions can have zero or more properties. + Property elements correspond to JavaBean setter methods exposed + by the bean classes. Spring supports primitives, references to other + beans in the same or related factories, lists, maps and properties. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + + <xsd:element name="qualifier"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Bean definitions can provide qualifiers to match against annotations + on a field or parameter for fine-grained autowire candidate resolution. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="type" type="xsd:string" default="org.springframework.beans.factory.annotation.Qualifier"/> + <xsd:attribute name="value" type="xsd:string"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="attribute" type="metaType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A qualifier element may contain attribute child elements as key-value + pairs. These will be available for matching against attributes of a + qualifier annotation on an autowired field or parameter if present. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + + <xsd:element name="lookup-method"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A lookup method causes the IoC container to override the given method + and return the bean with the name given in the bean attribute. This is + a form of Method Injection. It is particularly useful as an alternative + to implementing the BeanFactoryAware interface, in order to be able to + make getBean() calls for non-singleton instances at runtime. In this + case, Method Injection is a less invasive alternative. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:anyType"> + <xsd:attribute name="name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the lookup method. This method must take no arguments. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="bean" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the bean in the current or ancestor factories that + the lookup method should resolve to. Often this bean will be a + prototype, in which case the lookup method will return a distinct + instance on every invocation. This is useful for single-threaded objects. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="replaced-method"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Similar to the lookup method mechanism, the replaced-method element + is used to control IoC container method overriding: Method Injection. + This mechanism allows the overriding of a method with arbitrary code. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="arg-type"/> + </xsd:choice> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the method whose implementation must be replaced by the + IoC container. If this method is not overloaded, there is no need + to use arg-type subelements. If this method is overloaded, arg-type + subelements must be used for all override definitions for the method. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="replacer" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[ + Bean name of an implementation of the MethodReplacer interface in the + current or ancestor factories. This may be a singleton or prototype + bean. If it is a prototype, a new instance will be used for each + method replacement. Singleton usage is the norm. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="arg-type"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Identifies an argument for a replaced method in the event of + method overloading. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType mixed="true"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"/> + <xsd:attribute name="match" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specification of the type of an overloaded method argument as a String. + For convenience, this may be a substring of the FQN. E.g. all the + following would match "java.lang.String": + - java.lang.String + - String + - Str + + As the number of arguments will be checked also, this convenience + can often be used to save typing. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="ref"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines a reference to another bean in this factory or an external + factory (parent or included factory). + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:anyType"> + <xsd:attribute name="bean" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the referenced bean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="local" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the referenced bean. The value must be a bean ID and will be + checked by the Spring container. This is therefore the preferred technique + for referencing beans within the same bean factory XML file. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="parent" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the referenced bean in a parent factory. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="idref"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The id of another bean in this factory or an external factory + (parent or included factory). + While a regular 'value' element could instead be used for the + same effect, using idref indicates that the Spring container + should check that the value actually corresponds to a bean id. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:anyType"> + <xsd:attribute name="bean" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the referenced bean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="local" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the referenced bean. The value must be a bean ID and will be + checked by the Spring container. This is therefore the preferred technique + for referencing beans within the same bean factory XML file. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="value"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Contains a string representation of a property value. + The property may be a string, or may be converted to the required + type using the JavaBeans PropertyEditor machinery. This makes it + possible for application developers to write custom PropertyEditor + implementations that can convert strings to arbitrary target objects. + + Note that this is recommended for simple objects only. Configure + more complex objects by populating JavaBean properties with + references to other beans. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType mixed="true"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"/> + <xsd:attribute name="type" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The exact type that the value should be converted to. Only needed + if the type of the target property or constructor argument is + too generic: for example, in case of a collection element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="null"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Denotes a Java null value. Necessary because an empty "value" tag + will resolve to an empty String, which will not be resolved to a + null value unless a special PropertyEditor does so. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType mixed="true"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"/> + </xsd:complexType> + </xsd:element> + + <!-- Collection Elements --> + <xsd:group name="collectionElements"> + <xsd:sequence> + <xsd:element ref="description" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="bean"/> + <xsd:element ref="ref"/> + <xsd:element ref="idref"/> + <xsd:element ref="value"/> + <xsd:element ref="null"/> + <xsd:element ref="array"/> + <xsd:element ref="list"/> + <xsd:element ref="set"/> + <xsd:element ref="map"/> + <xsd:element ref="props"/> + <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> + </xsd:choice> + </xsd:sequence> + </xsd:group> + + <xsd:element name="array"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + An array can contain multiple inner bean, ref, collection, or value elements. + This configuration element will always result in an array, even when being + defined e.g. as a value for a map with value type Object. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="listOrSetType"> + <xsd:attribute name="merge" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Enables/disables merging for collections when using parent/child beans. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="list"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A list can contain multiple inner bean, ref, collection, or value elements. + A list can also map to an array type; the necessary conversion is performed + automatically. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="listOrSetType"> + <xsd:attribute name="merge" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Enables/disables merging for collections when using parent/child beans. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="set"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A set can contain multiple inner bean, ref, collection, or value elements. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="listOrSetType"> + <xsd:attribute name="merge" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Enables/disables merging for collections when using parent/child beans. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="map"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A mapping from a key to an object. Maps may be empty. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="mapType"> + <xsd:attribute name="merge" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Enables/disables merging for collections when using parent/child beans. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="entry" type="entryType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A map entry can be an inner bean, ref, value, or collection. + The key of the entry is given by the "key" attribute or child element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + + <xsd:element name="props"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Props elements differ from map elements in that values must be strings. + Props may be empty. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="propsType"> + <xsd:attribute name="merge" default="default" type="defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Enables/disables merging for collections when using parent/child beans. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="key"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A key element can contain an inner bean, ref, value, or collection. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:group ref="collectionElements"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="prop"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The string value of the property. Note that whitespace is trimmed + off to avoid unwanted whitespace caused by typical XML formatting. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType mixed="true"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"/> + <xsd:attribute name="key" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The key of the property entry. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="propertyType"> + <xsd:sequence> + <xsd:element ref="description" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element ref="meta"/> + <xsd:element ref="bean"/> + <xsd:element ref="ref"/> + <xsd:element ref="idref"/> + <xsd:element ref="value"/> + <xsd:element ref="null"/> + <xsd:element ref="array"/> + <xsd:element ref="list"/> + <xsd:element ref="set"/> + <xsd:element ref="map"/> + <xsd:element ref="props"/> + <xsd:any namespace="##other" processContents="strict"/> + </xsd:choice> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the property, following JavaBean naming conventions. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A short-cut alternative to a nested "<ref bean='...'/>". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="value" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A short-cut alternative to a nested "<value>...</value>" element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <!-- Collection Types --> + + <!-- base type for collections that have (possibly) typed nested values --> + <xsd:complexType name="collectionType"> + <xsd:attribute name="value-type" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The default Java type for nested values. Must be a fully qualified + class name. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <!-- 'list' and 'set' collection type --> + <xsd:complexType name="listOrSetType"> + <xsd:complexContent> + <xsd:extension base="collectionType"> + <xsd:group ref="collectionElements"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <!-- 'map' element type --> + <xsd:complexType name="mapType"> + <xsd:complexContent> + <xsd:extension base="collectionType"> + <xsd:sequence> + <xsd:element ref="description" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="entry"/> + </xsd:choice> + </xsd:sequence> + <xsd:attribute name="key-type" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The default Java type for nested entry keys. Must be a fully qualified + class name. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <!-- 'entry' element type --> + <xsd:complexType name="entryType"> + <xsd:sequence> + <xsd:element ref="key" minOccurs="0"/> + <xsd:group ref="collectionElements"/> + </xsd:sequence> + <xsd:attribute name="key" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Each map element must specify its key as attribute or as child element. + A key attribute is always a String value. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="key-ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A short-cut alternative to a to a "key" element with a nested + "<ref bean='...'/>". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="value" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A short-cut alternative to a nested "<value>...</value>" + element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="value-ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A short-cut alternative to a nested "<ref bean='...'/>". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <!-- 'props' collection type --> + <xsd:complexType name="propsType"> + <xsd:complexContent> + <xsd:extension base="collectionType"> + <xsd:sequence> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="prop"/> + </xsd:choice> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <!-- simple internal types --> + <xsd:simpleType name="defaultable-boolean"> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="default"/> + <xsd:enumeration value="true"/> + <xsd:enumeration value="false"/> + </xsd:restriction> + </xsd:simpleType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-beans/src/main/resources/org/springframework/beans/factory/xml/spring-tool-3.2.xsd
@@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/tool" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://www.springframework.org/schema/tool" + elementFormDefault="qualified"> + + <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the tool support annotations for Spring's configuration namespaces. + Used in other namespace XSD files; not intended for direct use in config files. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:element name="annotation"> + <xsd:complexType> + <xsd:sequence minOccurs="0"> + <xsd:element name="expected-type" type="typedParameterType" minOccurs="0" maxOccurs="1"/> + <xsd:element name="assignable-to" type="assignableToType" minOccurs="0" maxOccurs="1"/> + <xsd:element name="exports" type="exportsType" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="registers-scope" type="registersScopeType" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="expected-method" type="expectedMethodType" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="kind" default="direct"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="ref"/> + <xsd:enumeration value="direct"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="typedParameterType"> + <xsd:attribute name="type" type="xsd:string" use="required"/> + </xsd:complexType> + + <xsd:complexType name="assignableToType"> + <xsd:attribute name="type" type="xsd:string"/> + <xsd:attribute name="restriction" default="both"> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="both"/> + <xsd:enumeration value="interface-only"/> + <xsd:enumeration value="class-only"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="expectedMethodType"> + <xsd:attribute name="type" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines an XPath query that can be executed against the node annotated with this + type to determine the class for which the this method is valid + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="type-ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines an XPath query that can be executed against the node annotated with this + type to determine a referenced bean (by id or alias) for which the given method is valid + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="expression" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines an AspectJ method execution pointcut expressions that matches valid methods + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="exportsType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates that an annotated type exports an application visible component. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="type" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The type of the exported component. May be null if the type is not known until runtime. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="identifier" type="xsd:string" default="@id"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines an XPath query that can be executed against the node annotated with this + type to determine the identifier of any exported component. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:complexType name="registersScopeType"> + <xsd:attribute name="name" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the name of a custom bean scope that the annotated type registers, e.g. "conversation". + Such a scope will be available in addition to the standard "singleton" and "prototype" scopes + (plus "request", "session" and "globalSession" in a web application environment). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-beans/src/main/resources/org/springframework/beans/factory/xml/spring-util-3.2.xsd
@@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/util" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/util" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:element name="constant"> + <xsd:annotation> + <xsd:documentation> + Reference a public, static field on a type and expose its value as + a bean. For example <code>&lt;util:constant static-field=&quot;java.lang.Integer.MAX_VALUE&quot;/&gt;</code>. + </xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="id" type="xsd:string"/> + <xsd:attribute name="static-field" type="xsd:string" use="required"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="property-path"> + <xsd:annotation> + <xsd:documentation> + Reference a property on a bean (or as a nested value) and expose its values as + a bean. For example &lt;util:property-path path=&quot;order.customer.name&quot;/&gt;. + </xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="id" type="xsd:string"/> + <xsd:attribute name="path" type="xsd:string" use="required"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="list"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.beans.factory.config.ListFactoryBean"> + Builds a List instance of the specified type, populated with the specified content. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="java.util.List"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="beans:listOrSetType"> + <xsd:attribute name="id" type="xsd:string"/> + <xsd:attribute name="list-class" type="xsd:string"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class"/> + <tool:assignable-to type="java.util.List"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scope" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The scope of this collection bean: typically "singleton" (one shared instance, + which will be returned by all calls to getBean with the given id), or + "prototype" (independent instance resulting from each call to getBean). + Default is "singleton". Further scopes, such as "request" or "session", + might be supported by extended bean factories (e.g. in a web environment). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="set"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.beans.factory.config.SetFactoryBean"> + Builds a Set instance of the specified type, populated with the specified content. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="java.util.Set"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="beans:listOrSetType"> + <xsd:attribute name="id" type="xsd:string"/> + <xsd:attribute name="set-class" type="xsd:string"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class"/> + <tool:assignable-to type="java.util.Set"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scope" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The scope of this collection bean: typically "singleton" (one shared instance, + which will be returned by all calls to getBean with the given id), or + "prototype" (independent instance resulting from each call to getBean). + Default is "singleton". Further scopes, such as "request" or "session", + might be supported by extended bean factories (e.g. in a web environment). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="map"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.beans.factory.config.MapFactoryBean"> + Builds a Map instance of the specified type, populated with the specified content. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="java.util.Map"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="beans:mapType"> + <xsd:attribute name="id" type="xsd:string"/> + <xsd:attribute name="map-class" type="xsd:string"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class"/> + <tool:assignable-to type="java.util.Map"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scope" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The scope of this collection bean: typically "singleton" (one shared instance, + which will be returned by all calls to getBean with the given id), or + "prototype" (independent instance resulting from each call to getBean). + Default is "singleton". Further scopes, such as "request" or "session", + might be supported by extended bean factories (e.g. in a web environment). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="properties"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.beans.factory.config.PropertiesFactoryBean"> + Loads a Properties instance from the resource location specified by the '<code>location</code>' attribute. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="java.util.Properties"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="beans:propsType"> + <xsd:attribute name="id" type="xsd:string"/> + <xsd:attribute name="location" type="xsd:string"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="org.springframework.core.io.Resource"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="local-override" type="xsd:boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies whether local properties override properties from files. + Default is "false": properties from files override local defaults. + If set to "true", local properties will override defaults from files. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scope" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The scope of this collection bean: typically "singleton" (one shared instance, + which will be returned by all calls to getBean with the given id), or + "prototype" (independent instance resulting from each call to getBean). + Default is "singleton". Further scopes, such as "request" or "session", + might be supported by extended bean factories (e.g. in a web environment). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-context/src/main/resources/org/springframework/cache/config/spring-cache-3.2.xsd
@@ -0,0 +1,235 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/cache" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/cache" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the elements used in the Spring Framework's declarative + cache management infrastructure. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:element name="annotation-driven"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.cache.annotation.AnnotationCacheOperationDefinitionSource"><![CDATA[ + Indicates that cache configuration is defined by Java 5 + annotations on bean classes, and that proxies are automatically + to be created for the relevant annotated beans. + + The default annotations supported are Spring's @Cacheable and @CacheEvict. + + See org.springframework.cache.annotation.EnableCaching Javadoc + for information on code-based alternatives to this XML element. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="cache-manager" type="xsd:string" default="cacheManager"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.cache.CacheManager"><![CDATA[ + The bean name of the CacheManager that is to be used to retrieve the backing caches. + + This attribute is not required, and only needs to be specified + explicitly if the bean name of the desired CacheManager + is not 'cacheManager'. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.cache.CacheManager"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="key-generator" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.cache.interceptor.KeyGenerator"><![CDATA[ + The bean name of the KeyGenerator that is to be used to retrieve the backing caches. + + This attribute is not required, and only needs to be specified + explicitly if the default strategy (DefaultKeyGenerator) is not sufficient. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.cache.interceptor.KeyGenerator"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="mode" default="proxy"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Should annotated beans be proxied using Spring's AOP framework, + or should they rather be weaved with an AspectJ transaction aspect? + + AspectJ weaving requires spring-aspects.jar on the classpath, + as well as load-time weaving (or compile-time weaving) enabled. + + Note: The weaving-based aspect requires the @Cacheable and @CacheInvalidate + annotations to be defined on the concrete class. Annotations in interfaces + will not work in that case (they will rather only work with interface-based proxies)! + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="proxy"/> + <xsd:enumeration value="aspectj"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Are class-based (CGLIB) proxies to be created? By default, standard + Java interface-based proxies are created. + + Note: Class-based proxies require the @Cacheable and @CacheInvalidate annotations + to be defined on the concrete class. Annotations in interfaces will not work + in that case (they will rather only work with interface-based proxies)! + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="order" type="xsd:int"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[ + Controls the ordering of the execution of the cache advisor + when multiple advice executes at a specific joinpoint. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="advice"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.cache.interceptor.CacheInterceptor"><![CDATA[ + Defines the cache semantics of the AOP advice that is to be + executed. + + That is, this advice element is where the cacheable semantics of + any number of methods are defined (where cacheable semantics + includes the backing cache(s), the key, cache condition rules, and suchlike). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="java:org.springframework.cache.interceptor.CacheInterceptor"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:sequence> + <xsd:element name="caching" type="definitionsType" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="cache-manager" type="xsd:string" default="cacheManager"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.cache.CacheManager"><![CDATA[ + The bean name of the CacheManager that is to be used + for storing and retrieving data. + + This attribute is not required, and only needs to be specified + explicitly if the bean name of the desired CacheManager + is not 'cacheManager'. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.cache.CacheManager"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="key-generator" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.cache.interceptor.KeyGenerator"><![CDATA[ + The bean name of the KeyGenerator that is to be used to retrieve the backing caches. + + This attribute is not required, and only needs to be specified + explicitly if the default strategy (DefaultKeyGenerator) is not sufficient. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.cache.interceptor.KeyGenerator"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="basedefinitionType"> + <xsd:attribute name="cache" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the backing cache(s). Multiple caches can be specified by separating them using comma: 'orders, books']]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="key" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The SpEL expression used for computing the cache key.]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="condition" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The SpEL expression used for conditioning the method caching.]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="method" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The method name(s) with which the cache attributes are to be + associated. The wildcard (*) character can be used to associate the + same cache attribute settings with a number of methods; for + example, 'get*', 'handle*', '*Order', 'on*Event', etc.]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + + </xsd:complexType> + + <xsd:complexType name="definitionsType"> + <xsd:complexContent> + <xsd:extension base="basedefinitionType"> + <xsd:sequence> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element name="cacheable" minOccurs="0" maxOccurs="unbounded" type="basedefinitionType"/> + <xsd:element name="cache-put" minOccurs="0" maxOccurs="unbounded" type="basedefinitionType"/> + <xsd:element name="cache-evict" minOccurs="0" maxOccurs="unbounded"> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="basedefinitionType"> + <xsd:attribute name="all-entries" type="xsd:boolean" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Whether all the entries should be evicted.]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="before-invocation" type="xsd:boolean" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Whether the eviction should occur after the method is successfully + invoked (default) or before.]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-context/src/main/resources/org/springframework/context/config/spring-context-3.2.xsd
@@ -0,0 +1,533 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/context" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/context" + elementFormDefault="qualified" attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd" /> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd" /> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the configuration elements for the Spring Framework's application + context support. Effects the activation of various configuration styles + for the containing Spring ApplicationContext. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:complexType name="propertyPlaceholder"> + <xsd:attribute name="location" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The location of the properties file to resolve placeholders against, as a Spring + resource location: a URL, a "classpath:" pseudo URL, or a relative file path. + Multiple locations may be specified, separated by commas. If neither location nor properties-ref is + specified, placeholders will be resolved against system properties. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="properties-ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.util.Properties"><![CDATA[ + The bean name of a Java Properties object that will be used for property substitution. + If neither location nor properties-ref is specified, placeholders will be resolved against system properties. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="file-encoding" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies the encoding to use for parsing properties files. Default is none, + using the java.util.Properties default encoding. Only applies to classic + properties files, not to XML files. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="order" type="xsd:integer"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies the order for this placeholder configurer. If more than one is present in a context + the order can be important since the first one to be match a placeholder will win. Often used + in conjunction with + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ignore-resource-not-found" type="xsd:boolean" + default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies if failure to find the property resource location should be ignored. Default + is "false", meaning that if there is no file in the location specified an exception will + be raised at runtime. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ignore-unresolvable" type="xsd:boolean" + default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies if failure to find the property value to replace a key should be ignored. Default + is "false", meaning that this placeholder configurer will raise an exception if it cannot resolve + a key. Set to "true" to allow the configurer to pass on the key to any others in + the context that have not yet visited the key in question. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="local-override" type="xsd:boolean" + default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies whether local properties override properties from files. Default + is "false": Properties from files override local defaults. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + + <xsd:element name="property-placeholder"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Activates replacement of ${...} placeholders by registering a + PropertySourcesPlaceholderConfigurer within the application context. Properties will + be resolved against the specified properties file or Properties object -- so called + "local properties", if any, and against the Spring Environment's current set of + PropertySources. + + Note that as of Spring 3.1 the system-properties-mode attribute has been removed in + favor of the more flexible PropertySources mechanism. However, Spring 3.1-based + applications may continue to use the 3.0 (and older) versions of the spring-context + schema in order to preserve system-properties-mode behavior. In this case, the + traditional PropertyPlaceholderConfigurer component will be registered instead of the + new PropertySourcesPlaceholderConfigurer. + + See ConfigurableEnvironment Javadoc for more information on using. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports + type="org.springframework.context.support.PropertySourcesPlaceholderConfigurer" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="propertyPlaceholder"> + <xsd:attribute name="system-properties-mode" default="ENVIRONMENT"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls how to resolve placeholders against system properties. As of Spring 3.1, this + attribute value defaults to "ENVIRONMENT", indicating that resolution of placeholders + against system properties is handled via PropertySourcesPlaceholderConfigurer and its + delegation to the current Spring Environment object. + + For maximum backward compatibility, this attribute is preserved going forward with the + 3.1 version of the context schema, and any values other than the default "ENVIRONMENT" + will cause a traditional PropertyPlaceholderConfigurer to be registered instead of the + newer PropertySourcesPlaceholderConfigurer variant. In this case, the Spring Environment + and its property sources are not interrogated when resolving placeholders. Users are + encouraged to consider this attribute deprecated, and to take advantage of + Environment/PropertySource mechanisms. See ConfigurableEnvironment Javadoc for examples. + + "ENVIRONMENT" indicates placeholders should be resolved against the current Environment and against any local properties; + "NEVER" indicates placeholders should be resolved only against local properties and never against system properties; + "FALLBACK" indicates placeholders should be resolved against any local properties and then against system properties; + "OVERRIDE" indicates placeholders should be resolved first against system properties and then against any local properties; + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="ENVIRONMENT"/> + <xsd:enumeration value="NEVER"/> + <xsd:enumeration value="FALLBACK"/> + <xsd:enumeration value="OVERRIDE"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="property-override"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Activates pushing of override values into bean properties, based on configuration + lines of the following format: beanName.property=value + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports + type="org.springframework.beans.factory.config.PropertyOverrideConfigurer" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="propertyPlaceholder" /> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="annotation-config"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Activates various annotations to be detected in bean classes: Spring's @Required and + @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy and @Resource (if available), + JAX-WS's @WebServiceRef (if available), EJB3's @EJB (if available), and JPA's + @PersistenceContext and @PersistenceUnit (if available). Alternatively, you may + choose to activate the individual BeanPostProcessors for those annotations. + + Note: This tag does not activate processing of Spring's @Transactional or EJB3's + @TransactionAttribute annotation. Consider the use of the <tx:annotation-driven> + tag for that purpose. + + See Javadoc for org.springframework.context.annotation.AnnotationConfigApplicationContext + for information on code-based alternatives to bootstrapping annotation-driven support. + from XML. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + + <xsd:element name="component-scan"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Scans the classpath for annotated components that will be auto-registered as + Spring beans. By default, the Spring-provided @Component, @Repository, + @Service, and @Controller stereotypes will be detected. + + Note: This tag implies the effects of the 'annotation-config' tag, activating @Required, + @Autowired, @PostConstruct, @PreDestroy, @Resource, @PersistenceContext and @PersistenceUnit + annotations in the component classes, which is usually desired for autodetected components + (without external configuration). Turn off the 'annotation-config' attribute to deactivate + this default behavior, for example in order to use custom BeanPostProcessor definitions + for handling those annotations. + + Note: You may use placeholders in package paths, but only resolved against system + properties (analogous to resource paths). A component scan results in new bean definition + being registered; Spring's PropertyPlaceholderConfigurer will apply to those bean + definitions just like to regular bean definitions, but it won't apply to the component + scan settings themselves. + + See Javadoc for org.springframework.context.annotation.ComponentScan for information + on code-based alternatives to bootstrapping component-scanning. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="include-filter" type="filterType" + minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls which eligible types to include for component scanning. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="exclude-filter" type="filterType" + minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls which eligible types to exclude for component scanning. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="base-package" type="xsd:string" + use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The comma-separated list of packages to scan for annotated components. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="resource-pattern" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls the class files eligible for component detection. Defaults to "**/*.class", the recommended value. + Consider use of the include-filter and exclude-filter elements for a more fine-grained approach. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="use-default-filters" type="xsd:boolean" + default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates whether automatic detection of classes annotated with @Component, @Repository, @Service, + or @Controller should be enabled. Default is "true". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="annotation-config" type="xsd:boolean" + default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates whether the implicit annotation post-processors should be enabled. Default is "true". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="name-generator" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The fully-qualified class name of the BeanNameGenerator to be used for naming detected components. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class" /> + <tool:assignable-to + type="org.springframework.beans.factory.support.BeanNameGenerator" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scope-resolver" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The fully-qualified class name of the ScopeMetadataResolver to be used for resolving the scope of + detected components. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class" /> + <tool:assignable-to + type="org.springframework.context.annotation.ScopeMetadataResolver" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scoped-proxy"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates whether proxies should be generated for detected components, which may be necessary + when using scopes in a proxy-style fashion. Default is to generate no such proxies. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="no" /> + <xsd:enumeration value="interfaces" /> + <xsd:enumeration value="targetClass" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="load-time-weaver"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Activates a Spring LoadTimeWeaver for this application context, available as + a bean with the name "loadTimeWeaver". Any bean that implements the + LoadTimeWeaverAware interface will then receive the LoadTimeWeaver reference + automatically; for example, Spring's JPA bootstrap support. + + The default weaver is determined automatically. As of Spring 2.5: detecting + Sun's GlassFish, Oracle's OC4J, Spring's VM agent and any ClassLoader + supported by Spring's ReflectiveLoadTimeWeaver (for example, the + TomcatInstrumentableClassLoader). + + The activation of AspectJ load-time weaving is specified via a simple flag + (the 'aspectj-weaving' attribute), with the AspectJ class transformer + registered through Spring's LoadTimeWeaver. AspectJ weaving will be activated + by default if a "META-INF/aop.xml" resource is present in the classpath. + + This also activates the current application context for applying dependency + injection to non-managed classes that are instantiated outside of the Spring + bean factory (typically classes annotated with the @Configurable annotation). + This will only happen if the AnnotationBeanConfigurerAspect is on the classpath + (i.e. spring-aspects.jar), effectively activating "spring-configured" by default. + + See Javadoc for org.springframework.context.annotation.EnableLoadTimeWeaving + for information on code-based alternatives to bootstrapping load-time weaving support. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports + type="org.springframework.instrument.classloading.LoadTimeWeaver" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="weaver-class" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The fully-qualified classname of the LoadTimeWeaver that is to be activated. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class" /> + <tool:assignable-to + type="org.springframework.instrument.classloading.LoadTimeWeaver" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="aspectj-weaving" default="autodetect"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="on"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Switches Spring-based AspectJ load-time weaving on. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + <xsd:enumeration value="off"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Switches Spring-based AspectJ load-time weaving off. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + <xsd:enumeration value="autodetect"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Switches AspectJ load-time weaving on if a "META-INF/aop.xml" resource + is present in the classpath. If there is no such resource, then AspectJ + load-time weaving will be switched off. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="spring-configured"> + <xsd:annotation> + <xsd:documentation + source="java:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect"> + <![CDATA[ + Signals the current application context to apply dependency injection + to non-managed classes that are instantiated outside of the Spring bean + factory (typically classes annotated with the @Configurable annotation). + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string" /> + </xsd:simpleType> + </xsd:element> + + <xsd:element name="mbean-export"> + <xsd:annotation> + <xsd:documentation + source="java:org.springframework.jmx.export.annotation.AnnotationMBeanExporter"><![CDATA[ + Activates default exporting of MBeans by detecting standard MBeans in the Spring + context as well as @ManagedResource annotations on Spring-defined beans. + + The resulting MBeanExporter bean is defined under the name "mbeanExporter". + Alternatively, consider defining a custom AnnotationMBeanExporter bean explicitly. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports + type="org.springframework.jmx.export.annotation.AnnotationMBeanExporter" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="default-domain" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The default domain to use when generating JMX ObjectNames. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="server" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The bean name of the MBeanServer to which MBeans should be exported. + Default is to use the platform's default MBeanServer (autodetecting + WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="registration"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The registration behavior, indicating how to deal with existing MBeans + of the same name: fail with an exception, ignore and keep the existing + MBean, or replace the existing one with the new MBean. + + Default is to fail with an exception. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="failOnExisting" /> + <xsd:enumeration value="ignoreExisting" /> + <xsd:enumeration value="replaceExisting" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="mbean-server"> + <xsd:annotation> + <xsd:documentation + source="java:org.springframework.jmx.support.MBeanServerFactoryBean"><![CDATA[ + Exposes a default MBeanServer for the current platform. + Autodetects WebLogic 9+, WebSphere 6.1+ and the JDK 1.5+ platform MBeanServer. + + The default bean name for the exposed MBeanServer is "mbeanServer". + This may be customized through specifying the "id" attribute. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="javax.management.MBeanServer" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:attribute name="agent-id" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The agent id of the target MBeanServer, if any. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="filterType"> + <xsd:attribute name="type" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls the type of filtering to apply to the expression. + + "annotation" indicates an annotation to be present at the type level in target components; + "assignable" indicates a class (or interface) that the target components are assignable to (extend/implement); + "aspectj" indicates an AspectJ type expression to be matched by the target components; + "regex" indicates a regex expression to be matched by the target components' class names; + "custom" indicates a custom implementation of the org.springframework.core.type.TypeFilter interface. + + Note: This attribute will not be inherited by child bean definitions. + Hence, it needs to be specified per concrete bean definition. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="annotation" /> + <xsd:enumeration value="assignable" /> + <xsd:enumeration value="aspectj" /> + <xsd:enumeration value="regex" /> + <xsd:enumeration value="custom" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="expression" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates the filter expression, the type of which is indicated by "type". + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-context/src/main/resources/org/springframework/ejb/config/spring-jee-3.2.xsd
@@ -0,0 +1,267 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/jee" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/jee" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines configuration elements for access to traditional Java EE components + such as JNDI resources and EJB session beans. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:element name="jndi-lookup"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.jndi.JndiObjectFactoryBean"><![CDATA[ + Exposes an object reference via a JNDI lookup. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="jndiLocatingType"> + <xsd:attribute name="cache" type="xsd:boolean" default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether the object returned from the JNDI lookup is cached + after the first lookup. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="expected-type" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The type that the located JNDI object is supposed to be assignable + to, if indeed any. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="lookup-on-startup" type="xsd:boolean" default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether the JNDI lookup is performed immediately on startup + (if true, the default), or on first access (if false). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="proxy-interface" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The proxy interface to use for the JNDI object. + + Needs to be specified because the actual JNDI object type is not + known in advance in case of a lazy lookup. + + Typically used in conjunction with "lookupOnStartup"=false and/or + "cache"=false. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-value" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specify a default literal value to fall back to if the JNDI lookup fails. + This is typically used for literal values in scenarios where the JNDI environment + might define specific config settings but those are not required to be present. + + Default is none. Note: This is only supported for lookup on startup. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="default-ref" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specify a default bean reference to fall back to if the JNDI lookup fails. + This might for example point to a local fallback DataSource. + + Default is none. Note: This is only supported for lookup on startup. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="local-slsb" type="ejbType"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean"><![CDATA[ + Exposes a reference to a local EJB Stateless SessionBean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + + <xsd:element name="remote-slsb"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean"><![CDATA[ + Exposes a reference to a remote EJB Stateless SessionBean. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="ejbType"> + <xsd:attribute name="home-interface" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The home interface that will be narrowed to before performing + the parameterless SLSB create() call that returns the actual + SLSB proxy. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="refresh-home-on-connect-failure" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether to refresh the EJB home on connect failure. + + Can be turned on to allow for hot restart of the EJB server. + If a cached EJB home throws an RMI exception that indicates a + remote connect failure, a fresh home will be fetched and the + invocation will be retried. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="cache-session-bean" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether to cache the actual session bean object. + + Off by default for standard EJB compliance. Turn this flag + on to optimize session bean access for servers that are + known to allow for caching the actual session bean object. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <!-- base types --> + <xsd:complexType name="jndiLocatingType" abstract="true"> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:sequence> + <xsd:element name="environment" minOccurs="0" maxOccurs="1"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The newline-separated, key-value pairs for the JNDI environment + (in standard Properties format, namely 'key=value' pairs) + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="environment-ref" type="environmentRefType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to JNDI environment properties, indicating the name of a + shared bean of type [java.util.Properties}. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="jndi-name" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The JNDI name to look up. This may be a fully-qualified JNDI path + or a local Java EE environment naming context path in which case the + prefix "java:comp/env/" will be prepended if applicable. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="resource-ref" type="xsd:boolean" default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether the lookup occurs in a Java EE container, i.e. if the + prefix "java:comp/env/" needs to be added if the JNDI name doesn't + already contain it. Default is "true" (since Spring 2.5). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="expose-access-context" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Set whether to expose the JNDI environment context for all access to the target + EJB, i.e. for all method invocations on the exposed object reference. + Default is "false", i.e. to only expose the JNDI context for object lookup. + + Switch this flag to "true" in order to expose the JNDI environment (including + the authorization context) for each EJB invocation, as needed by WebLogic + for EJBs with authorization requirements. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="lazy-init" default="default" type="beans:defaultable-boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicates whether or not this bean is to be lazily initialized. + If false, it will be instantiated on startup by bean factories + that perform eager initialization of singletons. The default is + "false". + + Note: This attribute will not be inherited by child bean definitions. + Hence, it needs to be specified per concrete bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="ejbType"> + <xsd:complexContent> + <xsd:extension base="jndiLocatingType"> + <xsd:attribute name="lookup-home-on-startup" type="xsd:boolean" default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether the lookup of the EJB home object is performed + immediately on startup (if true, the default), or on first access + (if false). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="cache-home" type="xsd:boolean" default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Controls whether the EJB home object is cached once it has been located. + On by default; turn this flag off to always reobtain fresh home objects. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="business-interface" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The business interface of the EJB being proxied. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:simpleType name="environmentRefType"> + <xsd:annotation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="java.util.Properties"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:union memberTypes="xsd:string"/> + </xsd:simpleType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.2.xsd
@@ -0,0 +1,250 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/task" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/task" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the elements used in the Spring Framework's support for task execution and scheduling. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:element name="annotation-driven"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Enables the detection of @Async and @Scheduled annotations on any Spring-managed + object. If present, a proxy will be generated for executing the annotated methods + asynchronously. + + See Javadoc for the org.springframework.scheduling.annotation.EnableAsync and + org.springframework.scheduling.annotation.EnableScheduling annotations for information + on code-based alternatives to this XML element. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="executor" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies the java.util.Executor instance to use when invoking asynchronous methods. + If not provided, an instance of org.springframework.core.task.SimpleAsyncTaskExecutor + will be used by default + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scheduler" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Specifies the org.springframework.scheduling.TaskScheduler or + java.util.ScheduledExecutorService instance to use when invoking scheduled + methods. If no reference is provided, a TaskScheduler backed by a single + thread scheduled executor will be used. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="scheduler"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines a ThreadPoolTaskScheduler instance with configurable pool size. See Javadoc + for the org.springframework.scheduling.annotation.EnableScheduling annotation for + information on a code-based alternative to this XML element. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="id" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The bean name for the generated ThreadPoolTaskScheduler instance. + It will also be used as the default thread name prefix. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="pool-size" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The size of the ScheduledExecutorService's thread pool. The default is 1. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="executor"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines a ThreadPoolTaskExecutor instance with configurable pool size, + queue-capacity, keep-alive, and rejection-policy values. + + See Javadoc for the org.springframework.scheduling.annotation.EnableAsync annotation + for information on code-based alternatives to this XML element. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="id" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The bean name for the generated ThreadPoolTaskExecutor instance. + This value will also be used as the thread name prefix which is why it is + required even when defining the executor as an inner bean: The executor + won't be directly accessible then but will nevertheless use the specified + id as the thread name prefix of the threads that it manages. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="pool-size" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The size of the executor's thread pool as either a single value or a range + (e.g. 5-10). If no bounded queue-capacity value is provided, then a max value + has no effect unless the range is specified as 0-n. In that case, the core pool + will have a size of n, but the 'allowCoreThreadTimeout' flag will be set to true. + If a queue-capacity is provided, then the lower bound of a range will map to the + core size and the upper bound will map to the max size. If this attribute is not + provided, the default core size will be 1, and the default max size will be + Integer.MAX_VALUE (i.e. unbounded). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="queue-capacity" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Queue capacity for the ThreadPoolTaskExecutor. If not specified, the default will + be Integer.MAX_VALUE (i.e. unbounded). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="keep-alive" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Keep-alive time in seconds. Inactive threads that have been created beyond the + core size will timeout after the specified number of seconds elapse. If the + executor has an unbounded queue capacity and a size range represented as 0-n, + then the core threads will also be configured to timeout when inactive. + Otherwise, core threads will not ever timeout. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="rejection-policy" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The RejectedExecutionHandler type. When a bounded queue cannot accept any + additional tasks, this determines the behavior. While the default is ABORT, + consider using CALLER_RUNS to throttle inbound tasks. In other words, by forcing + the caller to run the task itself, it will not be able to provide another task + until after it completes the task at hand. In the meantime, one or more tasks + may be removed from the queue. Alternatively, if it is not critical to run every + task, consider using DISCARD to drop the current task or DISCARD_OLDEST to drop + the task at the head of the queue. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="ABORT"/> + <xsd:enumeration value="CALLER_RUNS"/> + <xsd:enumeration value="DISCARD"/> + <xsd:enumeration value="DISCARD_OLDEST"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="scheduled-tasks"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Top-level element that contains one or more task sub-elements to be + managed by a given TaskScheduler. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="scheduled" type="scheduledTaskType" minOccurs="1" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="scheduler" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Reference to an instance of TaskScheduler to manage the provided tasks. If not specified, + the default value will be a wrapper for a single-threaded Executor. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.scheduling.TaskScheduler"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="scheduledTaskType"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Element defining a scheduled method-invoking task and its corresponding trigger. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="cron" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A cron-based trigger. See the org.springframework.scheduling.support.CronSequenceGenerator + JavaDoc for example patterns. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="fixed-delay" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + An interval-based trigger where the interval is measured from the completion time of the + previous task. The time unit value is measured in milliseconds. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="fixed-rate" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + An interval-based trigger where the interval is measured from the start time of the + previous task. The time unit value is measured in milliseconds. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="trigger" type="xsd:string" use="optional"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to a bean that implements the Trigger interface. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ref" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Reference to an object that provides a method to be invoked. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref" /> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="method" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the method to be invoked. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-method type-ref="@ref"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-context/src/main/resources/org/springframework/scripting/config/spring-lang-3.2.xsd
@@ -0,0 +1,233 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/lang" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/lang" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the elements used in the Spring Framework's dynamic language + support, which allows bean definitions that are backed by classes + written in a language other than Java. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:element name="defaults"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Default settings for any scripted beans registered within this context. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attributeGroup ref="defaultableAttributes"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="groovy"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A Spring bean backed by a Groovy class definition. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="customizableScriptType"> + <xsd:attributeGroup ref="defaultableAttributes"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="jruby"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A Spring bean backed by a JRuby class definition. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="dynamicScriptType"> + <xsd:attributeGroup ref="vanillaScriptAttributes"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="bsh"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A Spring bean backed by a BeanShell script. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="dynamicScriptType"> + <xsd:attributeGroup ref="vanillaScriptAttributes"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <!-- Script Types --> + <xsd:complexType name="simpleScriptType"> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:sequence> + <xsd:element name="inline-script" minOccurs="0" maxOccurs="1"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The source code for the dynamic language-backed bean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="property" type="beans:propertyType" minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Dynamic language-backed bean definitions can have zero or more properties. + Property elements correspond to JavaBean setter methods exposed + by the bean classes. Spring supports primitives, references to other + beans in the same or related factories, lists, maps and properties. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="script-source" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[ + The resource containing the script for the dynamic language-backed bean. + + Examples might be '/WEB-INF/scripts/Anais.groovy', 'classpath:Nin.bsh', etc. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of this scripted bean as an alias or replacement for the id. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="scope" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The scope of this scripted bean: typically "singleton" (one shared instance, + which will be returned by all calls to getBean with the given id), or + "prototype" (independent instance resulting from each call to getBean). + Default is "singleton". + + Singletons are most commonly used, and are ideal for multi-threaded + service objects. Further scopes, such as "request" or "session", might + be supported by extended bean factories (e.g. in a web environment). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="autowire" default="default"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The autowire mode for the scripted bean. + Analogous to the 'autowire' attribute on a standard bean definition. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="default"/> + <xsd:enumeration value="no"/> + <xsd:enumeration value="byName"/> + <xsd:enumeration value="byType"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="depends-on" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The names of the beans that this bean depends on being initialized. + The bean factory will guarantee that these beans get initialized + before this bean. + + Note that dependencies are normally expressed through bean properties. + This property should just be necessary other kinds of dependencies + like statics (*ugh*) or database preparation on startup. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="init-method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of an initialization method defined on the scripted bean. + Analogous to the 'init-method' attribute on a standard bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="destroy-method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of a destruction method defined on the scripted bean. + Analogous to the 'destroy-method' attribute on a standard bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="dynamicScriptType"> + <xsd:complexContent> + <xsd:extension base="simpleScriptType"> + <xsd:attribute name="script-interfaces"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class"><![CDATA[ + The Java interfaces that the dynamic language-backed object is to expose; comma-delimited. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="customizableScriptType"> + <xsd:complexContent> + <xsd:extension base="simpleScriptType"> + <xsd:attribute name="customizer-ref"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Reference to a GroovyObjectCustomizer or similar customizer bean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:attributeGroup name="vanillaScriptAttributes"> + <xsd:attribute name="refresh-check-delay" type="xsd:long"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The delay (in milliseconds) between checks for updated sources when + using the refreshable beans feature. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:attributeGroup> + + <xsd:attributeGroup name="defaultableAttributes"> + <xsd:attribute name="proxy-target-class" type="xsd:boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Flag to tell the bean factory that if this bean is proxied it should be done using the target class type, + not its interfaces. A refreshable script is normally proxied, so often this is useful in conjunction with + refresh-check-delay. Defaults to false requiring no additional library dependencies, but hiding behaviour in the + bean that is not defined in an interface. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attributeGroup ref="vanillaScriptAttributes"></xsd:attributeGroup> + </xsd:attributeGroup> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-jdbc/src/main/resources/org/springframework/jdbc/config/spring-jdbc-3.2.xsd
@@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xsd:schema xmlns="http://www.springframework.org/schema/jdbc" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/jdbc" + elementFormDefault="qualified" attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" + schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd" /> + <xsd:import namespace="http://www.springframework.org/schema/tool" + schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd" /> + + <xsd:element name="embedded-database"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean"><![CDATA[ + Creates an embedded database instance and makes it available to other beans as a javax.sql.DataSource. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="javax.sql.DataSource"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:sequence> + <xsd:element name="script" type="scriptType" minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A SQL script to execute during embedded database initialization. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="type" type="databaseType" default="HSQL"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The type of embedded database to create, such as HSQL, H2 or Derby. Defaults to HSQL. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="initialize-database"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.jdbc.datasource.init.DataSourceInitializer"><![CDATA[ + Initializes a database instance with SQL scripts provided in nested <script/> elements. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="script" type="scriptType" minOccurs="1" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A SQL script to execute during database initialization. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="data-source" type="xsd:string" default="dataSource"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to a data source that should be initialized. Defaults to "dataSource". + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"/> + <tool:expected-type type="javax.sql.DataSource"/> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="enabled" type="xsd:string" use="optional" default="true"> + <xsd:annotation> + <xsd:documentation> + Is this bean "enabled", meaning the scripts will be executed? + Defaults to true, but can be used to switch on and off the initialization depending on the environment. + </xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ignore-failures" use="optional" default="NONE"> + <xsd:annotation> + <xsd:documentation> + Should failed SQL statements be ignored during initialization? + </xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="NONE"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Do not ignore failures (the default) + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + <xsd:enumeration value="DROPS"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Ignore failed DROP statements + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + <xsd:enumeration value="ALL"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Ignore all failures + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="scriptType"> + <xsd:attribute name="location" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The resource location of an SQL script to execute. Can be a single script location or a pattern (e.g. classpath:/com/foo/sql/*-data.sql). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="encoding" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The encoding for SQL scripts, if different from the platform encoding. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="separator" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The statement separator in the script (the default is to use ';' if it is present in the script, or '\n' otherwise). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="execution"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Indicate the timing of the execution of this script. Use INIT to execute on startup (as a bean initialization) and DESTROY to execute on shutdown (as a bean destruction callback). + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="INIT"/> + <xsd:enumeration value="DESTROY"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + + <xsd:simpleType name="databaseType"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="HSQL"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Hyper SQL Java Database Engine + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + <xsd:enumeration value="H2"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + H2 Java Database Engine + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + <xsd:enumeration value="DERBY"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Derby Java Database Engine + ]]></xsd:documentation> + </xsd:annotation> + </xsd:enumeration> + </xsd:restriction> + </xsd:simpleType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-jms/src/main/resources/org/springframework/jms/config/spring-jms-3.2.xsd
@@ -0,0 +1,480 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/jms" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/jms" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the configuration elements for the Spring Framework's JMS support. + Allows for configuring JMS listener containers in XML 'shortcut' style. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:element name="listener-container"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Each listener child element will be hosted by a container whose configuration + is determined by this parent element. This variant builds standard JMS + listener containers, operating against a specified JMS ConnectionFactory. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.jms.listener.AbstractMessageListenerContainer"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="listener" type="listenerType" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="container-type" default="default"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The type of this listener container: "default" or "simple", choosing + between DefaultMessageListenerContainer and SimpleMessageListenerContainer. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="default"/> + <xsd:enumeration value="simple"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="container-class" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A custom listener container implementation class as fully qualified class name. + Default is Spring's standard DefaultMessageListenerContainer or + SimpleMessageListenerContainer, according to the "container-type" attribute. + Note that a custom container class will typically be a subclass of either of + those two Spring-provided standard container classes: Nake sure that the + "container-type" attribute matches the actual base type that the custom class + derives from ("default" will usually be fine anyway, since most custom classes + will derive from DefaultMessageListenerContainer). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:expected-type type="java.lang.Class"/> + <tool:assignable-to type="org.springframework.jms.listener.AbstractMessageListenerContainer"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="connection-factory" type="xsd:string" default="connectionFactory"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the JMS ConnectionFactory bean. + Default is "connectionFactory". + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="javax.jms.ConnectionFactory"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="task-executor" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to a Spring TaskExecutor (or standard JDK 1.5 Executor) for executing + JMS listener invokers. Default is a SimpleAsyncTaskExecutor in case of a + DefaultMessageListenerContainer, using internally managed threads. For a + SimpleMessageListenerContainer, listeners will always get invoked within the + JMS provider's receive thread by default. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="java.util.concurrent.Executor"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="destination-resolver" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the DestinationResolver strategy for resolving destination names. + Default is a DynamicDestinationResolver, using the JMS provider's queue/topic + name resolution. Alternatively, specify a reference to a JndiDestinationResolver + (typically in a J2EE environment). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.jms.support.destination.DestinationResolver"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="message-converter" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the MessageConverter strategy for converting JMS Messages to + listener method arguments. Default is a SimpleMessageConverter. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.jms.support.converter.MessageConverter"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="error-handler" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to an ErrorHandler strategy for handling any uncaught Exceptions + that may occur during the execution of the MessageListener. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.util.ErrorHandler"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="destination-type" default="queue"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The JMS destination type for this listener: "queue", "topic" or "durableTopic". + The default is "queue". + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="queue"/> + <xsd:enumeration value="topic"/> + <xsd:enumeration value="durableTopic"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="client-id" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The JMS client id for this listener container. + Needs to be specified when using durable subscriptions. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="cache" default="auto"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The cache level for JMS resources: "none", "connection", "session", "consumer" + or "auto". By default ("auto"), the cache level will effectively be "consumer", + unless an external transaction manager has been specified - in which case the + effective default will be "none" (assuming J2EE-style transaction management + where the given ConnectionFactory is an XA-aware pool). + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="none"/> + <xsd:enumeration value="connection"/> + <xsd:enumeration value="session"/> + <xsd:enumeration value="consumer"/> + <xsd:enumeration value="auto"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="acknowledge" default="auto"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The native JMS acknowledge mode: "auto", "client", "dups-ok" or "transacted". + A value of "transacted" effectively activates a locally transacted Session; + as alternative, specify an external "transaction-manager" via the corresponding + attribute. Default is "auto". + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="auto"/> + <xsd:enumeration value="client"/> + <xsd:enumeration value="dups-ok"/> + <xsd:enumeration value="transacted"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="transaction-manager" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to an external PlatformTransactionManager (typically an + XA-based transaction coordinator, e.g. Spring's JtaTransactionManager). + If not specified, native acknowledging will be used (see "acknowledge" attribute). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="concurrency" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The number of concurrent sessions/consumers to start for each listener. + Can either be a simple number indicating the maximum number (e.g. "5") + or a range indicating the lower as well as the upper limit (e.g. "3-5"). + Note that a specified minimum is just a hint and might be ignored at runtime. + Default is 1; keep concurrency limited to 1 in case of a topic listener + or if message ordering is important; consider raising it for general queues. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="prefetch" type="xsd:int"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The maximum number of messages to load into a single session. + Note that raising this number might lead to starvation of concurrent consumers! + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="receive-timeout" type="xsd:int"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The timeout to use for receive calls (in milliseconds). + The default is 1000 ms (1 sec); -1 indicates no timeout at all. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="phase" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The lifecycle phase within which this container should start and stop. The lower + the value the earlier this container will start and the later it will stop. The + default is Integer.MAX_VALUE meaning the container will start as late as possible + and stop as soon as possible. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="jca-listener-container"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Each listener child element will be hosted by a container whose configuration + is determined by this parent element. This variant builds standard JCA-based + listener containers, operating against a specified JCA ResourceAdapter + (which needs to be provided by the JMS message broker, e.g. ActiveMQ). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.jms.listener.endpoint.JmsMessageEndpointManager"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="listener" type="listenerType" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="resource-adapter" type="xsd:string" default="resourceAdapter"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the JCA ResourceAdapter bean for the JMS provider. + Default is "resourceAdapter". + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="javax.resource.spi.ResourceAdapter"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="activation-spec-factory" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the JmsActivationSpecFactory. + Default is to autodetect the JMS provider and its ActivationSpec class + (see DefaultJmsActivationSpecFactory). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.jms.listener.endpoint.JmsActivationSpecFactory"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="destination-resolver" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the DestinationResolver strategy for resolving destination names. + Default is to pass in the destination name Strings into the JCA ActivationSpec as-is. + Alternatively, specify a reference to a JndiDestinationResolver (typically in a J2EE + environment, in particular if the server insists on receiving Destination objects). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.jms.support.destination.DestinationResolver"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="message-converter" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the MessageConverter strategy for converting JMS Messages to + listener method arguments. Default is a SimpleMessageConverter. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.jms.support.converter.MessageConverter"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="destination-type" default="queue"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The JMS destination type for this listener: "queue", "topic" or "durableTopic". + Default is "queue". + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="queue"/> + <xsd:enumeration value="topic"/> + <xsd:enumeration value="durableTopic"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="client-id" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The JMS client id for this listener container. + Needs to be specified when using durable subscriptions. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="acknowledge" default="auto"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The native JMS acknowledge mode: "auto", "client", "dups-ok" or "transacted". + A value of "transacted" effectively activates a locally transacted Session; + as alternative, specify an external "transaction-manager" via the corresponding + attribute. Default is "auto". + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="auto"/> + <xsd:enumeration value="client"/> + <xsd:enumeration value="dups-ok"/> + <xsd:enumeration value="transacted"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="transaction-manager" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to the Spring JtaTransactionManager or [javax.transaction.TransactionManager], + for kicking off an XA transaction for each incoming message. + If not specified, native acknowledging will be used (see "acknowledge" attribute). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"/> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="concurrency" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The number of concurrent sessions/consumers to start for each listener. + Can either be a simple number indicating the maximum number (e.g. "5") + or a range indicating the lower as well as the upper limit (e.g. "3-5"). + Note that a specified minimum is just a hint and will typically be ignored + at runtime when using a JCA listener container. Default is 1. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="prefetch" type="xsd:int"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The maximum number of messages to load into a single session. + Note that raising this number might lead to starvation of concurrent consumers! + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="phase" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The lifecycle phase within which this container should start and stop. The lower + the value the earlier this container will start and the later it will stop. The + default is Integer.MAX_VALUE meaning the container will start as late as possible + and stop as soon as possible. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="listenerType"> + <xsd:attribute name="id" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The unique identifier for a listener. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="destination" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The destination name for this listener, resolved through the + container-wide DestinationResolver strategy (if any). Required. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="subscription" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name for the durable subscription, if any. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="selector" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The JMS message selector for this listener. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ref" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The bean name of the listener object, implementing + the MessageListener/SessionAwareMessageListener interface + or defining the specified listener method. Required. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"/> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="method" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the listener method to invoke. If not specified, + the target bean is supposed to implement the MessageListener + or SessionAwareMessageListener interface. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="response-destination" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the default response destination to send response messages to. + This will be applied in case of a request message that does not carry + a "JMSReplyTo" field. The type of this destination will be determined + by the listener-container's "destination-type" attribute. + Note: This only applies to a listener method with a return value, + for which each result object will be converted into a response message. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-oxm/src/main/resources/org/springframework/oxm/config/spring-oxm-3.2.xsd
@@ -0,0 +1,158 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<xsd:schema xmlns="http://www.springframework.org/schema/oxm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/oxm" elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:annotation> + <xsd:documentation> + Defines the elements used in Spring's Object/XML Mapping integration. + </xsd:documentation> + </xsd:annotation> + + <xsd:element name="jaxb2-marshaller"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.oxm.jaxb.Jaxb2Marshaller"> + Defines a JAXB2 Marshaller. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.oxm.jaxb.Jaxb2Marshaller"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:sequence> + <xsd:element name="class-to-be-bound" minOccurs="0" maxOccurs="unbounded"> + <xsd:complexType> + <xsd:attribute name="name" type="classType" use="required"/> + </xsd:complexType> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="contextPath" type="xsd:string"> + <xsd:annotation> + <xsd:documentation>The JAXB Context path</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="jibx-marshaller"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.oxm.jibx.JibxMarshaller"> + Defines a JiBX Marshaller. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.oxm.jibx.JibxMarshaller"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:attribute name="target-class" type="classType" use="required"/> + <xsd:attribute name="bindingName" type="xsd:string"> + <xsd:annotation> + <xsd:documentation>The binding name used by this marshaller.</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="xmlbeans-marshaller"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.oxm.xmlbeans.XmlBeansMarshaller"> + Defines a XMLBeans Marshaller. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.oxm.xmlbeans.XmlBeansMarshaller"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:attribute name="options" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:org.apache.xmlbeans.XmlOptions"> + The bean name of the XmlOptions that is to be used for this marshaller. Typically a + XmlOptionsFactoryBean definition. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.apache.xmlbeans.XmlOptions"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="castor-marshaller"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation + source="java:org.springframework.oxm.castor.CastorMarshaller"> + Defines a Castor Marshaller. + </xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.oxm.castor.CastorMarshaller" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:attribute name="encoding" type="xsd:string"> + <xsd:annotation> + <xsd:documentation>The encoding to use for stream reading.</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="target-class" type="classType"> + <xsd:annotation> + <xsd:documentation>The target class to be bound with Castor marshaller.</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="target-package" type="xsd:string"> + <xsd:annotation> + <xsd:documentation>The target package that contains Castor descriptor classes.</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="mapping-location" type="xsd:string"> + <xsd:annotation> + <xsd:documentation>The path to Castor mapping file.</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:simpleType name="classType"> + <xsd:annotation> + <xsd:documentation source="java:java.lang.Class">A class supported by a marshaller.</xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="direct"> + <tool:expected-type type="java.lang.Class"/> + <tool:assignable-to restriction="class-only" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:union memberTypes="xsd:string"/> + </xsd:simpleType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-tx/src/main/resources/org/springframework/transaction/config/spring-tx-3.2.xsd
@@ -0,0 +1,247 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<xsd:schema xmlns="http://www.springframework.org/schema/tx" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/tx" + elementFormDefault="qualified" + attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/> + + <xsd:annotation> + <xsd:documentation><![CDATA[ + Defines the elements used in the Spring Framework's declarative + transaction management infrastructure. + ]]></xsd:documentation> + </xsd:annotation> + + <xsd:element name="advice"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.transaction.interceptor.TransactionInterceptor"><![CDATA[ + Defines the transactional semantics of the AOP advice that is to be + executed. + + That is, this advice element is where the transactional semantics of + any number of methods are defined (where transactional semantics + includes the propagation settings, the isolation level, the rollback + rules, and suchlike). + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.transaction.interceptor.TransactionInterceptor"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="beans:identifiedType"> + <xsd:sequence> + <xsd:element name="attributes" type="attributesType" minOccurs="0" maxOccurs="1"/> + </xsd:sequence> + <xsd:attribute name="transaction-manager" type="xsd:string" default="transactionManager"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.transaction.PlatformTransactionManager"><![CDATA[ + The bean name of the PlatformTransactionManager that is to be used + to drive transactions. + + This attribute is not required, and only needs to be specified + explicitly if the bean name of the desired PlatformTransactionManager + is not 'transactionManager'. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="annotation-driven"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"><![CDATA[ + Indicates that transaction configuration is defined by Java 5 + annotations on bean classes, and that proxies are automatically + to be created for the relevant annotated beans. + + The default annotations supported are Spring's @Transactional + and EJB3's @TransactionAttribute (if available). + + Transaction semantics such as propagation settings, the isolation level, + the rollback rules, etc are all defined in the annotation metadata. + + See org.springframework.transaction.annotation.EnableTransactionManagement Javadoc + for information on code-based alternatives to this XML element. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="transaction-manager" type="xsd:string" default="transactionManager"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.transaction.PlatformTransactionManager"><![CDATA[ + The bean name of the PlatformTransactionManager that is to be used + to drive transactions. + + This attribute is not required, and only needs to be specified + explicitly if the bean name of the desired PlatformTransactionManager + is not 'transactionManager'. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="mode" default="proxy"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Should annotated beans be proxied using Spring's AOP framework, + or should they rather be weaved with an AspectJ transaction aspect? + + AspectJ weaving requires spring-aspects.jar on the classpath, + as well as load-time weaving (or compile-time weaving) enabled. + + Note: The weaving-based aspect requires the @Transactional annotation to be + defined on the concrete class. Annotations in interfaces will not work + in that case (they will rather only work with interface-based proxies)! + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="proxy"/> + <xsd:enumeration value="aspectj"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Are class-based (CGLIB) proxies to be created? By default, standard + Java interface-based proxies are created. + + Note: Class-based proxies require the @Transactional annotation to be + defined on the concrete class. Annotations in interfaces will not work + in that case (they will rather only work with interface-based proxies)! + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="order" type="xsd:int"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[ + Controls the ordering of the execution of the transaction advisor + when multiple advice executes at a specific joinpoint. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="jta-transaction-manager"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Creates a default JtaTransactionManager bean with name "transactionManager", + matching the default bean name expected by the "annotation-driven" tag. + Automatically detects WebLogic, WebSphere and OC4J: creating a WebLogicJtaTransactionManager, + WebSphereUowTransactionManager or OC4JJtaTransactionManager, respectively. + + For customization needs, consider defining a JtaTransactionManager bean as a regular + Spring bean definition with name "transactionManager", replacing this element. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation> + <tool:exports type="org.springframework.transaction.jta.JtaTransactionManager"/> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:element> + + <xsd:complexType name="attributesType"> + <xsd:sequence> + <xsd:element name="method" minOccurs="1" maxOccurs="unbounded"> + <xsd:complexType> + <xsd:attribute name="name" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The method name(s) with which the transaction attributes are to be + associated. The wildcard (*) character can be used to associate the + same transaction attribute settings with a number of methods; for + example, 'get*', 'handle*', '*Order', 'on*Event', etc. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="propagation" default="REQUIRED"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.transaction.annotation.Propagation"><![CDATA[ + The transaction propagation behavior. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="REQUIRED"/> + <xsd:enumeration value="SUPPORTS"/> + <xsd:enumeration value="MANDATORY"/> + <xsd:enumeration value="REQUIRES_NEW"/> + <xsd:enumeration value="NOT_SUPPORTED"/> + <xsd:enumeration value="NEVER"/> + <xsd:enumeration value="NESTED"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="isolation" default="DEFAULT"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.transaction.annotation.Isolation"><![CDATA[ + The transaction isolation level. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="DEFAULT"/> + <xsd:enumeration value="READ_UNCOMMITTED"/> + <xsd:enumeration value="READ_COMMITTED"/> + <xsd:enumeration value="REPEATABLE_READ"/> + <xsd:enumeration value="SERIALIZABLE"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="timeout" type="xsd:integer" default="-1"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The transaction timeout value (in seconds). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="read-only" type="xsd:boolean" default="false"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Is this transaction read-only? + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="rollback-for" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The Exception(s) that will trigger rollback; comma-delimited. + For example, 'com.foo.MyBusinessException,ServletException' + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="no-rollback-for" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The Exception(s) that will *not* trigger rollback; comma-delimited. + For example, 'com.foo.MyBusinessException,ServletException' + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + </xsd:sequence> + </xsd:complexType> + +</xsd:schema>
true
Other
spring-projects
spring-framework
180c5b2ef6c16f66145a4250b597a093e566d922.json
Introduce 3.2 versions of Spring XML namespaces Copy spring-*-3.1.xsd => spring-*-3.2.xsd; this commit introduces no substantive changes, but rather prepares for them by creating a clean baseline. All internal references to 3.1 schemas (e.g. spring-tool) have also been updated.
spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-3.2.xsd
@@ -0,0 +1,326 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xsd:schema xmlns="http://www.springframework.org/schema/mvc" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:tool="http://www.springframework.org/schema/tool" + targetNamespace="http://www.springframework.org/schema/mvc" + elementFormDefault="qualified" attributeFormDefault="unqualified"> + + <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd" /> + <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd" /> + + <xsd:element name="annotation-driven"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"><![CDATA[ + Configures the annotation-driven Spring MVC Controller programming model. + Note that, with Spring 3.0, this tag works in Servlet MVC only! + + See org.springframework.web.servlet.config.annotation.EnableWebMvc Javadoc for + information on code-based alternatives to enabling annotation-driven Spring MVC + support. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:all minOccurs="0"> + <xsd:element name="message-converters" minOccurs="0"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Configures one or more HttpMessageConverter types to use for converting @RequestBody method parameters and @ResponseBody method return values. + Using this configuration element is optional. + HttpMessageConverter registrations provided here will take precedence over HttpMessageConverter types registered by default. + Also see the register-defaults attribute if you want to turn off default registrations entirely. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="beans:bean" minOccurs="1" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The HttpMessageConverter bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="register-defaults" type="xsd:boolean" default="true"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Whether or not default HttpMessageConverter registrations should be added in addition to the ones provided within this element. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + <xsd:element name="argument-resolvers" minOccurs="0"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Configures HandlerMethodArgumentResolver types to support custom controller method argument types. + Using this option does not override the built-in support for resolving handler method arguments. + To customize the built-in support for argument resolution configure RequestMappingHandlerAdapter directly. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="beans:bean" minOccurs="1" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The HandlerMethodArgumentResolver (or WebArgumentResolver for backwards compatibility) bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="return-value-handlers" minOccurs="0"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Configures HandlerMethodReturnValueHandler types to support custom controller method return value handling. + Using this option does not override the built-in support for handling return values. + To customize the built-in support for handling return values configure RequestMappingHandlerAdapter directly. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="beans:bean" minOccurs="1" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The HandlerMethodReturnValueHandler bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:all> + <xsd:attribute name="conversion-service" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.core.convert.ConversionService"><![CDATA[ + The bean name of the ConversionService that is to be used for type conversion during field binding. + This attribute is not required, and only needs to be specified explicitly if custom converters need to be configured. + If not specified, a default FormattingConversionService is registered that contains converters to/from standard JDK types. + In addition, full support for date/time formatting will be installed if the Joda Time library is present on the classpath. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="java:org.springframework.core.convert.ConversionService" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="validator" type="xsd:string"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.validation.Validator"><![CDATA[ + The bean name of the Validator that is to be used to validate Controller model objects. + This attribute is not required, and only needs to be specified explicitly if a custom Validator needs to be configured. + If not specified, JSR-303 validation will be installed if a JSR-303 provider is present on the classpath. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="java:org.springframework.validation.Validator" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="message-codes-resolver" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The bean name of a MessageCodesResolver to use to build message codes from data binding and validation error codes. + This attribute is not required. + If not specified the DefaultMessageCodesResolver is used. + ]]></xsd:documentation> + <xsd:appinfo> + <tool:annotation kind="ref"> + <tool:expected-type type="java:org.springframework.validation.MessageCodesResolver" /> + </tool:annotation> + </xsd:appinfo> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="ignoreDefaultModelOnRedirect" type="xsd:boolean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + By default the content of the "default" model is used both during rendering and redirect scenarios. + Alternatively a controller method can declare a RedirectAttributes argument and use it to provide attributes for a redirect. + Setting this flag to true ensures the "default" model is never used in a redirect scenario even if a RedirectAttributes argument is not declared. + Setting it to false means the "default" model may be used in a redirect if the controller method doesn't declare a RedirectAttributes argument. + The default setting is false but new applications should consider setting it to true. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="resources"> + <xsd:annotation> + <xsd:documentation + source="java:org.springframework.web.servlet.resource.ResourceHttpRequestHandler"><![CDATA[ + Configures a handler for serving static resources such as images, js, and, css files with cache headers optimized for efficient + loading in a web browser. Allows resources to be served out of any path that is reachable via Spring's Resource handling. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="mapping" use="required" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The URL mapping pattern, within the current Servlet context, to use for serving resources from this handler, such as "/resources/**" + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="location" use="required" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The resource location from which to serve static content, specified at a Spring Resource pattern. + Each location must point to a valid directory. Multiple locations may be specified as a comma-separated list, + and the locations will be checked for a given resource in the order specified. For example, a value of + "/, classpath:/META-INF/public-web-resources/" will allow resources to be served both from the web app + root and from any JAR on the classpath that contains a /META-INF/public-web-resources/ directory, + with resources in the web app root taking precedence. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="cache-period" type="xsd:string"> + <xsd:annotation> + <xsd:documentation> + <![CDATA[ + Specifies the cache period for the resources served by this resource handler, in seconds. + The default is to not send any cache headers but rather to rely on last-modified timestamps only. + Set this to 0 in order to send cache headers that prevent caching, or to a positive number of + seconds in order to send cache headers with the given max-age value. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="order" type="xsd:int"> + <xsd:annotation> + <xsd:documentation> + <![CDATA[ + Specifies the order of the HandlerMapping for the resource handler. The default order is Ordered.LOWEST_PRECEDENCE - 1. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="default-servlet-handler"> + <xsd:annotation> + <xsd:documentation + source="java:org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler"><![CDATA[ + Configures a handler for serving static resources by forwarding to the Servlet container's default Servlet. Use of this + handler allows using a "/" mapping with the DispatcherServlet while still utilizing the Servlet container to serve static + resources. + This handler will forward all requests to the default Servlet. Therefore it is important that it remains last in the + order of all other URL HandlerMappings. That will be the case if you use the "annotation-driven" element or alternatively + if you are setting up your customized HandlerMapping instance be sure to set its "order" property to a value lower than + that of the DefaultServletHttpRequestHandler, which is Integer.MAX_VALUE. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="default-servlet-name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the default Servlet to forward to for static resource requests. The handler will try to auto-detect the container's + default Servlet at startup time using a list of known names. If the default Servlet cannot be detected because of using an unknown + container or because it has been manually configured, the servlet name must be set explicitly. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + + <xsd:element name="interceptors"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The ordered set of interceptors that intercept HTTP Servlet Requests handled by Controllers. + Interceptors allow requests to be pre/post processed before/after handling. + Each inteceptor must implement the org.springframework.web.servlet.HandlerInterceptor or + org.springframework.web.context.request.WebRequestInterceptor interface. + The interceptors in this set are automatically configured on each registered HandlerMapping. + The URI paths each interceptor applies to are configurable. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:choice> + <xsd:element ref="beans:bean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Registers an interceptor that intercepts every request regardless of its URI path.. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element ref="beans:ref"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + Registers an interceptor that intercepts every request regardless of its URI path.. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:choice> + <xsd:element name="interceptor"> + <xsd:annotation> + <xsd:documentation source="java:org.springframework.web.servlet.handler.MappedInterceptor"><![CDATA[ + Registers an interceptor that interceptors requests sent to one or more URI paths. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="mapping" maxOccurs="unbounded"> + <xsd:complexType> + <xsd:attribute name="path" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A path into the application intercepted by this interceptor. + Exact path mapping URIs (such as "/myPath") are supported as well as Ant-stype path patterns (such as /myPath/**). + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + <xsd:choice> + <xsd:element ref="beans:bean"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The interceptor's bean definition. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element ref="beans:ref"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + A reference to an interceptor bean. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:choice> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + + <xsd:element name="view-controller"> + <xsd:annotation> + <xsd:documentation + source="java:org.springframework.web.servlet.mvc.ParameterizableViewController"><![CDATA[ + Defines a simple Controller that selects a view to render the response. + ]]></xsd:documentation> + </xsd:annotation> + <xsd:complexType> + <xsd:attribute name="path" type="xsd:string" use="required"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The URL path the view is mapped to. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="view-name" type="xsd:string"> + <xsd:annotation> + <xsd:documentation><![CDATA[ + The name of the view to render. Optional. + If not specified, the view name will be determined from the current HttpServletRequest + by the DispatcherServlet's RequestToViewNameTranslator. + ]]></xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + +</xsd:schema>
true
Other
spring-projects
spring-framework
e3f544904c3cce5b6e9947c6429708a4b3bc4ef8.json
Fix warnings in LocalSessionFactoryBean
spring-orm/src/main/java/org/springframework/orm/hibernate3/LocalSessionFactoryBean.java
@@ -26,14 +26,14 @@ import java.util.Enumeration; import java.util.Map; import java.util.Properties; + import javax.sql.DataSource; import javax.transaction.TransactionManager; import org.hibernate.HibernateException; import org.hibernate.Interceptor; import org.hibernate.Session; import org.hibernate.SessionFactory; -import org.hibernate.cache.CacheProvider; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.cfg.NamingStrategy; @@ -43,7 +43,6 @@ import org.hibernate.event.EventListeners; import org.hibernate.tool.hbm2ddl.DatabaseMetadata; import org.hibernate.transaction.JTATransactionFactory; - import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.core.io.ClassPathResource; @@ -115,8 +114,9 @@ public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implemen private static final ThreadLocal<Object> configTimeRegionFactoryHolder = new ThreadLocal<Object>(); - private static final ThreadLocal<CacheProvider> configTimeCacheProviderHolder = - new ThreadLocal<CacheProvider>(); + @SuppressWarnings("deprecation") + private static final ThreadLocal<org.hibernate.cache.CacheProvider> configTimeCacheProviderHolder = + new ThreadLocal<org.hibernate.cache.CacheProvider>(); private static final ThreadLocal<LobHandler> configTimeLobHandlerHolder = new ThreadLocal<LobHandler>(); @@ -167,7 +167,8 @@ static Object getConfigTimeRegionFactory() { * during configuration. * @see #setCacheProvider */ - public static CacheProvider getConfigTimeCacheProvider() { + @SuppressWarnings("deprecation") + public static org.hibernate.cache.CacheProvider getConfigTimeCacheProvider() { return configTimeCacheProviderHolder.get(); } @@ -207,7 +208,8 @@ public static LobHandler getConfigTimeLobHandler() { private Object cacheRegionFactory; - private CacheProvider cacheProvider; + @SuppressWarnings("deprecation") + private org.hibernate.cache.CacheProvider cacheProvider; private LobHandler lobHandler; @@ -401,7 +403,7 @@ public void setCacheRegionFactory(Object cacheRegionFactory) { * @see #setCacheRegionFactory */ @Deprecated - public void setCacheProvider(CacheProvider cacheProvider) { + public void setCacheProvider(org.hibernate.cache.CacheProvider cacheProvider) { this.cacheProvider = cacheProvider; } @@ -650,7 +652,7 @@ protected SessionFactory buildSessionFactory() throws Exception { } if (dataSource != null) { - Class providerClass = LocalDataSourceConnectionProvider.class; + Class<?> providerClass = LocalDataSourceConnectionProvider.class; if (isUseTransactionAwareDataSource() || dataSource instanceof TransactionAwareDataSourceProxy) { providerClass = TransactionAwareDataSourceConnectionProvider.class; } @@ -719,7 +721,7 @@ else if (this.cacheProvider != null) { if (this.entityCacheStrategies != null) { // Register cache strategies for mapped entities. - for (Enumeration classNames = this.entityCacheStrategies.propertyNames(); classNames.hasMoreElements();) { + for (Enumeration<?> classNames = this.entityCacheStrategies.propertyNames(); classNames.hasMoreElements();) { String className = (String) classNames.nextElement(); String[] strategyAndRegion = StringUtils.commaDelimitedListToStringArray(this.entityCacheStrategies.getProperty(className)); @@ -739,7 +741,7 @@ else if (strategyAndRegion.length > 0) { if (this.collectionCacheStrategies != null) { // Register cache strategies for mapped collections. - for (Enumeration collRoles = this.collectionCacheStrategies.propertyNames(); collRoles.hasMoreElements();) { + for (Enumeration<?> collRoles = this.collectionCacheStrategies.propertyNames(); collRoles.hasMoreElements();) { String collRole = (String) collRoles.nextElement(); String[] strategyAndRegion = StringUtils.commaDelimitedListToStringArray(this.collectionCacheStrategies.getProperty(collRole)); @@ -938,6 +940,7 @@ public void updateDatabaseSchema() throws DataAccessException { hibernateTemplate.execute( new HibernateCallback<Object>() { public Object doInHibernate(Session session) throws HibernateException, SQLException { + @SuppressWarnings("deprecation") Connection con = session.connection(); DatabaseMetadata metadata = new DatabaseMetadata(con, dialect); String[] sql = getConfiguration().generateSchemaUpdateScript(dialect, metadata); @@ -982,6 +985,7 @@ public void validateDatabaseSchema() throws DataAccessException { hibernateTemplate.execute( new HibernateCallback<Object>() { public Object doInHibernate(Session session) throws HibernateException, SQLException { + @SuppressWarnings("deprecation") Connection con = session.connection(); DatabaseMetadata metadata = new DatabaseMetadata(con, dialect, false); getConfiguration().validateSchema(dialect, metadata); @@ -1018,6 +1022,7 @@ public void dropDatabaseSchema() throws DataAccessException { hibernateTemplate.execute( new HibernateCallback<Object>() { public Object doInHibernate(Session session) throws HibernateException, SQLException { + @SuppressWarnings("deprecation") Connection con = session.connection(); String[] sql = getConfiguration().generateDropSchemaScript(dialect); executeSchemaScript(con, sql); @@ -1054,6 +1059,7 @@ public void createDatabaseSchema() throws DataAccessException { hibernateTemplate.execute( new HibernateCallback<Object>() { public Object doInHibernate(Session session) throws HibernateException, SQLException { + @SuppressWarnings("deprecation") Connection con = session.connection(); String[] sql = getConfiguration().generateSchemaCreationScript(dialect); executeSchemaScript(con, sql);
false
Other
spring-projects
spring-framework
352ed517c5fd74f3549a36050c325b8a3fc00f28.json
Fix typo in @ComponentScan Javadoc With thanks to @abdull for pull request #55
spring-context/src/main/java/org/springframework/context/annotation/ComponentScan.java
@@ -132,7 +132,7 @@ /** * Declares the type filter to be used as an {@linkplain ComponentScan#includeFilters() - * include filter} or {@linkplain ComponentScan#includeFilters() exclude filter}. + * include filter} or {@linkplain ComponentScan#excludeFilters() exclude filter}. */ @Retention(RetentionPolicy.RUNTIME) @Target({})
false
Other
spring-projects
spring-framework
f3ff98d86275e19e6828f9c3a0c432de0587bbbe.json
Allow nulls with multiple embedded value resolvers Allow an embedded value resolver added to an AbstractBeanFactory to return null without adversely effecting any subsequent resolvers. Issue: SPR-8565
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
@@ -746,7 +746,7 @@ public void addEmbeddedValueResolver(StringValueResolver valueResolver) { public String resolveEmbeddedValue(String value) { String result = value; for (StringValueResolver resolver : this.embeddedValueResolvers) { - result = resolver.resolveStringValue(result); + result = (result == null ? null : resolver.resolveStringValue(result)); } return result; }
true
Other
spring-projects
spring-framework
f3ff98d86275e19e6828f9c3a0c432de0587bbbe.json
Allow nulls with multiple embedded value resolvers Allow an embedded value resolver added to an AbstractBeanFactory to return null without adversely effecting any subsequent resolvers. Issue: SPR-8565
spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
@@ -28,6 +28,11 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.isNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; import java.io.Closeable; import java.lang.reflect.Field; @@ -97,6 +102,7 @@ import org.springframework.tests.sample.beans.TestBean; import org.springframework.tests.sample.beans.factory.DummyFactory; import org.springframework.util.StopWatch; +import org.springframework.util.StringValueResolver; /** * Tests properties population and autowire behavior. @@ -2261,6 +2267,26 @@ public void testContainsBeanReturnsTrueEvenForAbstractBeanDefinition() { assertThat(bf.containsBean("bogus"), is(false)); } + @Test + public void resolveEmbeddedValue() throws Exception { + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + StringValueResolver r1 = mock(StringValueResolver.class); + StringValueResolver r2 = mock(StringValueResolver.class); + StringValueResolver r3 = mock(StringValueResolver.class); + bf.addEmbeddedValueResolver(r1); + bf.addEmbeddedValueResolver(r2); + bf.addEmbeddedValueResolver(r3); + given(r1.resolveStringValue("A")).willReturn("B"); + given(r2.resolveStringValue("B")).willReturn(null); + given(r3.resolveStringValue(isNull(String.class))).willThrow(new IllegalArgumentException()); + + bf.resolveEmbeddedValue("A"); + + verify(r1).resolveStringValue("A"); + verify(r2).resolveStringValue("B"); + verify(r3, never()).resolveStringValue(isNull(String.class)); + } + static class A { } static class B { }
true
Other
spring-projects
spring-framework
e4f1f682e2a7eb8e7589f1281d96132453d01523.json
Update distribution README regarding paths - Corrected path to 'docs/spring-framework-reference' - Minor formatting changes
src/dist/readme.txt
@@ -1,12 +1,11 @@ Spring Framework version ${version} -=============================================================================== +================================================================================ -To find out what has changed since any earlier releases, see -'docs/changelog.txt'. +To find out what has changed since any earlier releases, see 'docs/changelog.txt'. -Please consult the documentation located within the 'docs/reference' directory -of this release and also visit the official Spring Framework home at -http://www.springsource.org/spring-framework +Please consult the documentation located within the +'docs/spring-framework-reference' directory of this release and also visit +the official Spring Framework home at http://www.springsource.org/spring-framework There you will find links to the forum, issue tracker, and other resources.
false
Other
spring-projects
spring-framework
3b8aba9ccd0ca0a437a9425471644b1d01a99795.json
Fix typo in ContextLifecycleScheduledTaskRegistrar
spring-context/src/main/java/org/springframework/scheduling/config/ContextLifecycleScheduledTaskRegistrar.java
@@ -22,9 +22,9 @@ import org.springframework.context.event.ContextRefreshedEvent; /** - * {@link ScheduledTaskRegistrar} subclass that redirect the actual scheduling + * {@link ScheduledTaskRegistrar} subclass that redirects the actual scheduling * of tasks to the {@link ContextRefreshedEvent} callback. Falls back to regular - * {@link ScheduledTaskRegistrar} behavior when not running within an ApplicationContext. + * {@code ScheduledTaskRegistrar} behavior when not running within an ApplicationContext. * * @author Juergen Hoeller * @since 3.2.1
false
Other
spring-projects
spring-framework
7e74fd2b7fb30e6206d40bb7235d82433682386a.json
Consider primary attribute with getBean(Class) Update DefaultListableBeanFactory.getBean(Class<?> beanClass) to consider the 'primary' attribute of bean definitions. This makes getBean() behave in the same way as autowiring. Issue: SPR-7854
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
@@ -90,6 +90,7 @@ * @author Sam Brannen * @author Costin Leau * @author Chris Beams + * @author Phillip Webb * @since 16 April 2001 * @see StaticListableBeanFactory * @see PropertiesBeanDefinitionReader @@ -272,6 +273,20 @@ public <T> T getBean(Class<T> requiredType) throws BeansException { return getBean(beanNames[0], requiredType); } else if (beanNames.length > 1) { + T primaryBean = null; + for (String beanName : beanNames) { + T beanInstance = getBean(beanName, requiredType); + if (isPrimary(beanName, beanInstance)) { + if(primaryBean != null) { + throw new NoUniqueBeanDefinitionException(requiredType, beanNames.length, + "more than one 'primary' bean found of required type: " + Arrays.asList(beanNames)); + } + primaryBean = beanInstance; + } + } + if(primaryBean != null) { + return primaryBean; + } throw new NoUniqueBeanDefinitionException(requiredType, beanNames); } else if (getParentBeanFactory() != null) {
true
Other
spring-projects
spring-framework
7e74fd2b7fb30e6206d40bb7235d82433682386a.json
Consider primary attribute with getBean(Class) Update DefaultListableBeanFactory.getBean(Class<?> beanClass) to consider the 'primary' attribute of bean definitions. This makes getBean() behave in the same way as autowiring. Issue: SPR-7854
spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
@@ -17,6 +17,8 @@ package org.springframework.beans.factory; import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -49,7 +51,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; import org.springframework.beans.BeansException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.NotWritablePropertyException; @@ -102,11 +106,14 @@ * @author Rick Evans * @author Sam Brannen * @author Chris Beams + * @author Phillip Webb */ public class DefaultListableBeanFactoryTests { private static final Log factoryLog = LogFactory.getLog(DefaultListableBeanFactory.class); + @Rule + public ExpectedException thrown = ExpectedException.none(); @Test public void testUnreferencedSingletonWasInstantiated() { @@ -1285,6 +1292,32 @@ public void testGetBeanByTypeWithAmbiguity() { lbf.getBean(TestBean.class); } + @Test + public void testGetBeanByTypeWithPrimary() throws Exception { + DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); + RootBeanDefinition bd1 = new RootBeanDefinition(TestBean.class); + RootBeanDefinition bd2 = new RootBeanDefinition(TestBean.class); + bd2.setPrimary(true); + lbf.registerBeanDefinition("bd1", bd1); + lbf.registerBeanDefinition("bd2", bd2); + TestBean bean = lbf.getBean(TestBean.class); + assertThat(bean.getBeanName(), equalTo("bd2")); + } + + @Test + public void testGetBeanByTypeWithMultiplePrimary() throws Exception { + DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); + RootBeanDefinition bd1 = new RootBeanDefinition(TestBean.class); + bd1.setPrimary(true); + RootBeanDefinition bd2 = new RootBeanDefinition(TestBean.class); + bd2.setPrimary(true); + lbf.registerBeanDefinition("bd1", bd1); + lbf.registerBeanDefinition("bd2", bd2); + thrown.expect(NoUniqueBeanDefinitionException.class); + thrown.expectMessage(containsString("more than one 'primary'")); + lbf.getBean(TestBean.class); + } + @Test public void testGetBeanByTypeFiltersOutNonAutowireCandidates() { DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
true
Other
spring-projects
spring-framework
3c09b07652ed3c7a2e4cee1295a450aee387f99b.json
Raise exception on missing request parameters Issue: SPR-10193
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMapping.java
@@ -28,15 +28,19 @@ import javax.servlet.http.HttpServletRequest; import org.springframework.http.MediaType; +import org.springframework.util.CollectionUtils; import org.springframework.util.MultiValueMap; import org.springframework.util.StringUtils; import org.springframework.web.HttpMediaTypeNotAcceptableException; import org.springframework.web.HttpMediaTypeNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.UnsatisfiedServletRequestParameterException; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.servlet.handler.AbstractHandlerMethodMapping; +import org.springframework.web.servlet.mvc.condition.NameValueExpression; +import org.springframework.web.servlet.mvc.condition.ParamsRequestCondition; import org.springframework.web.util.WebUtils; /** @@ -185,14 +189,17 @@ else if (patternAndMethodMatches.isEmpty() && !allowedMethods.isEmpty()) { Set<MediaType> consumableMediaTypes; Set<MediaType> producibleMediaTypes; + Set<String> paramConditions; if (patternAndMethodMatches.isEmpty()) { consumableMediaTypes = getConsumableMediaTypes(request, patternMatches); producibleMediaTypes = getProdicubleMediaTypes(request, patternMatches); + paramConditions = getRequestParams(request, patternMatches); } else { consumableMediaTypes = getConsumableMediaTypes(request, patternAndMethodMatches); producibleMediaTypes = getProdicubleMediaTypes(request, patternAndMethodMatches); + paramConditions = getRequestParams(request, patternAndMethodMatches); } if (!consumableMediaTypes.isEmpty()) { @@ -205,6 +212,10 @@ else if (patternAndMethodMatches.isEmpty() && !allowedMethods.isEmpty()) { else if (!producibleMediaTypes.isEmpty()) { throw new HttpMediaTypeNotAcceptableException(new ArrayList<MediaType>(producibleMediaTypes)); } + else if (!CollectionUtils.isEmpty(paramConditions)) { + String[] params = paramConditions.toArray(new String[paramConditions.size()]); + throw new UnsatisfiedServletRequestParameterException(params, request.getParameterMap()); + } else { return null; } @@ -230,4 +241,18 @@ private Set<MediaType> getProdicubleMediaTypes(HttpServletRequest request, Set<R return result; } + private Set<String> getRequestParams(HttpServletRequest request, Set<RequestMappingInfo> partialMatches) { + for (RequestMappingInfo partialMatch : partialMatches) { + ParamsRequestCondition condition = partialMatch.getParamsCondition(); + if (!CollectionUtils.isEmpty(condition.getExpressions()) && (condition.getMatchingCondition(request) == null)) { + Set<String> expressions = new HashSet<String>(); + for (NameValueExpression expr : condition.getExpressions()) { + expressions.add(expr.toString()); + } + return expressions; + } + } + return null; + } + }
true
Other
spring-projects
spring-framework
3c09b07652ed3c7a2e4cee1295a450aee387f99b.json
Raise exception on missing request parameters Issue: SPR-10193
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java
@@ -42,6 +42,7 @@ import org.springframework.web.HttpMediaTypeNotAcceptableException; import org.springframework.web.HttpMediaTypeNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.UnsatisfiedServletRequestParameterException; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -202,6 +203,19 @@ private void testMediaTypeNotAccepted(String url) throws Exception { } } + @Test + public void testUnsatisfiedServletRequestParameterException() throws Exception { + try { + MockHttpServletRequest request = new MockHttpServletRequest("GET", "/params"); + this.handlerMapping.getHandler(request); + fail("UnsatisfiedServletRequestParameterException expected"); + } + catch (UnsatisfiedServletRequestParameterException ex) { + assertArrayEquals("Invalid request parameter conditions", + new String[] { "foo=bar" }, ex.getParamConditions()); + } + } + @Test public void uriTemplateVariables() { PatternsRequestCondition patterns = new PatternsRequestCondition("/{path1}/{path2}"); @@ -414,6 +428,11 @@ public String produces() { return ""; } + @RequestMapping(value = "/params", params="foo=bar") + public String param() { + return ""; + } + @RequestMapping(value = "/content", produces="application/xml") public String xmlContent() { return "";
true
Other
spring-projects
spring-framework
692ced8046f40facaa15fe9ad5a8d2cf56852794.json
Fix typo in reference docs Issue: SPR-10204
src/reference/docbook/mvc.xml
@@ -5110,7 +5110,7 @@ public class WebConfig extends WebMvcConfigurerAdapter { @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { - configurer.setFavorPathExtension(false).setFavorParameter(true); + configurer.favorPathExtension(false).favorParameter(true); } }</programlisting>
false
Other
spring-projects
spring-framework
d3f4528905b2c6277d1b169f8570591418c57350.json
Remove additional xsd versions from reference docs A few versioned xsd references still existed in xsd-configuration.xml; this commit removes them, completing the work for SPR-10010 Issue: SPR-10010
src/reference/docbook/xsd-configuration.xml
@@ -679,7 +679,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem covered in the chapter entitled <xref linkend="transaction"/>.</para> <tip> <para>You are strongly encouraged to look at the - <filename>'spring-tx-3.0.xsd'</filename> file that ships with the Spring + <filename>'spring-tx.xsd'</filename> file that ships with the Spring distribution. This file is (of course), the XML Schema for Spring's transaction configuration, and covers all of the various tags in the <literal>tx</literal> namespace, including attribute defaults and @@ -812,7 +812,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem Spring as they are currently undergoing review. If you are a third party tool vendor and you would like to contribute to this review process, then do mail the Spring mailing list. The currently supported <literal>tool</literal> - tags can be found in the file <literal>'spring-tool-3.0.xsd'</literal> in the + tags can be found in the file <literal>'spring-tool.xsd'</literal> in the <literal>'src/org/springframework/beans/factory/xml'</literal> directory of the Spring source distribution.</para> </section> @@ -931,8 +931,8 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd -http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> +http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd +http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> </beans>]]></programlisting> <para> @@ -1053,8 +1053,8 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> </beans>]]></programlisting> <para> @@ -1138,7 +1138,7 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema relevant XSD file. As can be seen in the following screenshot, the <literal>'http://www.springframework.org/schema/util'</literal> namespace is being associated with the file resource - <literal>'C:\bench\spring\src\org\springframework\beans\factory\xml\spring-util-3.0.xsd'</literal>.</para> + <literal>'C:\bench\spring\src\org\springframework\beans\factory\xml\spring-util.xsd'</literal>.</para> <para> <mediaobject> <imageobject role="fo">
false
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-web/src/main/java/org/springframework/web/context/ConfigurableWebApplicationContext.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -71,11 +71,6 @@ public interface ConfigurableWebApplicationContext extends WebApplicationContext */ ServletConfig getServletConfig(); - /** - * Return the {@link ConfigurableWebEnvironment} used by this web application context. - */ - ConfigurableWebEnvironment getEnvironment(); - /** * Set the namespace for this web application context, * to be used for building a default context config location.
true
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-web/src/main/java/org/springframework/web/context/ContextLoader.java
@@ -38,6 +38,7 @@ import org.springframework.context.access.ContextSingletonBeanFactoryLocator; import org.springframework.core.GenericTypeResolver; import org.springframework.core.annotation.AnnotationAwareOrderComparator; +import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.support.PropertiesLoaderUtils; import org.springframework.util.Assert; @@ -490,7 +491,10 @@ protected void customizeContext(ServletContext servletContext, ConfigurableWebAp initializerInstances.add(BeanUtils.instantiateClass(initializerClass)); } - applicationContext.getEnvironment().initPropertySources(servletContext, null); + ConfigurableEnvironment env = applicationContext.getEnvironment(); + if (env instanceof ConfigurableWebEnvironment) { + ((ConfigurableWebEnvironment)env).initPropertySources(servletContext, null); + } Collections.sort(initializerInstances, new AnnotationAwareOrderComparator()); for (ApplicationContextInitializer<ConfigurableApplicationContext> initializer : initializerInstances) {
true
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-web/src/main/java/org/springframework/web/context/support/AbstractRefreshableWebApplicationContext.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,7 +27,6 @@ import org.springframework.ui.context.Theme; import org.springframework.ui.context.ThemeSource; import org.springframework.ui.context.support.UiApplicationContextUtils; -import org.springframework.util.Assert; import org.springframework.web.context.ConfigurableWebApplicationContext; import org.springframework.web.context.ConfigurableWebEnvironment; import org.springframework.web.context.ServletConfigAware; @@ -157,15 +156,6 @@ protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); } - @Override - public ConfigurableWebEnvironment getEnvironment() { - ConfigurableEnvironment env = super.getEnvironment(); - Assert.isInstanceOf(ConfigurableWebEnvironment.class, env, - "ConfigurableWebApplicationContext environment must be of type " + - "ConfigurableWebEnvironment"); - return (ConfigurableWebEnvironment) env; - } - /** * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc. */ @@ -212,7 +202,11 @@ protected void onRefresh() { @Override protected void initPropertySources() { super.initPropertySources(); - this.getEnvironment().initPropertySources(this.servletContext, this.servletConfig); + ConfigurableEnvironment env = this.getEnvironment(); + if (env instanceof ConfigurableWebEnvironment) { + ((ConfigurableWebEnvironment)env).initPropertySources( + this.servletContext, this.servletConfig); + } } public Theme getTheme(String themeName) {
true
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-web/src/main/java/org/springframework/web/context/support/GenericWebApplicationContext.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -147,15 +147,6 @@ protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); } - @Override - public ConfigurableWebEnvironment getEnvironment() { - ConfigurableEnvironment env = super.getEnvironment(); - Assert.isInstanceOf(ConfigurableWebEnvironment.class, env, - "ConfigurableWebApplicationContext environment must be of type " + - "ConfigurableWebEnvironment"); - return (ConfigurableWebEnvironment) env; - } - /** * Register ServletContextAwareProcessor. * @see ServletContextAwareProcessor @@ -202,7 +193,11 @@ protected void onRefresh() { @Override protected void initPropertySources() { super.initPropertySources(); - this.getEnvironment().initPropertySources(this.servletContext, null); + ConfigurableEnvironment env = this.getEnvironment(); + if (env instanceof ConfigurableWebEnvironment) { + ((ConfigurableWebEnvironment)env).initPropertySources( + this.servletContext, null); + } } public Theme getTheme(String themeName) {
true
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-web/src/main/java/org/springframework/web/context/support/StaticWebApplicationContext.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,9 +27,7 @@ import org.springframework.ui.context.Theme; import org.springframework.ui.context.ThemeSource; import org.springframework.ui.context.support.UiApplicationContextUtils; -import org.springframework.util.Assert; import org.springframework.web.context.ConfigurableWebApplicationContext; -import org.springframework.web.context.ConfigurableWebEnvironment; import org.springframework.web.context.ServletConfigAware; import org.springframework.web.context.ServletContextAware; @@ -169,15 +167,6 @@ protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); } - @Override - public ConfigurableWebEnvironment getEnvironment() { - ConfigurableEnvironment env = super.getEnvironment(); - Assert.isInstanceOf(ConfigurableWebEnvironment.class, env, - "ConfigurableWebApplication environment must be of type " + - "ConfigurableWebEnvironment"); - return (ConfigurableWebEnvironment) env; - } - /** * Initialize the theme capability. */
true
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -39,11 +39,13 @@ import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.SimpleLocaleContext; import org.springframework.core.annotation.AnnotationAwareOrderComparator; +import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.util.ClassUtils; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.context.ConfigurableWebApplicationContext; +import org.springframework.web.context.ConfigurableWebEnvironment; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.RequestAttributes; @@ -638,7 +640,10 @@ protected void configureAndRefreshWebApplicationContext(ConfigurableWebApplicati // the context is refreshed; do it eagerly here to ensure servlet property sources // are in place for use in any post-processing or initialization that occurs // below prior to #refresh - wac.getEnvironment().initPropertySources(getServletContext(), getServletConfig()); + ConfigurableEnvironment env = wac.getEnvironment(); + if (env instanceof ConfigurableWebEnvironment) { + ((ConfigurableWebEnvironment)env).initPropertySources(getServletContext(), getServletConfig()); + } postProcessWebApplicationContext(wac);
true
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-webmvc/src/main/java/org/springframework/web/servlet/HttpServletBean.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,24 +27,23 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeansException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyAccessorFactory; import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValues; import org.springframework.context.EnvironmentAware; +import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Environment; import org.springframework.core.env.EnvironmentCapable; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceEditor; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; import org.springframework.util.StringUtils; -import org.springframework.web.context.ConfigurableWebEnvironment; -import org.springframework.web.context.support.StandardServletEnvironment; import org.springframework.web.context.support.ServletContextResourceLoader; +import org.springframework.web.context.support.StandardServletEnvironment; /** * Simple extension of {@link javax.servlet.http.HttpServlet} which treats @@ -91,7 +90,7 @@ public abstract class HttpServletBean extends HttpServlet */ private final Set<String> requiredProperties = new HashSet<String>(); - private ConfigurableWebEnvironment environment; + private ConfigurableEnvironment environment; /** @@ -187,19 +186,19 @@ protected void initServletBean() throws ServletException { /** * {@inheritDoc} * @throws IllegalArgumentException if environment is not assignable to - * {@code ConfigurableWebEnvironment}. + * {@code ConfigurableEnvironment}. */ public void setEnvironment(Environment environment) { - Assert.isInstanceOf(ConfigurableWebEnvironment.class, environment); - this.environment = (ConfigurableWebEnvironment)environment; + Assert.isInstanceOf(ConfigurableEnvironment.class, environment); + this.environment = (ConfigurableEnvironment) environment; } /** * {@inheritDoc} * <p>If {@code null}, a new environment will be initialized via * {@link #createEnvironment()}. */ - public ConfigurableWebEnvironment getEnvironment() { + public ConfigurableEnvironment getEnvironment() { if (this.environment == null) { this.environment = this.createEnvironment(); } @@ -210,7 +209,7 @@ public ConfigurableWebEnvironment getEnvironment() { * Create and return a new {@link StandardServletEnvironment}. Subclasses may override * in order to configure the environment or specialize the environment type returned. */ - protected ConfigurableWebEnvironment createEnvironment() { + protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); }
true
Other
spring-projects
spring-framework
3cdb866bda078a24d3fccb36b08a449a970a524f.json
Relax ConfigurableWebEnvironment signatures ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in order to break a cyclic dependency. At the same time, certain signatures such as AbstractRefreshableWebApplicationContext#getEnviroment and GenericWebApplicationContext#getEnvironment were updated to take advantage of covariant return types and return this newer, more narrow type and providing cast-free calls to ConfigurableWebEnvironment methods where necessary. Similar changes were made to HttpServletBean in 3.2.0.M2 with SPR-9763. Narrowing #getEnvironment signatures in this fashion required enforcing at the #setEnvironment level that any Environment instance provided (explicitly or via the EnvironmentAware callback) must be an instance of ConfigurableWebEnvironment. This is a reasonable assertion in typical web application scenarios, but as SPR-10138 demonstrates, there are valid use cases in which one may want or need to inject a non-web ConfigurableEnvironment variant, e.g. during automated unit/integration testing. On review, it was never strictly necessary to narrow #getEnvironment signatures, although doing so did provided convenience and type safety. In order to maintain as flexible and backward-compatible an arrangement as possible, this commit relaxes these #getEnvironment signatures back to their original, pre-3.2 state. Namely, they now return ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in accordance, all instanceof assertions have been removed or relaxed to ensure that injected Environment instances are of type ConfigurableEnvironment. These changes have been verified against David Winterfeldt's Spring by Example spring-rest-services project, as described at SPR-10138. Issue: SPR-10138, SPR-9763, SPR-9439
spring-webmvc/src/test/java/org/springframework/web/servlet/DispatcherServletTests.java
@@ -833,7 +833,7 @@ public void testDispatcherServletContextRefresh() throws ServletException { public void testEnvironmentOperations() { DispatcherServlet servlet = new DispatcherServlet(); - ConfigurableWebEnvironment defaultEnv = servlet.getEnvironment(); + ConfigurableEnvironment defaultEnv = servlet.getEnvironment(); assertThat(defaultEnv, notNullValue()); ConfigurableEnvironment env1 = new StandardServletEnvironment(); servlet.setEnvironment(env1); // should succeed
true
Other
spring-projects
spring-framework
e4fcad9f936ba492f28ec5f0421eea4b3f76f8aa.json
Fix exception message about producible media types Issue: SPR-10175
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java
@@ -123,7 +123,7 @@ protected <T> void writeWithMessageConverters(T returnValue, } } if (compatibleMediaTypes.isEmpty()) { - throw new HttpMediaTypeNotAcceptableException(allSupportedMediaTypes); + throw new HttpMediaTypeNotAcceptableException(producibleMediaTypes); } List<MediaType> mediaTypes = new ArrayList<MediaType>(compatibleMediaTypes);
false
Other
spring-projects
spring-framework
8e1685caefae49ccd796ef9a8f707bc94d54680a.json
Fix ClassCastException in TilesConfigurer Issue: SPR-10195
build.gradle
@@ -613,6 +613,9 @@ project("spring-webmvc-tiles3") { optional("org.apache.tiles:tiles-jsp:3.0.1") { exclude group: "org.slf4j", module: "jcl-over-slf4j" } + optional("org.apache.tiles:tiles-extras:3.0.1") { + exclude group: "org.slf4j", module: "jcl-over-slf4j" + } optional("org.apache.tiles:tiles-el:3.0.1") { exclude group: "org.slf4j", module: "jcl-over-slf4j" }
true
Other
spring-projects
spring-framework
8e1685caefae49ccd796ef9a8f707bc94d54680a.json
Fix ClassCastException in TilesConfigurer Issue: SPR-10195
spring-webmvc-tiles3/src/main/java/org/springframework/web/servlet/view/tiles3/TilesConfigurer.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -32,19 +32,21 @@ import org.apache.commons.logging.LogFactory; import org.apache.tiles.TilesContainer; import org.apache.tiles.TilesException; -import org.apache.tiles.access.TilesAccess; import org.apache.tiles.definition.DefinitionsFactory; import org.apache.tiles.definition.DefinitionsReader; import org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO; import org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO; import org.apache.tiles.definition.digester.DigesterDefinitionsReader; import org.apache.tiles.el.ELAttributeEvaluator; +import org.apache.tiles.el.ScopeELResolver; import org.apache.tiles.el.TilesContextBeanELResolver; import org.apache.tiles.el.TilesContextELResolver; import org.apache.tiles.evaluator.AttributeEvaluator; import org.apache.tiles.evaluator.AttributeEvaluatorFactory; import org.apache.tiles.evaluator.BasicAttributeEvaluatorFactory; import org.apache.tiles.evaluator.impl.DirectAttributeEvaluator; +import org.apache.tiles.extras.complete.CompleteAutoloadTilesContainerFactory; +import org.apache.tiles.extras.complete.CompleteAutoloadTilesInitializer; import org.apache.tiles.factory.AbstractTilesContainerFactory; import org.apache.tiles.factory.BasicTilesContainerFactory; import org.apache.tiles.impl.BasicTilesContainer; @@ -72,7 +74,9 @@ * <p>The TilesConfigurer simply configures a TilesContainer using a set of files * containing definitions, to be accessed by {@link TilesView} instances. This is a * Spring-based alternative (for usage in Spring configuration) to the Tiles-provided - * {@link org.apache.tiles.web.startup.TilesListener} (for usage in {@code web.xml}). + * {@code ServletContextListener} + * (e.g. {@link org.apache.tiles.extras.complete.CompleteAutoloadTilesListener} + * for usage in {@code web.xml}. * * <p>TilesViews can be managed by any {@link org.springframework.web.servlet.ViewResolver}. * For simple convention-based view resolution, consider using {@link TilesViewResolver}. @@ -110,8 +114,6 @@ public class TilesConfigurer implements ServletContextAware, InitializingBean, D private TilesInitializer tilesInitializer; - private boolean completeAutoload = false; - private String[] definitions; private boolean checkRefresh = false; @@ -154,17 +156,14 @@ public void setTilesInitializer(TilesInitializer tilesInitializer) { public void setCompleteAutoload(boolean completeAutoload) { if (completeAutoload) { try { - Class<?> clazz = getClass().getClassLoader().loadClass( - "org.apache.tiles.extras.complete.CompleteAutoloadTilesInitializer"); - this.tilesInitializer = (TilesInitializer) clazz.newInstance(); + this.tilesInitializer = new SpringCompleteAutoloadTilesInitializer(); } catch (Exception ex) { - throw new IllegalStateException("Tiles-Extras 3.0 not available", ex); + throw new IllegalStateException("tiles-extras 3.x not available", ex); } } else { this.tilesInitializer = null; } - this.completeAutoload = completeAutoload; } /** @@ -192,7 +191,7 @@ public void setValidateDefinitions(boolean validateDefinitions) { /** * Set the {@link org.apache.tiles.definition.DefinitionsFactory} implementation to use. - * Default is {@link org.apache.tiles.definition.UrlDefinitionsFactory}, + * Default is {@link org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory}, * operating on definition resource URLs. * <p>Specify a custom DefinitionsFactory, e.g. a UrlDefinitionsFactory subclass, * to customize the creation of Tiles Definition objects. Note that such a @@ -204,8 +203,8 @@ public void setDefinitionsFactoryClass(Class<? extends DefinitionsFactory> defin } /** - * Set the {@link org.apache.tiles.preparer.PreparerFactory} implementation to use. - * Default is {@link org.apache.tiles.preparer.BasicPreparerFactory}, creating + * Set the {@link org.apache.tiles.preparer.factory.PreparerFactory} implementation to use. + * Default is {@link org.apache.tiles.preparer.factory.BasicPreparerFactory}, creating * shared instances for specified preparer classes. * <p>Specify {@link SimpleSpringPreparerFactory} to autowire * {@link org.apache.tiles.preparer.ViewPreparer} instances based on specified @@ -230,7 +229,7 @@ public void setPreparerFactoryClass(Class<? extends PreparerFactory> preparerFac * Set whether to use a MutableTilesContainer (typically the CachingTilesContainer * implementation) for this application. Default is "false". * @see org.apache.tiles.mgmt.MutableTilesContainer - * @see org.apache.tiles.mgmt.CachingTilesContainer + * @see org.apache.tiles.impl.mgmt.CachingTilesContainer */ public void setUseMutableTilesContainer(boolean useMutableTilesContainer) { this.useMutableTilesContainer = useMutableTilesContainer; @@ -246,26 +245,11 @@ public void setServletContext(ServletContext servletContext) { * @throws TilesException in case of setup failure */ public void afterPropertiesSet() throws TilesException { - - SpringWildcardServletTilesApplicationContext preliminaryContext = - new SpringWildcardServletTilesApplicationContext(this.servletContext); - + ApplicationContext preliminaryContext = new SpringWildcardServletTilesApplicationContext(this.servletContext); if (this.tilesInitializer == null) { this.tilesInitializer = new SpringTilesInitializer(); } this.tilesInitializer.initialize(preliminaryContext); - - if (this.completeAutoload) { - // We need to do this after initialization simply because we're reusing the - // original CompleteAutoloadTilesInitializer above. We cannot subclass - // CompleteAutoloadTilesInitializer when compiling against Tiles 2.1... - logger.debug("Registering Tiles 3.0 SpringLocaleResolver for complete-autoload setup"); - BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(preliminaryContext); - BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(container.getDefinitionsFactory()); - if (bw.isWritableProperty("localeResolver")) { - bw.setPropertyValue("localeResolver", new SpringLocaleResolver()); - } - } } /** @@ -332,8 +316,7 @@ protected DefinitionsFactory createDefinitionsFactory(ApplicationContext applica if (definitionsFactoryClass != null) { DefinitionsFactory factory = BeanUtils.instantiate(definitionsFactoryClass); if (factory instanceof org.apache.tiles.request.ApplicationContextAware) { - ((org.apache.tiles.request.ApplicationContextAware) factory) - .setApplicationContext(applicationContext); + ((org.apache.tiles.request.ApplicationContextAware) factory).setApplicationContext(applicationContext); } BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory); if (bw.isWritableProperty("localeResolver")) { @@ -380,6 +363,34 @@ private AttributeEvaluator createELEvaluator(ApplicationContext context) { } } + private class SpringCompleteAutoloadTilesInitializer extends CompleteAutoloadTilesInitializer { + + @Override + protected AbstractTilesContainerFactory createContainerFactory(ApplicationContext context) { + return new SpringCompleteAutoloadTilesContainerFactory(); + } + } + + private class SpringCompleteAutoloadTilesContainerFactory extends CompleteAutoloadTilesContainerFactory { + + @Override + protected AttributeEvaluatorFactory createAttributeEvaluatorFactory( + ApplicationContext applicationContext, LocaleResolver resolver) { + return new BasicAttributeEvaluatorFactory(new DirectAttributeEvaluator()); + } + + @Override + public TilesContainer createContainer(ApplicationContext applicationContext) { + CachingTilesContainer cachingContainer = (CachingTilesContainer) super.createContainer(applicationContext); + BasicTilesContainer tilesContainer = (BasicTilesContainer) cachingContainer.getWrappedContainer(); + BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(tilesContainer.getDefinitionsFactory()); + if (bw.isWritableProperty("localeResolver")) { + bw.setPropertyValue("localeResolver", new SpringLocaleResolver()); + } + return tilesContainer; + } + } + private class TilesElActivator { @@ -405,6 +416,7 @@ public AttributeEvaluator createEvaluator() { private static class CompositeELResolverImpl extends CompositeELResolver { public CompositeELResolverImpl() { + add(new ScopeELResolver()); add(new TilesContextELResolver(new TilesContextBeanELResolver())); add(new TilesContextBeanELResolver()); add(new ArrayELResolver(false));
true