Commit Graph

554 Commits

Author SHA1 Message Date
Stephane Nicoll b0979cbab6 autoGrow support in DataBinder for field access
This commit harmonizes the autoGrow feature for both regular bean
property and direct field access.

Issue: SPR-8692
2014-06-27 11:28:09 +02:00
Stephane Nicoll 17d15cc495 Fix warning 2014-06-27 11:04:41 +02:00
Stephane Nicoll bc714888c4 Nested properties support for field-based validation
This commit validates that the changes introduced in 8221c9abc5 are
indeed allowing DirectFieldBindingResult to support nested validation
paths.

Issue: SPR-10623
2014-06-27 11:00:41 +02:00
Stephane Nicoll 8221c9abc5 Support for nested path using field access
This commit adds a nested path support for DirectFieldAccessor that is
similar to what BeanWrapper provides. It is now possible to use
expressions such as "person.address.city.name" to access the name of
the city that a given person lives in using fields to traverse the
graph.

DirectFieldAccessor also now supports an auto-grow option to create
a default instance for a "null" intermediate path. This option is
false by default and leads to a NullValueInNestedPathException in such
a case.

This commit also harmonizes part of the tests suite so that core tests
are shared between BeanWrapperImpl and DirectFieldAccessor.

Note that map and list access is not implemented as part of this
commit.

Issue: SPR-9705
2014-06-26 19:22:02 +02:00
Juergen Hoeller 442bd682a7 Polishing
Issue: SPR-11910
2014-06-26 18:14:51 +02:00
Juergen Hoeller 35067790f3 MBeanExporter implements DisposableBean again (also revised logging and rearranged properties)
Issue: SPR-8045
2014-06-26 15:55:40 +02:00
Juergen Hoeller 46dc07a005 AsyncExecutionInterceptor uses submitListenable if method signature indicates ListenableFuture
Issue: SPR-11909
2014-06-26 15:19:17 +02:00
Juergen Hoeller cc917de24d Polishing 2014-06-26 11:44:07 +02:00
Juergen Hoeller b3e3c5312f Introduced AnnotationConfigRegistry as common interface for AnnotationConfig(Web)ApplicationContext
Issue: SPR-11814
2014-06-26 11:43:03 +02:00
Juergen Hoeller b6255128bf ConfigurationClassPostProcessor skips pre-processed bean definitions now (avoiding side effects in case of multiple CCPPs)
Issue: SPR-11858
2014-06-25 13:46:15 +02:00
Juergen Hoeller 18131bf611 Consistent declaration of private static final logger variables
Issue: SPR-11905
2014-06-24 14:02:05 +02:00
Juergen Hoeller 6f68b034ca MBeanExportConfiguration's SpecificPlatform properly calls afterPropertiesSet
Also makes the nested SpecificPlatform enum public for Spring Boot to reuse it.

Issue: SPR-11877
2014-06-19 22:24:04 +02:00
Stephane Nicoll c7b106577f polishing
Reorganized class structure to match our code style (setter for
properties at the top of the class, public method before private
implementation).

Removed DisposableBean as it the lifecycle is already taking care
of removing MBeans on stop.

Cleaned test suite

Issue: SPR-8045
2014-06-10 10:13:58 +02:00
Marten Deinum 2ede219e66 Using SmartLifecycle to register MBeans
Prior to this commit, MBeans were registered in a post construct
call of MBeanExporter. This commit moves that logic after the
initialization phase using the SmartLifecycle callback.

Issue: SPR-8045
2014-06-10 10:13:58 +02:00
Juergen Hoeller 6aa9c40552 ConfigurationClassParser falls back to ASM-based resolution of member classes in case of NoClassDefFoundError
Issue: SPR-11844
2014-06-06 14:01:38 +02:00
Juergen Hoeller f7b465390c Moved @Uses annotations to org.springframework.lang; fixed Base64Utils to declare Java 8, and fixed PathResource's declaration to refer to Java 7.
Issue: SPR-11604
2014-06-04 21:34:23 +02:00
Stephane Nicoll 001d0e734c Support for @Order at the bean declaration level
This commit introduces OrderProvider and OrderProviderComparator, two
interfaces designed to externalize how a collection of element is sorted
according to their order value.

FactoryAwareOrderProvider is an OrderProvider implementation that knows
about the objects to order and the corresponding BeanFactory instance.
This allows to retrieve additional metadata about the actual instances
to sort, such as its factory method.

A @Bean method can now holds an additional @Order to define the order
value that this bean should have when injected as part of a collection
or array.

Issue: SPR-11310
2014-06-04 21:04:13 +02:00
Stephane Nicoll aaae10ce3b Cache operation invocation hook point
This commit adds a invokeOperation protected method in case one
needs a hook point in the way the underlying cache method is invoked,
and how exceptions that might be thrown by that invocation are handled.

Issue: SPR-11540
2014-06-02 15:00:51 +02:00
Juergen Hoeller 31f2f20307 Unit tests for configuration classes implementing the JSR-330 Provider interface
Issue: SPR-11830
2014-05-30 21:37:01 +02:00
Juergen Hoeller 5ed9bedf32 Introducing GroovyWebApplicationContext along the lines of XmlWebApplicationContext and GenericGroovyApplicationContext
Also includes minor dependency updates such as Groovy 2.3.2.

Issue: SPR-11371
2014-05-30 17:35:00 +02:00
Juergen Hoeller 8220832c4e Polishing 2014-05-27 18:29:51 +02:00
Juergen Hoeller d9f8ee886e Introduced EmbeddedValueResolutionSupport base class for AnnotationFormatterFactory implementations 2014-05-27 18:15:34 +02:00
Stephane Nicoll bb6e07bd3a polishing 2014-05-26 13:39:38 +02:00
Stephane Nicoll 9952973e01 Add missing cache-resolver attribute
Prior to this commit, CacheResolver could not be configured through
the XML namespace (i.e. cache:annotation-driven). This is now the
case.

Issue: SPR-11490
2014-05-21 09:03:18 +02:00
Stephane Nicoll 05e96ee448 Cache provider related exceptions handling
This commit adds the necessary infrastructure to handle exceptions
thrown by a cache provider in both Spring's and JCache's caching
abstractions.

Both interceptors can be configured with a CacheErrorHandler that
defines several callbacks on typical cache operations. In particular,
handleCacheGetError can be implemented in such a way that an
exception thrown by the provider is handled as a cache miss by the
caching abstraction.

The handler can be configured with both CachingConfigurer and the
XML namespace (error-handler property)

Issue: SPR-9275
2014-05-20 16:39:34 +02:00
Juergen Hoeller f29d6eb5f6 Properly evaluate @Conditional in case of multiple imports for same config class (fixing regression in Spring Boot)
Issue: SPR-11788
(cherry picked from commit 7d78c65)
2014-05-18 02:05:18 +02:00
Juergen Hoeller 52f44b340e Properly evaluate @Conditional in case of multiple imports for same config class
Issue: SPR-11788
2014-05-16 15:06:22 +02:00
Juergen Hoeller b4d447fc3d isLiteConfigurationCandidate considers @ComponentScan and @ImportResource as indicators as well
Issue: SPR-11769
2014-05-09 21:43:37 +02:00
Juergen Hoeller 8c9116fd4b Additional tests for configuration class importing via ASM
Issue: SPR-11647
2014-05-08 16:22:24 +02:00
Stephane Nicoll 658f7f58df Add missing @since tag 2014-05-05 15:45:45 +02:00
Stephane Nicoll bd85c916eb Integrate animal sniffer
Animal sniffer provides tools to assist verifying that classes
compiled with a newer JDK are compatible with an older JDK.

This integratesthe latest version of the tool (1.11) that
permits the use of custom annotations. Added @UsesJava7,
@UsesJava8 and @UsesSunHttpServer and annotated the few places
where we rely on a specific environment.

The verification process can be invoked by running the 'sniff'
task.

Issue: SPR-11604

polishing
2014-04-30 13:51:01 +02:00
Juergen Hoeller adb616b67b JRubyScriptUtils defensively handles null Nodes in findClassNode (fails against JRuby 1.7.12 otherwise)
Issue: SPR-11747
2014-04-30 13:40:11 +02:00
Stephane Nicoll 90081f787f Fix Cacheable javadoc
This commits fixes a confusing phrasing of Cacheable javadoc that
mentioned explicitly that the method signature is used to compute the
key for the cache.

Issue: SPR-11736
2014-04-30 11:40:54 +02:00
Juergen Hoeller 02aca9c754 Polishing 2014-04-30 00:01:07 +02:00
Juergen Hoeller 1b2014a52d AbstractAutoProxyCreator and AbstractAdvisingBeanPostProcessor consistently not considering configuration callbacks and internal language interfaces as reasonable proxy interfaces
Issue: SPR-11715
2014-04-29 19:07:29 +02:00
Juergen Hoeller e510f6393a Polishing 2014-04-29 15:45:56 +02:00
Juergen Hoeller a0658c5832 AbstractAdvisingBeanPostProcessor uses target class check for existing proxy but checks against actual exposed object otherwise (catching introductions)
Issue: SPR-11725
2014-04-29 15:44:55 +02:00
Juergen Hoeller be5f2a8b4e Polishing 2014-04-28 23:37:07 +02:00
Juergen Hoeller ab24dda4ff Revised @PropertySource parsing for consistent PropertySource naming, avoiding accidental overriding by name
Issue: SPR-11637
2014-04-28 23:24:57 +02:00
Juergen Hoeller 299776fd80 Test for overriding singleton @Bean method with scoped proxy in configuration subclass
Issue: SPR-10744
2014-04-28 14:02:02 +02:00
Juergen Hoeller 6f2e61b19f Polishing
(cherry picked from commit c97c246)
2014-04-28 00:47:50 +02:00
Juergen Hoeller 6cb45f714e General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
(cherry picked from commit 59cef3c)
2014-04-28 00:47:21 +02:00
Juergen Hoeller ce1954da1e Configuration class processing explicitly skips java.* classes since we'll never find @Bean annotations there anyway
Issue: SPR-11718
(cherry picked from commit c8ea80d)
2014-04-28 00:33:14 +02:00
Juergen Hoeller 310bdbcb15 @Bean processing explicitly ignores bridge methods (for method overrides with return type narrowing on JDK 8)
Issue: SPR-11718
(cherry picked from commit 656fc52)
2014-04-28 00:33:04 +02:00
Juergen Hoeller 9353332a61 Polishing 2014-04-23 23:55:43 +02:00
Stephane Nicoll 5559209233 Remove useless imports 2014-04-22 09:57:12 +02:00
Juergen Hoeller 48c977afdc Polishing 2014-04-17 21:19:47 +02:00
Juergen Hoeller 4612559446 Automated tests against Hibernate ORM 4.3 and Hibernate Validator 5
Issue: SPR-11704
2014-04-17 16:24:10 +02:00
Stephane Nicoll 713dd60fa7 JMS annotation-driven endpoints.
This commit adds the support of JMS annotated endpoint. Can be
activated both by @EnableJms or <jms:annotation-driven/> and
detects methods of managed beans annotated with @JmsListener,
either directly or through a meta-annotation.

Containers are created and managed under the cover by a registry
at application startup time. Container creation is delegated to a
JmsListenerContainerFactory that is identified by the containerFactory
attribute of the JmsListener annotation. Containers can be
retrieved from the registry using a custom id that can be specified
directly on the annotation.

A "factory-id" attribute is available on the container element of
the XML namespace. When it is present, the configuration defined at
the namespace level is used to build a JmsListenerContainerFactory
that is exposed with the value of the "factory-id" attribute. This can
be used as a smooth migration path for users having listener containers
defined at the namespace level. It is also possible to migrate all
listeners to annotated endpoints and yet keep the
<jms:listener-container> or <jms:jca-listener-container> element to
share the container configuration.

The configuration can be fine-tuned by implementing the
JmsListenerConfigurer interface which gives access to the registrar
used to register endpoints. This includes a programmatic registration
of endpoints in complement to the declarative approach. A default
JmsListenerContainerFactory can also be specified to be used if no
containerFactory has been set on the annotation.

Annotated methods can have flexible method arguments that are similar
to what @MessageMapping provides. In particular, jms listener endpoint
methods can fully use the messaging abstraction, including convenient
header accessors. It is also possible to inject the raw
javax.jms.Message and the Session for more advanced use cases. The
payload can be injected as long as the conversion service is able to
convert it from the original type of the JMS payload. By
default, a DefaultJmsHandlerMethodFactory is used but it can be
configured further to support additional method arguments or to
customize conversion and validation support.

The return type of an annotated method can also be an instance of
Spring's Message abstraction. Instead of just converting the payload,
such response type allows to communicate standard and custom headers.

The JmsHeaderMapper infrastructure from Spring integration has also
been migrated to the Spring framework. SimpleJmsHeaderMapper is based
on SI's DefaultJmsHeaderMapper. The simple implementation maps all
JMS headers so that the generated Message abstraction has all the
information stored in the protocol specific message.

Issue: SPR-9882
2014-04-17 09:16:06 +02:00
Juergen Hoeller 90309ab0b5 CglibAopProxy detects package-visible methods when defined in a different ClassLoader
Issue: SPR-11618
2014-04-16 18:07:10 +02:00