Commit Graph

760 Commits

Author SHA1 Message Date
Juergen Hoeller 706d3adf07 Consistently throw IllegalStateException from getAutowireCapableBeanFactory()
Issue: SPR-12932
2015-04-24 23:20:43 +02:00
Sam Brannen 122d3476d9 Polish Javadoc for condition annotation attributes 2015-04-24 01:38:13 +02:00
Sam Brannen ad6bea1cda Support abstract, bridge, & interface methods in AnnotatedElementUtils
This commit introduces support for finding annotations on abstract,
bridge, and interface methods in AnnotatedElementUtils.

 - Introduced dedicated findAnnotationAttributes() methods in
   AnnotatedElementUtils that provide first-class support for
   processing methods, class hierarchies, interfaces, bridge methods,
   etc.

 - Introduced find/get search algorithm dichotomy in
   AnnotatedElementUtils which is visible in the public API as well as
   in the internal implementation. This was necessary in order to
   maintain backwards compatibility with the existing API (even though
   it was undocumented).

 - Reverted all recent changes made to the "get semantics" search
   algorithm in AnnotatedElementUtils in order to ensure backwards
   compatibility, and reverted recent changes to
   JtaTransactionAnnotationParser and SpringTransactionAnnotationParser
   accordingly.

 - Documented internal AnnotatedElementUtils.Processor<T> interface.

 - Enabled failing tests and introduced
   findAnnotationAttributesFromBridgeMethod() test in
   AnnotatedElementUtilsTests.

 - Refactored ApplicationListenerMethodAdapter.getCondition() and
   enabled failing test in TransactionalEventListenerTests.

 - AnnotationUtils.isInterfaceWithAnnotatedMethods() is now package
   private.

Issue: SPR-12738, SPR-11514, SPR-11598
2015-04-24 00:55:48 +02:00
Sam Brannen e0d2dbd21d Polish Javadoc & TODOs in ApplicationListenerMethodAdapter
Issue: SPR-12738
2015-04-23 01:33:47 +02:00
Sam Brannen 86733a98da Polish ApplicationListenerMethodAdapter 2015-04-22 02:54:23 +02:00
Juergen Hoeller 9ed0a56d84 AbstractApplicationContext collects early ApplicationEvents and publishes them once the multicaster is available
Issue: SPR-12902
2015-04-16 18:16:15 +02:00
Juergen Hoeller aa49949d7a Bean type mismatch check accepts assignable values according to ClassUtils
Issue: SPR-12905
2015-04-16 18:15:33 +02:00
Juergen Hoeller e403aefe86 Proper exception in case of an @Bean method call encountering a bean type mismatch
Issue: SPR-12905
2015-04-15 23:37:51 +02:00
Juergen Hoeller 1da98b0542 @Bean-returned FactoryBean proxy delegates to actual target instance now
Issue: SPR-12915
2015-04-15 22:49:53 +02:00
Sam Brannen 96e6406b4b Clarify semantics for multiple profiles in @Profile 2015-04-15 21:56:31 +02:00
Juergen Hoeller fafb823e8d Polishing 2015-04-15 15:13:42 +02:00
Stephane Nicoll e5b505224b Improve exception message
Issue: SPR-12898
2015-04-10 09:20:51 +02:00
Stephane Nicoll 6bc14cc7ae Add cache-related logs
Add a trace log for cache hit and cache miss events.

Issue: SPR-11654
2015-04-07 14:27:43 +02:00
Juergen Hoeller 595cdf05e9 Polishing 2015-04-04 00:23:25 +02:00
Juergen Hoeller e1395a6c68 Avoid repeated exposure of SpringProxy/Advised for fallback interfaces as well
Issue: SPR-12870
2015-04-01 18:54:47 +02:00
Juergen Hoeller 2c637dcb2e ReaderEditor supports Reader injection analogous to InputStreamEditor (from Spring resource location)
Also, EncodedResource implements InputStreamSource now since it declares getInputStream() anyway.

Issue: SPR-12876
2015-04-01 17:02:55 +02:00
Juergen Hoeller ceb17fcaca CronSequenceGenerator explicitly rejects invalid incrementer delta
Issue: SPR-12871
2015-04-01 16:45:24 +02:00
Juergen Hoeller f9c2d1d171 DefaultAopProxyFactory falls back to JdkDynamicAopProxy when encountering JDK proxy as target
Issue: SPR-12870
2015-03-31 16:15:22 +02:00
Juergen Hoeller a15dc08bea @Import allows for importing regular component classes as well
Issue: SPR-11740
2015-03-31 11:39:20 +02:00
Juergen Hoeller 14c891c3b3 MethodValidationPostProcessor provides protected createMethodValidationAdvice template method
Issue: SPR-12863
2015-03-31 10:12:35 +02:00
Juergen Hoeller 7e22623758 Clarification: Lifecycle does not imply auto-startup semantics
Issue: SPR-12855
2015-03-30 21:06:12 +02:00
Juergen Hoeller beae336627 Polishing 2015-03-25 15:22:41 +01:00
Stephane Nicoll 314b069fd8 Only require an exception CacheResolver if necessary
Previously, a cache infrastructure with only a CacheResolver would have
worked fine until the JSR-107 API is added to the classpath. When this is
the case, the JCache support kicks in and an exception cache resolver is
all of the sudden required.

The CacheResolver _is_ different as the default implementation does look
different attributes so if a custom CacheResolver is set, it is not
possible to "reuse" it as a fallback exception CacheResolver.

Now, an exception CacheResolver is only required if a JSR-107 annotation
with an "exceptionCacheName" attribute is processed (i.e. the exception
CacheResolver is lazily instantiated if necessary).

The use case of having a CachingConfigurerSupport with only a
CacheResolver was still broken though since the JCache support only looks
for a JCacheConfigurer bean (per the generic type set on
AbstractCachingConfiguration). This has been fixed as well.

Issue: SPR-12850
2015-03-25 15:12:08 +01:00
Juergen Hoeller d23893fd25 Consistent javadoc param declarations for type variables 2015-03-25 00:44:01 +01:00
Juergen Hoeller b2308926bc Restored isTypeMatch null behavior and refined typeToMatch parameter name
Issue: SPR-12147
2015-03-23 21:57:03 +01:00
Juergen Hoeller 1a8c6fa5ee Deferred import processing reliably detects late registration attempts
Issue: SPR-12838
2015-03-23 19:58:02 +01:00
Juergen Hoeller 192462902e Consistent support for Java 8 default methods (in interfaces implemented by user classes)
Covers ReflectionUtils.doWithMethods as well as affected annotation post-processors.
Includes an extension of MethodMetadata for the detection of @Bean default methods.

Issue: SPR-12822
Issue: SPR-10919
2015-03-19 16:50:15 +01:00
Juergen Hoeller 778a01943b ResolvableType-based type matching at the BeanFactory API level
Issue: SPR-12147
2015-03-18 23:05:13 +01:00
Juergen Hoeller a3e5fbf5ed Revised DefaultManagedAwareThreadFactory to make its non-JNDI fallback work
Issue: SPR-12830
2015-03-18 21:21:46 +01:00
Juergen Hoeller c43acd7675 SpringValidatorAdapter allows for fine-tuning the FieldError representation
Issue: SPR-12819
2015-03-16 21:01:18 +01:00
Juergen Hoeller 768f6e836a Bean class name may contain SpEL expression for late resolution
Issue: SPR-12817
2015-03-16 20:53:41 +01:00
Juergen Hoeller 6c169bd644 Initial support for JSR-354 Money & Currency
Issue: SPR-12209
2015-03-13 19:40:00 +01:00
Juergen Hoeller 13659d645b Consistent support for @Order annotation as alternative to Ordered interface
Issue: SPR-12806
2015-03-13 18:18:33 +01:00
Juergen Hoeller f5b4e18209 @Configuration classes get processed according to their @Order (if applicable)
Issue: SPR-12657
2015-03-13 18:18:21 +01:00
Juergen Hoeller 9d497cbd98 @Bean definitions override scanned classes, plus check whether overriding is actually allowed
Issue: SPR-9567
Issue: SPR-9682
2015-03-13 18:18:06 +01:00
Stephane Nicoll 8f8a85912a Call AsyncUncaughtExceptionHandler when necessary
If a sub-class of Future (such as ListenableFuture) is used as a return
type and an exception is thrown, the AsyncUncaughtExceptionHandler is
called. Now checking for any Future implementation instead of a faulty
strict matching.

Issue: SPR-12797
2015-03-09 09:57:53 +01:00
Sam Brannen d90cee78ef Remove trailing whitespace in source code 2015-03-07 21:16:18 +01:00
Kazuki Shimizu c746b10da9 Support @NumberFormat as a meta-annotation
This commit ensures that @NumberFormat can be used as a
meta-annotation, as was already the case for @DateTimeFormat.

In addition, this commit polishes FormattingConversionServiceTests and
MvcNamespaceTests.

Issue: SPR-12743
2015-03-07 21:00:25 +01:00
Sam Brannen 789d904658 Assume TestGroup.PERFORMANCE for AnnotationProcessorPerformanceTests
This commit applies the TestGroup.PERFORMANCE assumption for all test
methods within AnnotationProcessorPerformanceTests.
2015-03-07 15:43:09 +01:00
Juergen Hoeller 71cdf856e1 (Reloadable)ResourceBundleMessageSource allows for custom PropertyResourceBundle/Properties subclasses
Issue: SPR-12666
2015-03-06 17:45:37 +01:00
Juergen Hoeller b541fc9366 Polishing 2015-03-05 18:56:57 +01:00
Stephane Nicoll 772a26a743 polishing
Issue: SPR-12761
2015-03-05 15:36:08 +01:00
Stephane Nicoll 31df7155ab Refine BeanPostProcessorChecker condition
Previously, adding `@EnableAsync` on a blank application would lead to an
info message stating that `ProxyAsyncConfiguration` is not eligible for
getting processed by all BeanPostProcessors. Concretely, this is ok as
such internal configuration is not meant to be a target of such post
processing.

Revisit the condition for non infrastructure bean only. Add the
infrastructure role to a set of internal configuration, including the
`ProxyAsyncConfiguration`.

Issue: SPR-12761
2015-03-05 11:37:11 +01:00
Juergen Hoeller fdd1f83639 Polishing
(cherry picked from commit 3783591)
2015-03-02 22:05:16 +01:00
Juergen Hoeller ab2c721875 LoadTimeWeavingConfiguration should not rely on private field injection
Issue: SPR-12776
(cherry picked from commit 1259671)
2015-03-02 21:58:01 +01:00
Sam Brannen 7edc7c2c8f Fully support XML config in GroovyBeanDefinitionReader
Prior to this commit, the GroovyBeanDefinitionReader claimed (via its
Javadoc) that it fully supported XML configuration files in addition to
its Groovy DSL; however, this was unfortunately inaccurate since XML
validation was disabled by default which led to certain features of XML
configuration not working. For example, it was impossible to define a
<qualifier> in an XML config file without specifying the 'type'
attribute (which has a default value defined in the spring-beans XSD).

This commit fixes this issue by ensuring that bean definitions in XML
resources are loaded with a "standard" XmlBeanDefinitionReader that is
created with default settings (i.e., with XML validation enabled). With
regard to backwards compatibility, bean definitions defined using the
Groovy DSL are still loaded with an XmlBeanDefinitionReader that has
XML validation disabled by default which is necessary for proper
parsing of the Groovy DSL.

Issue: SPR-12769
2015-02-28 23:12:13 +01:00
Stephane Nicoll babbf6e871 Harmonize resources location
Issue: SPR-12766
2015-02-28 10:32:40 +01:00
Juergen Hoeller 2b3409461f Polishing 2015-02-27 22:29:42 +01:00
Sam Brannen fcd60b269e Polish ScheduledTaskRegistrar(Tests) 2015-02-27 19:26:17 +01:00
Juergen Hoeller 81102deedf Avoid potential deadlocks between event multicaster and singleton registry through shared lock
Issue: SPR-12739
2015-02-26 18:35:06 +01:00