This commit is a general update of the Cache Abstraction chapter.
Existing sections have been updated with recent improvements made in
that area, in particular:
* Guava and JSR-107 caches support
* New @CacheConfig annotation allowing to share some key customizations
at class-level
* CacheResolver interface used to resolve the cache(s) to use at
runtime
* Update section on @CachePut
This commit also describes the support of standard JCache annotations,
i.e. JSR-107.
Issues: SPR-11490, SPR-11316, SPR-10629, SPR-9616, SPR-8696
Prior to this commit, there were numerous places in the reference
manual, where we would see output similar to the following:
BeanDefinition`s with the `ApplicationContext
This commit addresses this issue by using unconstrained quotes
(e.g., ++XYZ++s) instead of backticks (e.g., `XYZ`s) when the formatted
text is immediately followed by an "s".
This commit also corrects a few typos and corrects natural English
pluralization of Java code elements in the reference manual where
appropriate -- for example, "@Controllers" becomes "@Controller classes,
etc.
Issue: SPR-11650
Prior to this commit, an exception thrown by an @Async void method
was not further processed as there is no way to transmit that
exception to the caller.
The AsyncUncaughtExceptionHandler is a new strategy interface that
can be implemented to handle unexpected exception thrown during the
invocation of such asynchronous method.
The handler can be specified using either the XML namespace or by
implementing the AsyncConfigurer interface with the EnableAsync
annotation.
Issue: SPR-8995
Prior to this commit, the Spring TestContext Framework did not support
the declaration of both 'locations' and 'classes' within
@ContextConfiguration at the same time.
This commit addresses this in the following manner:
- ContextConfigurationAttributes no longer throws an
IllegalArgumentException if both 'locations' and 'classes' are
supplied to its constructor.
- Concrete SmartContextLoader implementations now validate the
supplied MergedContextConfiguration before attempting to load the
ApplicationContext. See validateMergedContextConfiguration().
- Introduced tests for hybrid context loaders like the one used in
Spring Boot. See HybridContextLoaderTests.
- Updated the Testing chapter of the reference manual so that it no
longer states that locations and classes cannot be used
simultaneously, mentioning Spring Boot as well.
- The Javadoc for @ContextConfiguration has been updated accordingly.
- Added hasLocations(), hasClasses(), and hasResources() convenience
methods to MergedContextConfiguration.
Issue: SPR-11634
This commit rationalizes the use of @Order so that the standard
@Priority annotation can be used instead. The handling of both
annotations are now defined in OrderUtils.
This also updates the link to the JavaEE API so that we refer to
JavaEE7 instead of JavaEE6.
Issue: SPR-11639
Although the need to map the ASYNC dispatcher type to a Filter was
already mentioned, it wasn't very prominent and can be quite critical
in some cases. This change addresses that.
Issue: SPR-10440
BufferingStompDecoder message buffer size limit can now be configured
with JavaConfig MessageBrokerRegistry.setMessageBufferSizeLimit() or
with XML <websocket:message-brocker message-buffer-size="">.
Issue: SPR-11527
Prior to this commit, the codebase was using a mix of log4j.xml
and log4j.properties for test-related logging configuration. This
can be an issue as log4j takes the xml variant first when looking
for a default bootstrap configuration.
In practice, some modules declaring the properties variant were
taking the xml variant configuration from another module.
The general structure of the configuration has also been
harmonized to provide a standard console output as well as an
easy way to enable trace logs for the current module.
In Tiles v3 integration, underscores in filenames are
intended to identify the definition locale. This behavior
is now documented in order to avoid unexpected results
with filenames like tiles_definitions.xml.
This commit also updates Tiles v2 references to Tiles v3
in the Spring reference documentation.
Issue: SPR-11491
This commit updates reference documentation in order
to specify that ServletServerContainerFactoryBean is for
server side use and WebSocketContainerFactoryBean
for client side use.
Issue: SPR-11565
This commit provides a first attempt at defining a standard code
formatting scheme for the Spring Framework in Intellij IDEA.
These are the major changes compared to standard settings:
* default indent option to use tab character instead of space for
all languages
* one space before the left brace of an array initializer
* keep when reformating: multiple expressions in one line,
simple blocks in one line
* method declaration parameters: do not align when multiline
* else, catch and finally on new line
* keep one space before } (solely use to keep the space between the
end of the last method and the end of the class)
* minimum blank line after class header 0 (instead of 1)
* Disabled Javadoc formatting
* class count to trigger static import to 50 (to prevent
import org.foo.*; instead of listing the classes of org.foo)
* changed the import sequence to import in the following order:
static imports, java.*, javax.*, others, org.springframework.*. Each
sequence is separated by a space
The Servlet API does not provide notifications when a client
disconnects, see see https://java.net/jira/browse/SERVLET_SPEC-44.
Therefore network IO failures may occur simply because a client has
gone away. Before this change that could fill logs with unnecessary
stack traces.
After this change we make a best effort to identify such network
failures, on a per-server basis (tested with Jetty, Tomcat, Glassfish,
and WildFly), and log them under a separate log category.
A simple one-line message is logged at DEBUG level (i.e. no stack trace)
while a full stack trace is shown at TRACE level.
Issue: SPR-11438
The breakout box named "Constructor-based or setter-based DI?" in the
reference manual currently recommends the use of setter injection.
This commit refines this text to align with current best practices and
now favors constructor injection over setter injection.
Issue: SPR-11459
Clarify ability to use @MessageMapping methods on both @Controller as
well as @RestController.
Add section on configuring connections (including credentials) to the
message broker and clarify the use of the login/passcode headerers of
the STOMP CONNECT frame.
Add note on when to add the reactor-tcp dependency.
Issue: SPR-11464, SPR-11436, SPR-11449
Before this change, issues surrounding the use of @Controller's in
combination with AOP proxying, resulted in an IllegalArgumentException
when trying to invoke the controller method.
This change detects such cases proactively and reports them with a
clear recommendation to use class-based proxying when it comes to
@Controller's. This is the most optimcal approach for controllers
in many respects, also allows @MVC annotations to remain on the
class.
The documentation has also been updated to have a specific section
on @Controller's and AOP proxying providing the same advice.
Issue:SPR-11281
This commit fixes some formatting issues in the 'TestContext Framework
support classes' section of the reference manual that were introduced
in the conversion from DocBook to AsciiDoc.
Update reference documentation to make it clearer that only
`spring-core` has a direct dependency on `commons-logging`.
Also reference the 'empty jar' alternative option as described in
the SLF4J FAQ.