Commit Graph

1090 Commits

Author SHA1 Message Date
Chris Beams 980c15d578 Distinguish between different bridge method types
Add BridgeMethodResolver#isJava6VisibilityBridgeMethodPair to
distinguish between (a) bridge methods introduced in Java 6 to
compensate for inheriting public methods from non-public superclasses
and (b) bridge methods that have existed since Java 5 to accommodate
return type covariance and generic parameters.

In the former case, annotations should be looked up from the original
bridged method (SPR-7900).  In the latter, the annotation should be
looked up against the bridge method itself (SPR-8660).

As noted in the Javadoc for the new method, see
http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html
for a useful description of the various types of bridge methods, as
well as http://bugs.sun.com/view_bug.do?bug_id=6342411, the bug fixed in
Java 6 resulting in the introduction of 'visibility bridge methods'.

Issue: SPR-8660, SPR-7900
2011-10-10 05:40:21 +00:00
Chris Beams 6837111bda Refactor AnnotationUtils#findAllAnnotationAttributes
Remove all convenience variants of #findAllAnnotationAttributes and
refactor the remaining method to accept a MetadataReaderFactory
instead of creating its own SimpleMetadataReaderFactory internally.
This allows clients to use non-default class loaders as well as
customize the particular MetadataReaderFactory to be used (e.g.
'simple' vs 'caching', etc).

Issue: SPR-8752
2011-10-09 20:32:21 +00:00
Chris Beams d122ecb42e Move AdviceMode from .config to .annotation package 2011-10-09 07:55:08 +00:00
Chris Beams 1819bee35f Revert deprecation of AbstractSingletonPFB and co
Removed formal deprecation warnings for AbstractSingletonFactoryBean and
its TransactionProxyFactoryBean and CacheProxyFactoryBean subclasses.

This is principally because TPFB is still used by Grails and could
conceivably be used to good effect by any third-party framework in a
similar fashion. CPFB is new with 3.1, but similar use is predictable.

Deprecations have been replaced by strong recommendations that users
avoid these types in modern Spring applications and favor the use of
namespaces and annotatinos, such as tx: and @Transactional (around
since Spring 2.x) and cache: and @Cacheable.

Issue: SPR-8680, SPR-8686
2011-10-09 07:54:54 +00:00
Chris Beams 870d903417 Add INFER_METHOD constant and update @Bean Javadoc
In anticipation of 'destroy method inference' feature, introduce
ConfigurationClassUtils#INFER_METHOD and update @Bean#destroyMethod to
reflect its use.

Issue: SPR-8751
2011-10-09 07:54:39 +00:00
Chris Beams 6b4ef0237c Add code examples to and polish @Bean Javadoc 2011-10-09 07:54:33 +00:00
Costin Leau 40d88fd991 SPR-8730
+ more tests
2011-10-07 20:16:58 +00:00
Costin Leau a12ebbfded SPR-8730
+ expose key-generator in the XML namespace
2011-10-07 19:45:05 +00:00
Sam Brannen aa7a100807 [SPR-8178] re-enabled testPrintNull(). 2011-09-26 18:59:11 +00:00
Rossen Stoyanchev 3d50d416eb SPR-8718 Revert fix from earlier for now (need a different approach). 2011-09-26 17:58:49 +00:00
Sam Brannen 5309e43ea0 [SPR-8178] @Ignore-ing testPrintNull() until it is determined why changes to GenericConversionService broke this test. 2011-09-26 17:39:04 +00:00
Sam Brannen 052d3e7ccb [SPR-8718] now using correct JIRA ID in the comments. 2011-09-26 16:28:34 +00:00
Sam Brannen f752b47fcb [SPR-8178] @Ignore-ing testDefaultNumberFormatting() until it is determined why changes to GenericConversionService broke this test. 2011-09-26 16:24:51 +00:00
Chris Beams 15a8f776b9 Clarify stereotype and exception translation Javadoc
Cite original inspiriation by Domain-Driven Design, but make clear the
flexible and general-purpose nature of Spring's stereotype annotations
such as @Repository and @Service.

Also update @Repository Javadoc with more explicit instructions about
switching on exception translation through use of
PersistenceExceptionTranslationPostProcessor, and update PETPP Javadoc
for style as well as concrete examples of 'resource factories' that
implement the PersistenceExceptionTranslator interface

Issue: SPR-8691
2011-09-13 17:53:15 +00:00
Keith Donald 1a2f96000e clarified repository definition from DDD and removed comparison with DAO to reduce confusion 2011-09-13 14:31:41 +00:00
Chris Beams 2e5f3559d3 Fix handling of @EnableLoadTimeWeaving AUTODETECT
Issue: SPR-8643
2011-09-03 22:37:16 +00:00
Costin Leau d9de19d7b3 SPR-8653
+ refactor a bit the internals of CacheAspect to allow invocations that do not throw any exceptions (AspectJ)
2011-09-02 15:37:42 +00:00
Sam Brannen 1de71c6e37 [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
Chris Beams 6db594c79d Register JndiPropertySource by default in servlet environments
Prior to this change, StandardServletEnvironment evaluated a
"jndiPropertySourceEnabled" flag to determine whether or not to add a
JndiPropertySource.  Following the changes introduced in SPR-8490, there
is now no reason not to enable a JNDI property source by default. This
change eliminates the support for "jndiPropertySourceEnabled" and adds
a JndiPropertySource automatically.

Issue: SPR-8545, SPR-8490
2011-08-20 03:02:31 +00:00
Chris Beams 36c1813828 Update ejb, inject-tck, jsr166 deps in context pom 2011-08-20 03:01:49 +00:00
Juergen Hoeller 90997e65cf fixed Hibernate Validator import range 2011-08-18 23:13:56 +00:00
Juergen Hoeller 9e375a860a polishing 2011-08-18 23:13:30 +00:00
Sam Brannen 87dad65ff0 [SPR-8622] Upgraded to JUnit 4.8.2 2011-08-18 16:06:31 +00:00
Sam Brannen 7f715ee803 Fixed minor typo in Javadoc. 2011-08-18 14:18:29 +00:00
Juergen Hoeller 28e6d9a692 added test for month sequence (SPR-7807) 2011-08-17 21:01:34 +00:00
Costin Leau 63a217a40a + add XML support for cache abstraction (cache-advice) - DRAFT 2011-08-16 17:35:01 +00:00
Juergen Hoeller 4acb0fa284 introduced ForkJoinPoolFactoryBean for Java 7 (alternative: add new jsr166.jar to Java 6) 2011-08-15 16:41:55 +00:00
Sam Brannen 2d6340af74 Deleting unnecessary TODOs and suppressing warnings. 2011-08-13 13:38:54 +00:00
Juergen Hoeller b9ebdd28fb polishing 2011-08-12 10:02:12 +00:00
Chris Beams 6404440cbf Fix typo in SmartLifecycle Javadoc
Issue: SPR-8570
2011-08-04 14:07:36 +00:00
Chris Beams 272f145132 Clarify Lifecycle#stop documentation
Issue: SPR-8570
2011-08-03 06:01:20 +00:00
Chris Beams 35d2ab3bf9 Document Lifecycle#stop concurrency semantics
Issue: SPR-8570
2011-07-29 21:39:42 +00:00
Juergen Hoeller 39616d4a25 polishing 2011-07-28 20:26:34 +00:00
Chris Beams b85440f2b6 Deprecate AbstractSingletonProxyFactoryBean 2011-07-26 22:29:14 +00:00
Chris Beams 3c2e48738a Remove CacheProxyFactoryBean 2011-07-26 22:29:09 +00:00
Chris Beams 2b371a7c9a Deprecate TransactionProxyFactoryBean 2011-07-26 22:29:04 +00:00
Juergen Hoeller abdae3d26b general revision of cache package; added ConcurrentMapCacheManager 2011-07-22 09:32:56 +00:00
Juergen Hoeller 48de81deec refined JBoss 6.0 note 2011-07-21 09:51:23 +00:00
Juergen Hoeller 7d8aa05c40 added "acceptProxyClasses" flag to RemoteInvocationSerializingExporter 2011-07-21 09:04:42 +00:00
Juergen Hoeller 2c199cf190 updated javadoc for server-specific LoadTimeWeavers 2011-07-21 08:36:40 +00:00
Chris Beams 718f025d64 Force lazy-init to false when parsing scheduled:task
A <scheduled:task> element declared within a
<beans default-lazy-init="true"> element represents a contradiction in
terms: such a task will never be executed.

For this reason, we now override any inherited lazy-init settings
when parsing <scheduled:task> elements, forcing lazy-init to false
for the underlying ScheduledTaskRegistrar bean.

Thanks to Mike Youngstrom for contributing an initial patch.

Issue: SPR-8498
2011-07-19 23:00:12 +00:00
Costin Leau 1d690ab99f SPR-8533
+ add LTW support for JBoss 7
(renamed existing classes to MC (JBoss 5&6) and introduced Modules (JBoss 7))
2011-07-19 07:24:47 +00:00
Juergen Hoeller d97a5bf889 minor javadoc revision 2011-07-18 21:50:15 +00:00
Juergen Hoeller 94ac883eb1 polishing 2011-07-18 21:37:24 +00:00
Chris Beams 236b0305e8 Refactor execution of config class enhancement
This change returns the invocation order of
ConfigurationClassPostProcessor#enhanceConfigurationClasses to its
pre-3.1 M2 state. An earlier (and now unnecessary) refactoring in
service of @Feature method processing caused the change that this now
reverts.
2011-07-18 21:23:55 +00:00
Juergen Hoeller c0e429a9a5 polishing 2011-07-15 14:48:51 +00:00
Juergen Hoeller 5937779bb1 call setEnvironment before other awareness methods rather than after; fixed AccessControlContext applicability check 2011-07-15 14:40:38 +00:00
Costin Leau 4e1cb2b823 move default value wrapper into support package (rather then interceptor) 2011-07-15 14:13:22 +00:00
Chris Beams fd42a65c6c Allow ConfigurationCPP to process multiple registries
Prior to this change, an instance of ConfigurationClassPostProcessor
would throw IllegalStateException if its
postProcessBeanDefinitionRegistry method were called more than once.
This check is important to ensure that @Configuration classes are
not proxied by CGLIB multiple times, and works for most normal use
cases.

However, if the same CCPP instance is used to process multiple
registries/factories/contexts, this check creates a false negative
because it does not distinguish between invocations of
postProcessBeanDefinitionRegistry across different registries.

A use case for this, though admittedly uncommon, would be creating
a CCPP instance and registering it via
ConfigurableApplicationContext#addBeanDefinitionPostProcessor against
several ApplicationContexts. In such a case, the same CCPP instance
will post-process multiple different registry instances, and throw the
above mentioned exception.

With this change, CCPP now performs lightweight tracking of the
registries/beanFactories that it has already processed by recording
the identity hashcodes of these objects.  This is only slightly more
complex than the previous boolean-based 'already processed' flags, and
prevents this issue (however rare it may be) from occurring.

Issue: SPR-8527
2011-07-13 23:30:57 +00:00
Chris Beams c5463a2e52 Move ImportSelector.Context to a top-level class
Issue: SPR-8411, SPR-8494
2011-07-13 23:28:53 +00:00