Commit Graph

9757 Commits

Author SHA1 Message Date
Rossen Stoyanchev f017cc3feb DefaultSubscriptionRegistry returns safe to iterate Map
Prior to this change when adding subscriptions
DefaultSubscriptionRegistry (incorrectly) made a copy of the given map
for its "access" cache rather than for its "update" cache.

Issue: SPR-12665
2015-02-02 13:52:12 -05:00
Stephane Nicoll d8cec8534e Allow subclasses to configure the Yaml instance
Provide an additional hook-point for YamlProcessor subclasses willing to
change how the Yaml instance is configured. Also expose the default
StrictMapAppenderConstructor so that  they can compose a custom instance
with it.

Issue: SPR-12671
2015-02-02 11:28:54 +01:00
Rossen Stoyanchev a32b5e61d0 Add support for Server-Sent Events
This commit adds ResponseBodyEmitter and SseEmitter (and also
ResponseEntity<ResponseBodyEmitter> and ResponseEntity<SseEmitter>) as
new return value types supported on @RequestMapping controller methods.

See Javadoc on respective types for more details.

Issue: SPR-12212
2015-01-29 17:55:09 -05:00
Sebastien Deleuze ccb1c13951 Use UTC timezone in Jackson builder and factory tests
Issue: SPR-12634
2015-01-26 15:59:15 +01:00
Stephane Nicoll c7b324b89b Move cached expression evaluation abstraction
Move MethodCacheKey and related classes to the expression package so that
other parts of the framework can benefit ot it.

CacheExpressionEvaluator is a base class that can be used to cache SpEL
expressions based on its annotation source (i.e. method). Sub-classing
that base class provides a simple to use API to retrieve Expression
instances efficiently.

Issue: SPR-12622
2015-01-26 14:44:14 +01:00
Brian Clozel cf86ecddb5 Avoid loss of body content in AbstractRequestLoggingFilter
Prior to this commit, the `ContentCachingRequestWrapper` class would
cache the response content only if the reponse would be consumed using
its InputStream. In case of a Form request, Spring MVC consumes the
response using the `getParameter*` Servlet API methods. This causes the
cached content to never be written.

This commit makes the `ContentCachingResponseWrapper` write the request
body to the cache buffer by using the `getParameter*` API, thus avoiding
those issues.

Issue: SPR-7913
2015-01-26 11:41:34 +01:00
Sebastien Deleuze 5fb6d6d89c Allow Jackson builder modules configuration to be customized
Modules (well-known or user provided) registration is now performed
first in order to allow their configuration to be customized by more
specific ones like custom serializers or deserializers.

Issue: SPR-12634
2015-01-26 11:08:08 +01:00
Sam Brannen 6e10f7c8cf Update TODOs for SPR-11598 2015-01-24 18:01:43 +01:00
Sam Brannen 2d918380f0 Support @Configuration as meta-annotation in the TCF
Spring Framework 4.0 introduced support for using test-related
annotations as meta-annotations in the Spring TestContext Framework
(TCF) in order to create custom composed annotations within a test
suite; however, the detection of default @Configuration classes in test
classes was not updated to search for @Configuration declared as a
meta-annotation. Specifically, AnnotationConfigContextLoaderUtils
invokes Class.isAnnotated() which only searches for annotations
declared directly on the class in question.

This commit addresses this issue by refactoring the
isDefaultConfigurationClassCandidate() method in
AnnotationConfigContextLoaderUtils so that it uses
AnnotationUtils.findAnnotation() instead of Class.isAnnotated() for
detecting the presence of the @Configuration annotation, either
directly or as a meta-annotation.

Issue: SPR-12659
2015-01-23 22:13:04 +01:00
Sam Brannen c5c32ec206 Refer to static nested classes, not static inner classes
Various parts of the reference manual as well as the Javadoc for
AnnotationConfigContextLoaderUtils improperly refer to "static inner
classes" even though this terminology does not exist in Java. The Java
Language Specification explicitly refers to such classes as "static
nested classes." An "inner class" must be non-static by definition.
2015-01-23 21:41:12 +01:00
Sam Brannen e97712b95b Update copyright headers in IdGenerators 2015-01-23 21:12:45 +01:00
Rossen Stoyanchev 52b8f34468 Add JdkIdGenerator and use it in SockJS client
Issue: SPR-12658
2015-01-22 21:27:36 -05:00
Rossen Stoyanchev 0bfa124a1e Remove ISE in ResourceUrlProvider
Issue: SPR-12630
2015-01-22 17:08:20 -05:00
Stephane Nicoll 3f6f6d5f70 Merge pull request #722 from mgooty/master
* pull722:
  Fix method documentation typo
2015-01-22 19:23:23 +01:00
mgooty 9b24cc5035 Fix method documentation typo
Issue: SPR-12639
2015-01-22 19:22:57 +01:00
Juergen Hoeller 8ec0da083a Upgrade to Groovy 2.4 2015-01-22 19:16:08 +01:00
Juergen Hoeller 1cd4433621 Polishing 2015-01-22 18:44:07 +01:00
Juergen Hoeller 0479ca68fe ScheduledAnnotationBeanPostProcessor registers tasks in ContextRefreshedEvent phase (again)
Issue: SPR-12641
2015-01-22 18:42:30 +01:00
Brian Clozel a4fe49e6ff Update Jetty version to 9.2.7.v20150116 2015-01-22 10:19:16 +01:00
Rossen Stoyanchev d68fde57cd Support HandlerMethod arg in @ExceptionHandler methods
Issue: SPR-12605
2015-01-21 17:54:40 -05:00
Brian Clozel 2bf6b41bcc Initialize ResourceUrlProvider only once
Prior to this change, the ResourceUrlProvider would listen to
ContextRefreshedEvents and autodetect resource handlers each time. This
can cause issues when multiple contexts are involved and the last one
has no resource handler, thus clearing the previously detected ones.

This commit disables resource handlers auto-detection once some have
been detected with a refreshed context.

Issue: SPR-12592
2015-01-21 11:35:43 +01:00
Juergen Hoeller 49e31c302b Allow schedulerWithHsqlDataSource to pass through reducing it to the trigger table check
Issue: SPR-12618
2015-01-21 11:11:07 +01:00
Rossen Stoyanchev f949b2d3c3 Remove logging statement in ResponseBodyAdviceChain
Issue: SPR-12616
2015-01-20 17:22:51 -05:00
Rossen Stoyanchev 497944f0dd Fix minor test issues
Issue: SPR-12615
2015-01-20 17:14:20 -05:00
Brian Clozel bb78c76b8c Allow relative paths within resource location path
Prior to this change, location paths used for resource handling would
not allow "non-cleaned, relative paths" such as
`file://home/user/static/../static/`. When checking if the resolved
resource's path starts with the location path, a mismatch would happen
when comparing for example:

* the location `file://home/user/static/../static/`
* and the resource `file://home/user/static/resource.txt`

This commit cleans the location path before comparing it to the resource
path.

Issue: SPR-12624
2015-01-20 17:46:05 +01:00
Juergen Hoeller 4141bf35b4 Latest dependency updates (Jackson 2.5, Hibernate 4.3.8, Netty 4.0.25) 2015-01-20 16:02:20 +01:00
Juergen Hoeller d34402d3ba OperatorMatches caches compiled patterns
Issue: SPR-12610
2015-01-20 16:02:11 +01:00
Juergen Hoeller 11bf3b3524 AbstractBeanDefinitionParser allows for skipping evaluation of XML "name" attribute
Issue: SPR-12643
2015-01-20 16:02:01 +01:00
Juergen Hoeller d4dac250a8 AbstractRequestLoggingFilter allows for dedicated shouldLog check in CommonsRequestLoggingFilter
Issue: SPR-12609
2015-01-20 16:01:53 +01:00
Juergen Hoeller 0ddf8dde12 AnnotationUtils explicitly handles null parameters
Issue: SPR-12604
2015-01-20 16:01:44 +01:00
Brian Clozel 028c0e8b80 Allow protocol relative URLs in CssLink Transformer
This commit allows the use of "protcol relative URLs" (i.e. URLs without
scheme, starting with `//`), often used to serve resources automatically
from https or http with third party domains.

This syntax is allowed by RFC 3986.

Issue: SPR-12632
2015-01-20 15:53:10 +01:00
Sebastien Deleuze bf7a9754d5 Avoid using Java 8 ZoneId class
Issue: SPR-12594
2015-01-20 15:24:55 +01:00
Sebastien Deleuze b89e62e5f6 Support specifying Jackson TimeZone and Locale
Issue: SPR-12594
2015-01-20 14:57:14 +01:00
Stephane Nicoll 4a2b6a1322 Merge pull request #721 from MaciejZiarko/java-doc-fix
* java-doc-fix:
  Fix Javadoc examples
2015-01-17 13:50:27 +01:00
Maciej Ziarko 81c750fb1c Fix Javadoc examples 2015-01-17 13:48:50 +01:00
Brian Clozel 3da9d92bf5 Fix context-relative default value in XML parsing
This commit fixes the default value for the contextRelative attribute of
a RedirectView, when this view is registered via a
RedirectViewController in XML. The value is set to true.

Note that the default value for this is correctly documented in
spring-mvc-4.1.xsd. Also, the documentation and implementation for its
javadoc counterpart also enforces true as a default value.

Issue: SPR-12607
2015-01-16 16:13:02 +01:00
Rossen Stoyanchev ab629a0e26 Deprecate writePrelude in AbstractHttpSockJsSession
A logical follow-up on commit 43d937, this change also removes (or
rather deprecates for now) writePrelude that is only of concern to
streaming SockJS session implementations.

Issue: SPR-12427
2015-01-13 10:26:59 -05:00
Rossen Stoyanchev 43d93712f1 Remove isStreaming flag from AbstractHttpSockJsSession
This change removes the need for the isStreaming field from the base
class AbstractHttpSockJsSession. This field was used to account for
differences between polling vs streaming SockJS sessions without having
to expose to sub-classes private fields that are otherwise protected
from concurrent access by the base class. The change manages to delegate
to sub-classes without providing direct access to protected fields.

Issue: SPR-12427
2015-01-12 14:48:09 -05:00
Sam Brannen 7a6dfe3765 Make MBeanServer integration tests more robust
This commit overhauls several of the tests that interact with an
MBeanServer with the goal of increasing the reliability of these tests.

 - MBeanClientInterceptorTests now uses JUnit "assumptions" instead of
   preemptively returning from test methods, thus allowing such methods
   to be properly marked as "ignored" instead of "passed".

 - MBeanClientInterceptorTests now uses JUnit's support for expected
   exceptions where appropriate.

 - MBeanClientInterceptorTests and RemoteMBeanClientInterceptorTests now
   use Spring's SocketUtils to find an available TCP port when starting
   an MBeanServer instead of aborting the tests when the default JMX
   port is not available.

Issue: SPR-12601
2015-01-12 12:19:11 +01:00
Sam Brannen 08f3a79821 Fix broken test in EnableSchedulingTests
Commit 65d163e changed the textual message of an exception thrown by
ScheduledAnnotationBeanPostProcessor.afterSingletonsInstantiated(), and
this in turn caused the withAmbiguousTaskSchedulers_andSingleTask()
method in EnableSchedulingTests to start failing (albeit only during
'Performance' builds).

This commit updates the assertion to match the current implementation of
ScheduledAnnotationBeanPostProcessor.
2015-01-10 22:30:06 +01:00
Sam Brannen d5fb829ade Polish failed assertion messages in QuartzSupportTests 2015-01-10 22:28:00 +01:00
Sam Brannen 276712dcd1 Enable reuse of DefaultActiveProfilesResolver
In order to allow DefaultActiveProfilesResolver to be reused (e.g., via
extension or delegation), the check which asserts that the 'resolver'
attribute of @ActiveProfiles is not set to a customer resolver class
has been removed.

Issue: SPR-12611
2015-01-10 20:36:48 +01:00
Sam Brannen cf7a7932f3 Polish TimedSpringRunnerTests 2015-01-10 17:52:41 +01:00
Sam Brannen b81c522ee1 Handle exceptions properly in SpringJUnit4ClassRunner
JUnit 4.9 introduced a regression in BlockJUnit4ClassRunner.runChild()
such that exceptions thrown from methodBlock() cause the current test
execution to abort immediately. As a result, the failing test method is
unrooted, and subsequent test methods are never invoked. Furthermore,
RunListeners registered with JUnit are not properly notified.

In conjunction with SPR-11908, SpringJUnit4ClassRunner was updated to
use the aforementioned changes to BlockJUnit4ClassRunner.runChild().
Consequently, SpringJUnit4ClassRunner now suffers from the same
regression.

This commit addresses this issue by ensuring that any exceptions thrown
during the invocation of methodBlock() are properly wrapped in a JUnit
Fail Statement.

Issue: SPR-12613
2015-01-10 17:51:51 +01:00
Sam Brannen f5201e3ca0 Remove link to forums in README 2015-01-09 23:14:56 +01:00
Sam Brannen dbbd1dacef Update Eclipse formatter settings for Java source code
- Copyright end date is now dynamic, based on the current year.

 - Added missing spaces in front of web link to ASL 2.0 license file.

 - Changed @since tag to 4.2.
2015-01-08 18:39:03 +01:00
Sam Brannen fc38d3bf06 Set source and target to JDK 1.8 for Eclipse projects 2015-01-08 18:33:33 +01:00
Sam Brannen e9e5149001 Fix cleanEclipseJdtUi task in the Gradle build 2015-01-08 18:32:12 +01:00
Sam Brannen c50df0c420 Polish MessageBodyClientHttpResponseWrapper
Added missing copyright clause and fixed @since version.
2015-01-08 18:02:00 +01:00
Brian Clozel b6675b6167 Revisit empty body response support in HTTP client
Prior to this commit, HTTP responses without body (response status 204
or 304, Content-Length: 0) were handled properly by RestTemplates. But
some other cases were not properly managed, throwing exceptions for
valid HTTP responses.

This commit better handles HTTP responses, using a response wrapper that
can tell if a response:

* has no message body (HTTP status 1XX, 204, 304 or Content-Length:0)
* has an empty message body

This covers rfc7230 Section 3.3.3.

Issue: SPR-8016
2015-01-08 17:34:39 +01:00