From 55b0c2f243fd1dc5bad98611b17b441af6cb58c6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 24 Oct 2017 01:01:42 +0200 Subject: [PATCH] Polishing --- .../AbstractConditionalEnumConverter.java | 4 +- .../expression/spel/ast/Projection.java | 3 +- src/docs/asciidoc/data-access.adoc | 31 ++++++---------- src/docs/asciidoc/integration.adoc | 37 ++++++++++--------- 4 files changed, 34 insertions(+), 41 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/AbstractConditionalEnumConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/AbstractConditionalEnumConverter.java index e6c94f65f3..e091b27038 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/AbstractConditionalEnumConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/AbstractConditionalEnumConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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,7 +39,7 @@ abstract class AbstractConditionalEnumConverter implements ConditionalConverter @Override public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) { - for (Class interfaceType : ClassUtils.getAllInterfacesForClass(sourceType.getType())) { + for (Class interfaceType : ClassUtils.getAllInterfacesForClassAsSet(sourceType.getType())) { if (this.conversionService.canConvert(TypeDescriptor.valueOf(interfaceType), targetType)) { return false; } diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/ast/Projection.java b/spring-expression/src/main/java/org/springframework/expression/spel/ast/Projection.java index 27e34a2952..971d61b40b 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/ast/Projection.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/ast/Projection.java @@ -153,8 +153,7 @@ public class Projection extends SpelNodeImpl { } nextType = nextType.getSuperclass(); } - Class[] interfaces = ClassUtils.getAllInterfacesForClass(newType); - for (Class nextInterface : interfaces) { + for (Class nextInterface : ClassUtils.getAllInterfacesForClassAsSet(newType)) { if (nextInterface.isAssignableFrom(oldType)) { return nextInterface; } diff --git a/src/docs/asciidoc/data-access.adoc b/src/docs/asciidoc/data-access.adoc index e5bff0f814..743a547434 100644 --- a/src/docs/asciidoc/data-access.adoc +++ b/src/docs/asciidoc/data-access.adoc @@ -2034,7 +2034,7 @@ treats them as errors. [[transaction-resources]] -=== Further Resources +=== Further resources For more information about the Spring Framework's transaction support: @@ -2457,7 +2457,7 @@ last code snippet as follows: ---- [[jdbc-JdbcTemplate-examples-update]] -====== Updating (INSERT/UPDATE/DELETE) with jdbcTemplate +====== Updating (INSERT/UPDATE/DELETE) with JdbcTemplate You use the `update(..)` method to perform insert, update and delete operations. Parameter values are usually provided as var args or alternatively as an object array. @@ -2487,7 +2487,7 @@ Parameter values are usually provided as var args or alternatively as an object ---- [[jdbc-JdbcTemplate-examples-other]] -====== Other jdbcTemplate operations +====== Other JdbcTemplate operations You can use the `execute(..)` method to execute any arbitrary SQL, and as such the method is often used for DDL statements. It is heavily overloaded with variants taking @@ -3348,7 +3348,6 @@ The same example using classic JDBC "?" placeholders: } // ... additional methods - } ---- @@ -3398,7 +3397,6 @@ This example shows a batch update using a batch size of 100: } // ... additional methods - } ---- @@ -3540,7 +3538,6 @@ You can limit the columns for an insert by specifying a list of column names wit } // ... additional methods - } ---- @@ -3580,7 +3577,6 @@ values. Here is an example: } // ... additional methods - } ---- @@ -3611,7 +3607,6 @@ convenient `addValue` method that can be chained. } // ... additional methods - } ---- @@ -3683,7 +3678,6 @@ of the stored procedure. } // ... additional methods - } ---- @@ -3724,7 +3718,6 @@ the constructor of your `SimpleJdbcCall`. Here is an example of this configurati } // ... additional methods - } ---- @@ -3883,7 +3876,6 @@ To call this function we again create a `SimpleJdbcCall` in the initialization m } // ... additional methods - } ---- @@ -3943,7 +3935,6 @@ created by passing in the required class to map to in the `newInstance` method. } // ... additional methods - } ---- @@ -5759,6 +5750,7 @@ thus are isolated from each other. [[orm-jpa-multiple]] ===== Dealing with multiple persistence units + For applications that rely on multiple persistence units locations, stored in various JARS in the classpath, for example, Spring offers the `PersistenceUnitManager` to act as a central repository and to avoid the persistence units discovery process, which can be @@ -6038,6 +6030,7 @@ less portable, but will be set up for the server's JTA environment out of the bo [[oxm-introduction]] === Introduction + In this chapter, we will describe Spring's Object/XML Mapping support. Object/XML Mapping, or O/X mapping for short, is the act of converting an XML document to and from an object. This conversion process is also known as XML Marshalling, or XML @@ -6055,12 +6048,12 @@ Some of the benefits of using Spring for your O/X mapping needs are: Spring's bean factory makes it easy to configure marshallers, without needing to construct JAXB context, JiBX binding factories, etc. The marshallers can be configured -as any other bean in your application context. Additionally, XML Schema-based +as any other bean in your application context. Additionally, XML namespace-based configuration is available for a number of marshallers, making the configuration even simpler. -==== Consistent Interfaces +==== Consistent interfaces Spring's O/X mapping operates through two global interfaces: the `Marshaller` and `Unmarshaller` interface. These abstractions allow you to switch O/X mapping frameworks @@ -6071,7 +6064,7 @@ other using Castor) in a non-intrusive fashion, leveraging the strength of each technology. -==== Consistent Exception Hierarchy +==== Consistent exception hierarchy Spring provides a conversion from exceptions from the underlying O/X mapping tool to its own exception hierarchy with the `XmlMappingException` as the root exception. As can be @@ -6322,7 +6315,7 @@ This sample application produces the following `settings.xml` file: [[oxm-schema-based-config]] -=== XML Schema-based Configuration +=== XML configuration namespace Marshallers could be configured more concisely using tags from the OXM namespace. To make these tags available, the appropriate schema has to be referenced first in the @@ -6397,7 +6390,7 @@ validation is performed by specifying one or more schema resource to the bean, l ---- [[oxm-jaxb2-xsd]] -===== XML Schema-based Configuration +===== XML configuration namespace The `jaxb2-marshaller` tag configures a `org.springframework.oxm.jaxb.Jaxb2Marshaller`. Here is an example: @@ -6488,7 +6481,7 @@ with a classpath resource. ---- [[oxm-castor-xsd]] -===== XML Schema-based Configuration +===== XML configuration namespace The `castor-marshaller` tag configures a `org.springframework.oxm.castor.CastorMarshaller`. Here is an example: @@ -6574,7 +6567,7 @@ classes, you have to configure multiple ``JibxMarshaller``s with different `targ property values. [[oxm-jibx-xsd]] -===== XML Schema-based Configuration +===== XML configuration namespace The `jibx-marshaller` tag configures a `org.springframework.oxm.jibx.JibxMarshaller`. Here is an example: diff --git a/src/docs/asciidoc/integration.adoc b/src/docs/asciidoc/integration.adoc index 9bf4b1e61a..24f8f77056 100644 --- a/src/docs/asciidoc/integration.adoc +++ b/src/docs/asciidoc/integration.adoc @@ -1231,7 +1231,7 @@ to serialize only a subset of the object properties. For example: [[rest-message-conversion]] -==== HTTP Message Conversion +==== HTTP message conversion Objects passed to and returned from the methods `getForObject()`, `postForLocation()`, and `put()` are converted to HTTP requests and from HTTP responses by @@ -1354,6 +1354,7 @@ Please use the <> instead. [[ejb-introduction]] === Introduction + As a lightweight container, Spring is often considered an EJB replacement. We do believe that for many if not most applications and use cases, Spring as a container, combined with its rich supporting functionality in the area of transactions, ORM and JDBC access, @@ -2031,7 +2032,7 @@ these callback methods. [[jms-receiving-sync]] -==== Synchronous Reception +==== Synchronous reception While JMS is typically associated with asynchronous processing, it is possible to consume messages synchronously. The overloaded `receive(..)` methods provide this @@ -2042,7 +2043,7 @@ the receiver should wait before giving up waiting for a message. [[jms-asynchronousMessageReception]] -==== Asynchronous Reception - Message-Driven POJOs +==== Asynchronous reception: Message-Driven POJOs [NOTE] ==== @@ -2113,7 +2114,7 @@ description of the features supported by each implementation. [[jms-receiving-async-session-aware-message-listener]] -==== the SessionAwareMessageListener interface +==== SessionAwareMessageListener interface The `SessionAwareMessageListener` interface is a Spring-specific interface that provides a similar contract to the JMS `MessageListener` interface, but also provides the message @@ -2148,7 +2149,7 @@ responsibility of the client code to handle any exceptions thrown. [[jms-receiving-async-message-listener-adapter]] -==== the MessageListenerAdapter +==== MessageListenerAdapter The `MessageListenerAdapter` class is the final component in Spring's asynchronous messaging support: in a nutshell, it allows you to expose almost __any__ class as a MDP @@ -3369,7 +3370,7 @@ for controlling the management interfaces of your beans. [[jmx-interface-assembler]] -==== the MBeanInfoAssembler Interface +==== MBeanInfoAssembler interface Behind the scenes, the `MBeanExporter` delegates to an implementation of the `org.springframework.jmx.export.assembler.MBeanInfoAssembler` interface which is @@ -3383,7 +3384,7 @@ interface using either source-level metadata or any arbitrary interface. [[jmx-interface-metadata]] -==== Using Source-Level Metadata (Java annotations) +==== Using source-level metadata: Java annotations Using the `MetadataMBeanInfoAssembler` you can define the management interfaces for your beans using source level metadata. The reading of metadata is encapsulated by the @@ -3526,12 +3527,12 @@ metadata-driven management interfaces for your Spring-exposed MBeans. [[jmx-interface-metadata-types]] -==== Source-Level Metadata Types +==== Source-level metadata types The following source level metadata types are available for use in Spring JMX: [[jmx-metadata-types]] -.Source-Level Metadata Types +.Source-level metadata types |=== | Purpose| Annotation| Annotation Type @@ -3556,7 +3557,7 @@ The following configuration parameters are available for use on these source-lev metadata types: [[jmx-metadata-parameters]] -.Source-Level Metadata Parameters +.Source-level metadata parameters [cols="1,3,1"] |=== | Parameter| Description| Applies to @@ -3612,7 +3613,7 @@ metadata types: [[jmx-interface-autodetect]] -==== the AutodetectCapableMBeanInfoAssembler interface +==== AutodetectCapableMBeanInfoAssembler interface To simplify configuration even further, Spring introduces the `AutodetectCapableMBeanInfoAssembler` interface which extends the `MBeanInfoAssembler` @@ -3971,7 +3972,7 @@ connectors. [[jmx-jsr160-server]] -==== Server-side Connectors +==== Server-side connectors To have Spring JMX create, start and expose a JSR-160 `JMXConnectorServer` use the following configuration: @@ -4042,7 +4043,7 @@ snippet of configuration: [[jmx-jsr160-client]] -==== Client-side Connectors +==== Client-side connectors To create an `MBeanServerConnection` to a remote JSR-160 enabled `MBeanServer` use the `MBeanServerConnectionFactoryBean` as shown below: @@ -4080,7 +4081,7 @@ documentation for more information. [[jmx-proxy]] -=== Accessing MBeans via Proxies +=== Accessing MBeans via proxies Spring JMX allows you to create proxies that re-route calls to MBeans registered in a local or remote `MBeanServer`. These proxies provide you with a standard Java interface @@ -4137,7 +4138,7 @@ Spring's JMX offering includes comprehensive support for JMX notifications. [[jmx-notifications-listeners]] -==== Registering Listeners for Notifications +==== Registering listeners for notifications Spring's JMX support makes it very easy to register any number of `NotificationListeners` with any number of MBeans (this includes MBeans exported by @@ -4442,7 +4443,7 @@ you can accept the coupling to both Spring and JMX, then do so. [[jmx-resources]] -=== Further Resources +=== Further resources This section contains links to further resources about JMX. @@ -6123,7 +6124,7 @@ much more flexible. [[scheduling-trigger-interface]] -==== the Trigger interface +==== Trigger interface The `Trigger` interface is essentially inspired by JSR-236, which, as of Spring 3.0, has not yet been officially implemented. The basic idea of the `Trigger` is that execution @@ -6850,7 +6851,7 @@ javadocs] for more information. === Introduction Since version 3.1, Spring Framework provides support for transparently adding caching -into an existing Spring application. Similar to the <> +into an existing Spring application. Similar to the <> support, the caching abstraction allows consistent use of various caching solutions with minimal impact on the code. -- GitLab