Commit Graph

785 Commits

Author SHA1 Message Date
Juergen Hoeller 9fc13e1d23 CacheAspectSupport checks Cache.get(key) once per invocation only
Issue: SPR-11592
2014-03-25 23:56:16 +01:00
Juergen Hoeller 8b73c0affb Added ASM-based tests for custom scoping annotations
Issue: SPR-11574
2014-03-24 11:51:21 +01:00
Juergen Hoeller 3aff973d13 Javadoc: @ComponentScan is subject to @Conditional as well
Issue: SPR-11579
2014-03-21 14:32:57 +01:00
Stephane Nicoll 4cd818b9e4 Harmonize log configuration
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.
2014-03-20 09:43:29 -07:00
Sam Brannen 9cee70ff66 Polish ComponentScanParserTests and clean up warnings 2014-03-20 01:28:59 +01:00
Sam Brannen 99cd2f6098 Support meta-annotation overrides in ASM processing
Prior to this commit, Spring supported meta-annotation attribute
overrides in custom composed annotations with reflection-based
annotation processing but not with ASM-based annotation processing.

This commit ensures that meta-annotation attribute overrides are
supported in AnnotationMetadataReadingVisitor.getAnnotationAttributes().

Issue: SPR-11574
2014-03-19 23:44:13 +01:00
Sam Brannen b640b9fdfe Update TODOs for SPR-11574
Issue: SPR-11574
2014-03-18 18:33:26 +01:00
Sam Brannen 9ce0df89ff Support Class meta-annotation attributes with ASM
Prior to this commit, AnnotationAttributesReadingVisitor treated Class
annotation attributes as Strings instead of Classes. As a result,
look-ups for Class attributes in meta-annotations failed with an
IllegalArgumentException.

This commit fixes this issue by consistently treating Class attributes
as Classes in AnnotationAttributesReadingVisitor.

Issue: SPR-11557
2014-03-18 18:20:15 +01:00
Juergen Hoeller 38e7c4776b Cache.get(key, type) should also work in case of null value found in cache
Issue: SPR-11567
2014-03-18 00:50:59 +01:00
Sam Brannen e7b8a657b4 Add more tests for @ComponentScan as a meta-annotation
Issue: SPR-11557
2014-03-15 15:28:17 +01:00
Sam Brannen f1fbe85ff1 Investigate issue with @ComponentScan as meta-annotation
This commit introduces unit and integration tests that attempt to
reproduce the issue claimed by the reporter in SPR-11557. However, the
tests pass without any problems.

Issue: SPR-11557
2014-03-15 00:04:53 +01:00
Sam Brannen 3d506eb033 Clean up ConfigurationClassPostProcessorTests 2014-03-14 22:34:11 +01:00
Juergen Hoeller 99ea429fd7 Added specific unit test for scoped-proxy target not being an autowire candidate
Issue: SPR-11548
2014-03-14 20:40:24 +01:00
Juergen Hoeller 5308b3e358 Revised naming for prototype inner beans to avoid excessive unique name calculation
Restored original singleton-only adaptInnerBeanName behavior, avoiding endless unique name calculation for every single prototype instance. Non-named inner BeanDefinition objects now suffixed with an identity hex code analogous to non-named XML bean definitions, largely avoiding naming collisions to begin with. After SPR-11246, post-processors can deal with unstable classes per bean name, so occasional collisions aren't a hard problem anymore.

Issue: SPR-11545
2014-03-14 20:38:09 +01:00
Juergen Hoeller 791f58e6be Polishing 2014-03-13 17:31:39 +01:00
Sam Brannen a006ca2542 Remove trailing whitespace 2014-03-13 12:21:32 +01:00
Sam Brannen b364599278 Update links to Spring JIRA server 2014-03-10 12:26:29 +01:00
Juergen Hoeller bcde955ec9 Ignore placeholder resolution failure as well in case of ignoreResourceNotFound=true
Issue: SPR-11524
2014-03-07 13:39:01 +01:00
Juergen Hoeller e50cff47c1 KeyGenerators should not return a plain array parameter as raw key but rather always handle that case in a deepHashCode fashion
Issue: SPR-11505
2014-03-05 17:37:09 +01:00
Stephane Nicoll c146be2eb7 Merge pull request #477 from candrews/patch-1
* patch-1:
  Fix SimpleKey equality with array argument
2014-03-04 14:24:03 +01:00
Craig Andrews 6d8f3a0a20 Fix SimpleKey equality with array argument
Prior to this commit, an array argument was not handled properly in
SimpleKey#equals and SimpleKey#hashCode. As a result, two method
invocations with the same array argument lead to two different keys
and therefore two different entries in the cache.

This commit uses deepEquals and deepHashCode to properly handle
methods that have arguments that are array types.

Issue: SPR-11505
2014-03-04 14:18:11 +01:00
Juergen Hoeller cb41f42791 AbstractApplicationEventMulticaster filters listeners against their type first, avoiding eager retrieval of listener instances for non-matching events
Issue: SPR-11501
2014-03-04 13:31:40 +01:00
Sam Brannen fbdebc1bd6 Clean up warnings that show up in Gradle build 2014-02-26 14:05:26 +01:00
Sam Brannen 1ac08e4a1b Polish Javadoc for ConfigurationClassParser 2014-02-26 02:22:32 +01:00
Sam Brannen ce0d916492 Fix 'method' typo in @PropertySources 2014-02-25 15:56:39 +01:00
Juergen Hoeller 8a96d1a6ee Polishing 2014-02-14 23:40:03 +01:00
Juergen Hoeller 14e5a02870 Mixed polishing along with recent changes 2014-02-14 21:39:40 +01:00
Juergen Hoeller d550ffb37f Clarified CompositeCacheManager's applicability, added convenience constructor with given delegates, and fixed getCacheNames implementation to never return duplicates
Issue: SPR-11427
2014-02-14 01:41:53 +01:00
Sam Brannen 8028eae786 Fix CGLIB memory leak for method injection
This commit continues the work for fixing memory leaks resulting from
CGLIB subclass generation for beans relying on method injection.

- Set proxy callbacks on the CGLIB Factory (i.e., the instance) instead
  of in the generated subclass (i.e., via the Enhancer).

- Convert private inner classes in CglibSubclassingInstantiationStrategy
  to private static classes in order to avoid unnecessary coupling to
  classes generated using CGLIB.

- Tidy up XmlBeanFactoryTests.

- Update logic in serializableMethodReplacerAndSuperclass() so that it
  finally aligns with the decision made for SPR-356.

Issue: SPR-10785, SPR-356
2014-02-13 01:45:41 +01:00
Sam Brannen f2a4537b6c Test against CGLIB memory leak for method injection
This commit introduces a test in XmlBeanFactoryTests that verifies that
CGLIB generated subclasses for method injected beans are reused across
bean factories for identical bean definitions. In other words, by
verifying that the same CGLIB generated class is reused for identical
bean definitions, we can be certain that Spring is no longer generating
identical, duplicate classes that consume memory in the VM.

Issue: SPR-10785, SPR-11420
2014-02-13 00:28:37 +01:00
Juergen Hoeller 949338009b Ignore container callback and marker interfaces for auto-proxy decisions
Issue: SPR-11416
2014-02-12 00:01:20 +01:00
Juergen Hoeller 53aab24690 Polishing 2014-02-09 01:08:56 +01:00
Sam Brannen c335e99e3f Remove trailing whitespace from source code 2014-02-08 17:30:39 +01:00
Sam Brannen 1f778530b5 Polish test classes
- Consistent importing of org.junit.Assert.*;
- Proper declaration of expected exceptions via @Test(expected).
- Renamed SpEL ExpressionTestCase to AbstractExpressionTests.
- Formatting and test method naming conventions.
2014-02-08 17:24:11 +01:00
Juergen Hoeller 8c0e3040c2 Polishing 2014-02-07 18:06:13 +01:00
Juergen Hoeller 749b65b0b2 Polishing 2014-02-07 17:42:37 +01:00
Sam Brannen de5b7a378b Fix grammar and update link in Javadoc for SimpleThreadScope 2014-02-07 12:27:35 +01:00
Dave Brosius cdd2324ab5 fix log spelling typo 2014-02-06 19:58:20 -05:00
Juergen Hoeller 426f52b393 Polishing 2014-02-06 20:35:59 +01:00
Juergen Hoeller 8c4e372558 Introduced SpringNamingPolicy for CGLIB
Issue: SPR-11398
2014-02-06 20:25:11 +01:00
Sam Brannen b8ed2f4967 Ensure all tests are executed in the Gradle build
Prior to this commit several test classes named "*Test" were not
recognized as tests by the Gradle build. This is due to the configured
inclusion of '**/*Tests.*' which follows Spring's naming convention for
test classes.

This commit addresses this issue by:

 - Renaming real test classes consistently to "*Tests".
 - Renaming internal test classes to "*TestCase".
 - Renaming @WebTest to @WebTestStereotype.
 - Disabling broken tests in AnnoDrivenStaticEntityMockingControlTest.
 - Modifying the Gradle build configuration so that classes ending in
   either "*Tests" or "*Test" are considered test classes.

Issue: SPR-11384
2014-02-03 23:16:47 +01:00
Juergen Hoeller 5be8301128 Fixed isMatchingFieldError to properly handle empty field name
Also avoided unnecessary substring creation for field error access with wildcard.

Issue: SPR-11374
2014-01-31 12:47:08 +01:00
Juergen Hoeller c1eac209c3 Fixed LiveBeansView to not produce invalid JSON if last bean is not eligible
Also introducing overridable isBeanEligible template method.

Issue: SPR-11366
2014-01-30 12:26:22 +01:00
Sam Brannen 78542777d6 Introduce value attribute in @RestController
Stereotype annotations should support a 'value' attribute for
specifying the name of the Spring-managed component; however,
@RestController currently does not provide such an attribute.

This commit introduces a 'value' attribute in @RestController so that
developers can provide custom names for components annotated with
@RestController.

Issue: SPR-11360
2014-01-27 12:07:23 +01:00
Juergen Hoeller 61b6d398a5 Removed LocalDateToDateMidnightConverter pre-release since DateMidnight is deprecated as of Joda-Time 2.3; marked DateTimeToDateMidnightConverter as deprecated 2014-01-25 15:26:47 +01:00
Juergen Hoeller eeae5fba95 Fixed regression with constructing TypeDescriptor from null Class
Issue: SPR-11354
2014-01-24 13:16:35 +01:00
Sam Brannen 8faf01f56d Fix "coercion" spelling mistakes in Javadoc 2014-01-23 17:47:35 +01:00
Juergen Hoeller 3310ab55e0 Polishing
Issue: SPR-11344
(cherry picked from commit d434ef9)
2014-01-23 00:10:02 +01:00
Juergen Hoeller 12c393eb6d Switched 'order' attributes across namespaces to 'xsd:token'
Issue: SPR-10886
Issue: SPR-7342
2014-01-22 11:35:21 +01:00
Juergen Hoeller 84310c8a11 RemoteInvocation(Result) explicitly designed for JavaBean-style deserialization
Issue: SPR-11337
2014-01-21 12:49:16 +01:00
Juergen Hoeller 709ac28f29 Consider wildcard type without bounds as eligible for fallback match too
Issue: SPR-11250
2014-01-21 01:26:30 +01:00
Juergen Hoeller 26271fc30c Polishing 2014-01-13 23:45:54 +01:00
Juergen Hoeller 547646de6d Polishing 2014-01-13 22:25:34 +01:00
Juergen Hoeller cdd65a70af Added compatibility note on WildFly 8 2014-01-13 22:14:51 +01:00
Juergen Hoeller 24d40fa3e0 Fixed resolveProxyTargetClass exception message 2014-01-13 22:14:27 +01:00
Juergen Hoeller bd87ff7f92 Removed TestGroup.LONG_RUNNING marker from Groovy and JRuby tests 2014-01-13 22:13:42 +01:00
Rossen Stoyanchev 5068eb2e01 Add minor optimization to AbstractErrors
Issue: SPR-11304
2014-01-13 14:05:25 -05:00
Juergen Hoeller ee2022e54c Polishing 2014-01-05 03:01:44 +01:00
Juergen Hoeller 0de307bb65 Consistent equals/hashCode/toString implementations in AnnotationMatchingPointcut/ClassFilter/MethodMatcher
Issue: SPR-11275
Issue: SPR-11276
2014-01-04 22:47:33 +01:00
Juergen Hoeller 640d8cb67f Consistent implementation of AsyncListenableTaskExecutor
Issue: SPR-11282
2014-01-03 21:57:07 +01:00
Juergen Hoeller 6a5a3c97ed Introduced OptionalValidatorFactoryBean for scenarios where the JSR-303 API is present but no Bean Validation Provider is available (used by the MVC namespace)
Issue: SPR-11272
2014-01-03 18:18:55 +01:00
Juergen Hoeller 8d1e55d101 Avoid hard reference to LocalValidatorFactoryBean in <mvc:annotation-driven> parser
Issue: SPR-11272
(cherry picked from commit c48da0d)
2014-01-03 16:38:22 +01:00
Juergen Hoeller f0d21510f5 Polishing
Issue: SPR-11259
2013-12-30 19:13:04 +01:00
Juergen Hoeller 5e00113c65 Added extensive default converters for JSR-310 value types
Also adding several further Joda-Time converters for consistency with JSR-310 converters.

Issue: SPR-11259
2013-12-30 19:10:34 +01:00
Sam Brannen 710fdc73f1 Polish Javadoc for Groovy bean support classes 2013-12-21 14:00:47 +01:00
Juergen Hoeller a884cde18c Upgraded to JCache 1.0 RC1
Also completing 4.0's consistency efforts between Spring's cache adapters.
2013-12-20 01:28:16 +01:00
Juergen Hoeller b1460742c3 InjectionMetadata caching per bean name needs to refresh when bean class changes
Issue: SPR-11246
2013-12-19 23:49:31 +01:00
Juergen Hoeller bfba53f958 Fixed handling of primitive vararg array in CacheOperationContext
Issue: SPR-11249
2013-12-19 19:15:57 +01:00
Juergen Hoeller 67abeb4722 SpEL performs String->String type conversion even within concatenated String
Issue: SPR-11215
2013-12-17 21:35:14 +01:00
Juergen Hoeller 23546b1234 Moved AnnotationBeanNameGenerator's String value check right before cast
Issue: SPR-11221
2013-12-17 12:39:24 +01:00
Juergen Hoeller 105e176a80 Fixed @Bean meta-annotation detection when using ASM
This turned out to be a bug in the ASM-based AnnotationMetadata implementation where has/getAnnotatedMethods didn't consider meta-annotations., in contrast to its StandardAnnotationMetadata sibling.

Issue: SPR-10488
2013-12-16 22:47:43 +01:00
Juergen Hoeller 61a3d04e91 Set scoped proxy role to same role as target definition
This allows scoped proxy definitions to override regular application bean definitions (again).

Issue: SPR-11229
2013-12-16 21:47:35 +01:00
Juergen Hoeller e2f85fc1d0 Defensively detect non-empty String fields in @Scheduled
Issue: SPR-11223
2013-12-16 21:45:40 +01:00
Juergen Hoeller b6970d3504 Removed obsolete JBoss 5.x support code from JBossLoadTimeWeaver 2013-12-16 20:21:34 +01:00
Sam Brannen 9eb58b9596 Polish Javadoc for ScopedProxyMode 2013-12-13 18:45:34 +01:00
Juergen Hoeller 21f680c861 Deprecated DefaultKeyGenerator
Issue: SPR-11210
2013-12-12 02:57:17 +01:00
Juergen Hoeller aa6e6c1349 Polishing 2013-12-11 22:58:23 +01:00
Juergen Hoeller 106a973a4d Prevent early FactoryBean creation for type checking purposes when coming from a factory method on yet another bean (e.g. from a configuration class)
Issue: SPR-11202
2013-12-11 22:57:22 +01:00
Juergen Hoeller 8d6d6be39a MBean registration happens in a fully synchronized fashion for consistent results
Issue: SPR-11002
2013-12-11 16:31:26 +01:00
Juergen Hoeller 161819f141 Component scanning ignores attributes and meta-annotations on non-public annotations
Issue: SPR-11091
2013-12-11 15:29:55 +01:00
Juergen Hoeller c5d797736b Added tests for custom qualifier annotations on scoped @Bean methods
Issue: SPR-11116
2013-12-10 22:35:34 +01:00
Juergen Hoeller eb1b3c5a68 Use bean-creating factory's AutowireCandidateResolver even for dependencies in parent factory
Specifically, if the current factory has Qualifier/ContextAnnotationAutowireCandidateResolver set up, it is important to pass it on to ancestor factories to get consistent qualifier matching results.

Issue: SPR-10966
2013-12-10 15:33:57 +01:00
Juergen Hoeller 4fe52d1953 Polishing 2013-12-10 12:00:32 +01:00
Juergen Hoeller 6d7ce439b1 Introduced GuavaCacheManager as an alternative to ConcurrentMapCacheManager 2013-12-10 11:59:35 +01:00
Juergen Hoeller 242ecdc448 Fixed inner bean name determination for multi-level nesting scenario, calculating a unique bean name as early as possible now (and for any kind of bean scope)
Our per-bean caching in AutowiredAnnotationBeanPostProcessor and co relies on unique bean names, so this change fixes potential cache mismatch problems occuring there.

Issue: SPR-11131
2013-12-09 21:45:44 +01:00
Juergen Hoeller 8580d2d19e Fixed detection of generic types and qualifier annotations on scoped-proxy factory methods
Issue: SPR-11116
2013-12-08 23:24:16 +01:00
Sam Brannen 4957131a7b Delete sysout.println call from MBean*Tests 2013-12-05 20:40:09 +01:00
Juergen Hoeller edeb11c556 Polishing 2013-12-04 23:58:05 +01:00
Phillip Webb b1485420b6 Use port scanning for JMX tests
Attempt to fix performance build by scanning for a free JMX port.
2013-12-03 08:22:25 -08:00
Juergen Hoeller 2a52decbbc Polishing (including removal of javadoc imports that show as package cycles in IntelliJ) 2013-12-02 23:57:00 +01:00
Juergen Hoeller eb8b5c435c Polishing 2013-12-02 22:32:31 +01:00
Juergen Hoeller 3e4b3cad6a Always preserve target class for configuration classes in case of auto-proxying
Issue: SPR-10561
2013-12-02 14:42:17 +01:00
Juergen Hoeller 8958912c94 Extended testPrototypeCreationWithOverriddenAutowiredPropertiesIsFastEnough's deadline (since that test repeatedly failed on the CI server) 2013-12-02 13:15:27 +01:00
Juergen Hoeller ce917d5cbb Polishing around @EnableTransactionManagement
Issue: SPR-10864
2013-12-02 11:00:26 +01:00
Juergen Hoeller e8dead247c @EnableTransactionManagement and co get detected on superclasses as well
Issue: SPR-10864
2013-12-02 10:59:30 +01:00
Phillip Webb b0b40dade1 Detect cache hit with multiple @Cachables
Fix CacheAspectSupport to consider a cache hit from any of the multiple
@Cachables that may have been specified using the @Caching annotation.

Prior to this commit the following scenario would never produce a hit:

	@Caching(cacheable = {
		@Cacheable(value = "c1", unless = "#result.size() < 4"),
		@Cacheable(value = "c2", unless = "#result.size() > 3")
	})

Issue: SPR-11124
2013-11-26 17:13:15 -08:00
Phillip Webb 043a41e382 Consistent whitespace after imports
Update code to have a consistent number of new-line characters after
import statements.
2013-11-26 15:14:43 -08:00
Phillip Webb 15698860e1 General polish of new 4.0 classes
Apply consistent styling to new classes introduced in Spring 4.0.

- Javadoc line wrapping, whitespace and formatting
- General code whitespace
- Consistent Assert.notNull messages
2013-11-26 15:11:18 -08:00
Phillip Webb a31ac882c5 Fix various javadoc warnings 2013-11-26 13:25:37 -08:00
Phillip Webb c5779e2ed6 Remove unused GlassFishLoadTimeWeaverTests
Delete the unused GlassFishLoadTimeWeaverTests and in the process
fix the "Unable to load JUnit4 runner to calculate Ignored test cases"
Gradle error.

Issue: SPR-10563
2013-11-26 10:51:13 -08:00
Juergen Hoeller ef3a3b03ce @EnableMBeanExport supports empty placeholders as well
Issue: SPR-11105
2013-11-26 14:43:10 +01:00
Phillip Webb 59002f2456 Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.

Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.

Issue: SPR-11064
2013-11-25 12:52:42 -08:00
Juergen Hoeller f39bb02628 Polishing 2013-11-22 23:29:54 +01:00
Juergen Hoeller 519f78c3f5 Optimized ImportAware processing to avoid re-reading class files 2013-11-22 23:22:20 +01:00
Juergen Hoeller 009e362709 @EnableMBeanExport supports placeholders for its attributes now
Issue: SPR-11105
2013-11-22 23:18:47 +01:00
Phillip Webb 7c3cdf82cc Try a different mbean port 2013-11-21 11:49:49 -08:00
Phillip Webb 639b2cb12e Increase performance test timeout 2013-11-20 22:05:34 -08:00
Juergen Hoeller 41cdbd292a Defensively handle non-retrievable ApplicationListener bean names 2013-11-20 14:52:25 +01:00
Juergen Hoeller 54571bf038 Introduced getBeanNamesForAnnotation method on ListableBeanFactory
Issue: SPR-11069
2013-11-15 16:04:11 +01:00
Juergen Hoeller ddebda1121 Ignoring non-loadable annotations in SourceClass.getAnnotations() and therefore in the collectImports algorithm
Issue: SPR-11086
2013-11-15 11:50:01 +01:00
Sam Brannen d67fe1db86 Polish spring-context
- Cache interceptor internals now operate on collections of
   <? extends Cache> instead of <Cache>.
 - Deleted unused imports.
 - Deleted dead code.
 - Suppressed warnings for resource leaks related to not closing
   ApplicationContexts in tests.
 - Suppressed further non-issue warnings in tests.
2013-11-11 12:09:50 +01:00
Juergen Hoeller e9a24da225 Added test for placeholder in alias definition
Issue: SPR-11018
2013-11-06 00:14:26 +01:00
Juergen Hoeller 0aedd81ccc JndiObjectFactoryBean converts a "defaultObject" value to the expected type if necessary
Issue: SPR-11039
2013-11-06 00:12:52 +01:00
Juergen Hoeller c5fcf19535 Perform setParent's Environment merging for ClassPathXmlApplicationContext etc constructors with parent argument as well
Issue: SPR-11068
2013-11-05 13:48:21 +01:00
Juergen Hoeller 8f81a12236 Added actual overriding test to BeanMethodPolymorphismTests
Issue: SPR-10992
2013-11-05 01:09:51 +01:00
Juergen Hoeller eed1a323d1 Polishing (along with SPR-10992) 2013-11-04 23:44:47 +01:00
Juergen Hoeller 935bd25b09 Revised @Bean processing rules
@Bean method metadata is always being picked from the most concrete subclass; @Bean method overloads are allowed within the same config class as well; and @Bean overrides and overloads work with 'allowBeanDefinitionOverriding'=false now.

Issue: SPR-10992
Issue: SPR-11025
2013-11-04 23:34:00 +01:00
Juergen Hoeller 50d3f71923 Added get(key, type) method to Cache interface
This new get variant not only allows for generically specifying the required value type; it also skips the ValueWrapper that the standard get method returns. Note that it is not possible to differentiate between non-existing cache entries and cached null values that way; for that purpose, the standard get variant needs to be used.

Issue: SPR-11061
2013-11-04 14:31:41 +01:00
Juergen Hoeller b093b84954 Use non-lenient constructor resolution mode for @Bean methods
Since @Bean methods are never used with externally specified constructor argument values but rather just with autowiring, the non-lenient constructor resolution mode is appropriate in case of an overloaded @Bean method, not performing any type difference weight checks. This change includes a refinement of Spring's existing non-lenient constructor resolution (which needs to be explicitly turned on and is therefore not well tested), narrowing the conditions for the ambiguity check (only in case of the same number of arguments and not for overridden methods).

Issue: SPR-10988
2013-11-04 00:19:55 +01:00
Juergen Hoeller 49758a2a96 Added convenience classes for typical JSR-236 setup in a Java EE 7 environment
Introduced DefaultManagedTaskExecutor, DefaultManagedTaskScheduler and DefaultManagedAwareThreadFactory classes, revised related javadoc, and deprecated unsupported JBossWorkManagerTaskExecutor in favor of JSR-236 setup on WildFly 8.

Issue: SPR-8195
2013-11-02 20:14:02 +01:00
Juergen Hoeller 44dee37130 Added further author tags
Issue: SPR-1528
2013-11-01 22:43:02 +01:00
Juergen Hoeller 7ed108e974 Avoid potential NPE in toString()
Issue: SPR-1528
2013-11-01 22:42:17 +01:00
Juergen Hoeller 7b2ac6d194 LocaleContextHolder allows for independent setting of Locale and TimeZone
Issue: SPR-1528
2013-11-01 22:41:31 +01:00
Juergen Hoeller 6e418fe43d QualifierAnnotationAutowireCandidateResolver matches regular bean name for FactoryBean dependency type as well 2013-10-31 15:26:10 +01:00
Juergen Hoeller b69ebe70a6 Consistent javadoc references to java.util.concurrent and javax.enterprise.concurrent 2013-10-31 01:13:58 +01:00
Juergen Hoeller f9584184ef Allow for specific instance-based match to override factory method signature match
Issue: SPR-11046
2013-10-30 22:02:04 +01:00
Juergen Hoeller ac7e27b785 Polishing 2013-10-30 19:30:18 +01:00
Juergen Hoeller 48b9e9a203 Spring uses Joda-Time 2.0's specific parseLocalDate/parseLocalTime/parseLocalDateTime methods now
Issue: SPR-11014
2013-10-30 16:50:21 +01:00
Juergen Hoeller 0fe49629c0 AbstractApplicationContext's ApplicationListenerDetector removes listeners from ApplicationEventMulticaster on individual destruction
Issue: SPR-7856
2013-10-30 12:30:13 +01:00
Juergen Hoeller bfa30913fb Polishing 2013-10-30 00:53:55 +01:00
Phillip Webb 78c10cd242 Polish BeanMethodPolymorphismTests
Polish BeanMethodPolymorphismTests and add @Ignored failing test
for SPR-10988.

Issue: SPR-10988
2013-10-28 16:51:20 -07:00
Juergen Hoeller 671fad3cb5 Added further tests for raw matching of generic types
Issue: SPR-11034
Issue: SPR-11004
2013-10-27 11:02:16 +01:00
Juergen Hoeller 4675bc4e0c Cache InjectionMetadata per bean name instead of per Class, if possible
Issue: SPR-11027
2013-10-26 14:03:11 +02:00
Juergen Hoeller 393cfcff40 Cache InjectionMetadata per bean name instead of per Class
Issue: SPR-11027
2013-10-26 02:21:38 +02:00
Juergen Hoeller 6d80da2e31 Polishing 2013-10-26 02:21:36 +02:00
Juergen Hoeller dfb29f4296 Introduced ScriptEvaluator strategy interface
Including ScriptEvaluator implementations for JSR-223, Groovy and BeanShell. BeanShell consistently receives the bean ClassLoader now. Also revised ScriptFactory and its implementations for varargs.

Issue: SPR-11007
2013-10-26 02:21:35 +02:00
Juergen Hoeller 8bd480441e Made processCommonDefinitionAnnotations(AnnotatedBeanDefinition) public
Issue: SPR-11032
2013-10-26 00:02:55 +02:00
Rossen Stoyanchev b8809daf5f Refactor HandlerMethod support in spring-messaging
Introduce base class AbstractMethodMessageHandler for
HandlerMethod-based message handling.

Add MessageCondition interface for mapping conditions to messages
with support for combining type- and method-level annotation
conditions, the ability to match conditions to messages, and also
comparing matches to select the best match.

Issue: SPR-11024
2013-10-24 21:50:49 -04:00
Phillip Webb e95bd9e250 Add @PropertySources and ignoreResourceNotFound
Support repeatable @PropertySource annotations in Java 8 and add
@PropertySources container annotation for Java 6/7. Also add an
ignoreResourceNotFound attribute to @PropertySource allowing missing
property resources to be silently ignored.

This commit also introduces some generally useful methods to
AnnotationUtils for working with @Repeatable annotations.

Issue: SPR-8371
2013-10-22 11:15:50 -07:00
Phillip Webb e3d3d8cd95 Consistent ordering for @PropertySource locations
Ensure that property source locations are processed in the same order
regardless if the 'name' attribute is set or not.

Prior to this commit multiple locations from a `@PropertySource` with
a name were added to a `CompositePropertySource` in such a way that
the first location would take precedence. This has now been reversed
for consistence with unnamed `@PropertySource`s

Issue: SPR-10820
2013-10-21 13:11:19 -07:00
Phillip Webb b0ff834ee3 Multicaster support for events with null source
Update `AbstractApplicationEventMulticaster` to support `EventObjects`
with a null source (which can happen if they have been serialized).

Issue: SPR-10945
2013-10-21 11:59:46 -07:00
Phillip Webb f4a66a4326 Polish GroovyBeanDefinitionReader formatting
Consistent use of tabs and remove trailing whitespace.

Issue: SPR-7123
2013-10-17 13:46:32 -07:00
Juergen Hoeller 8d6406bbae Groovy-based bean definitions
Formerly known as the Grails BeanBuilder, now in Spring proper. Based on https://github.com/spring-projects/spring-framework/pull/355 but heavily refactored and restructured.

Issue: SPR-7123
2013-10-17 19:24:08 +02:00
Juergen Hoeller d87838fc6d Polishing 2013-10-16 01:51:49 +02:00
Juergen Hoeller 9bfbe36b1c Restored registration of nested component classes (even without factory methods)
Issue: SPR-10865
Issue: SPR-10970
2013-10-16 01:51:47 +02:00
Juergen Hoeller 3bd6dfe047 Autowiring of generic types
Includes revisions of MethodParameter and DependencyDescriptor (in particular towards a reference to the containing class). Also refines several ResolvableType method signatures.

Issue: SPR-9965
2013-10-15 00:11:23 +02:00
Juergen Hoeller 7a9d58375f Changed JSR-330 detection logging from info to debug
Issue: SPR-10974
2013-10-14 23:24:25 +02:00
Juergen Hoeller 4574528a27 Comprehensive update to the framework's TimeZone handling, including a new TimeZoneAwareLocaleContext and a LocaleContextResolver for Spring MVC
A few noteworthy minor changes: LocaleContext.getLocale() may return null in special cases (not by default), which our own accessing classes are able to handle now. If there is a non-null TimeZone user setting, we're exposing it to all collaborating libraries, in particular to JSTL, Velocity and JasperReports. Our JSR-310 and Joda-Time support falls back to checking the general LocaleContext TimeZone now, adapting it to their time zone types, if no more specific setting has been provided. Our DefaultConversionService has TimeZone<->ZoneId converters registered. And finally, we're using a custom parseTimeZoneString method now that doesn't accept the TimeZone.getTimeZone(String) GMT fallback for an invalid time zone id anymore.

Issue: SPR-1528
2013-10-04 23:14:08 +02:00
Juergen Hoeller 52cca48f40 Polishing 2013-10-04 22:53:49 +02:00
Juergen Hoeller 3fad0fa432 Introduced TomcatLoadTimeWeaver for Tomcat's new InstrumentableClassLoader interface
At the same time, dropped GlassFish 1/2 support from GlassFishLoadTimeWeaver and redesigned it to be as analogous to TomcatLoadTimeWeaver as possible.

Issue: SPR-10788
2013-10-03 14:51:27 +02:00
Juergen Hoeller 888e3c7e53 Polishing 2013-10-03 14:51:26 +02:00
Juergen Hoeller f705ec1a46 Added ASPECTJ and REGEX constants to FilterType, along with a corresponding 'pattern' attribute on ComponentScan.Filter
Issue: SPR-10593
2013-09-26 21:16:46 +02:00
Phillip Webb b409ba0076 Remove accidentally committed test case 2013-09-25 10:43:23 -07:00
Juergen Hoeller 7bc3e3b3f8 Fixed handling of @Resource's shareable value
Issue: SPR-10931
2013-09-25 12:27:17 +02:00
Phillip Webb 783871a42a Restore 'maven.java.net' repository
Restore 'maven.java.net' repository accidentally removed in commit
2337e763.
2013-09-25 11:21:55 +02:00
Phillip Webb 05072e1762 Expand var-args before passing to KeyGenerator
Update `CacheAspectSupport` to expand any var-arg parameters before
calling `KeyGenerator` implementations. Prior to this commit var-args
would be passed to `KeyGenerator` implementations as a nested array,
often causing the same key to be generated regardless of the arguments.

Issue: SPR-10870
2013-09-23 15:14:58 -07:00
Juergen Hoeller 55f250afbc Fixed javadoc references 2013-09-14 07:33:49 +02:00
Oliver Gierke 1f9e8f68d4 Add support for Objenesis proxy creation.
Extended DefaultAopProxyFactory to create Objenesis based proxies if the
library is on the classpath. This allows classes without a default
constructor being CGLib proxied. We're now falling back to original CGLib
based behavior in case the proxy creation using Objenesis fails.

Objenesis 2.0 is now inlined into spring-core to avoid interfering with
other Objenesis versions on the classpath.

Issue: SPR-10594
2013-09-12 16:32:27 -07:00
Juergen Hoeller facf31f01a Javadoc fixes 2013-09-02 21:20:46 +02:00
Juergen Hoeller e8c0ef8305 ThreadPoolTaskScheduler allows for setPoolSize changes at runtime
Also exposing "getPoolSize()" and "getActiveCount()" from ThreadPoolTaskScheduler now, analogous to ThreadPoolTaskExecutor.

Issue: SPR-10883
2013-09-02 21:18:41 +02:00
Juergen Hoeller caa1218d36 Polishing 2013-08-29 19:17:59 +02:00
Juergen Hoeller 0c00b0d902 Added 'zone' attribute to @Scheduled
Issue: SPR-10456
2013-08-29 18:44:01 +02:00
Juergen Hoeller 365ce55a93 Polishing 2013-08-28 22:16:20 +02:00
Juergen Hoeller 465e6292eb Javadoc fixes 2013-08-28 22:16:08 +02:00
Juergen Hoeller fe8dec912d @Bean methods are allowed to override existing bean definitions with a role other than ROLE_APPLICATION now (e.g. framework-generated default beans)
Also, DefaultListableBeanFactory logs a warning when overriding an application definition with a framework-generated definition now, which is expected to be an accident.

Issue: SPR-10607
2013-08-28 22:14:34 +02:00
Juergen Hoeller bb971cecf1 A BeanDefinitionRegistryPostProcessor may register other BeanDefinitionRegistryPostProcessors
We're using the same subtle PriorityOrdered/Ordered/non-ordered separation as for regular BeanFactoryPostProcessors and BeanPostProcessors now. Additionally, we're re-detecting BeanDefinitionRegistryPostProcessor bean names after every invocation phase, up until no further ones appear.

Issue: SPR-10630
2013-08-28 12:49:53 +02:00
Juergen Hoeller 4447248a83 Introduced support for @Lazy on injection points
This turned into a rather huge affair since it led to the introduction of a new AutowireCandidateResolver implementation in the spring-context module. That ACR impl is now being set through AnnotationConfigUtils; GenericApplicationContext and co do not set a default QualifierAnnotationAutowireCandidateResolver anymore (which has always been a smell anyway).  At the same time, dependency ordering has moved from AutowiredAnnotationBeanPostProcessor to DefaultListableBeanFactory itself through a "dependencyComparator" strategy, applying to constructor dependencies and lazy resolution proxies as well.

Issue: SPR-10353
2013-08-28 00:14:39 +02:00
Juergen Hoeller 01b8d9327d AnnotationConfigWebApplicationContext allows for repeated register/scan calls
Restoring consistency with AnnotationConfigApplicationContext.

Issue: SPR-10852
2013-08-28 00:04:53 +02:00
Juergen Hoeller e812b6cea0 Marked @Profile as @Documented 2013-08-28 00:03:40 +02:00
Juergen Hoeller 5efe894ee4 Not exposing ApplicationContext on ConditionContext anymore 2013-08-28 00:00:54 +02:00
Phillip Webb 89b53cfcd5 Javadoc that @Conditionals are not inherited
Issue: SPR-10840
2013-08-27 10:48:38 -07:00
Phillip Webb ced5ea2f93 Revert "Ensure @Conditions consider super classes"
This reverts commit 620c16f5c7.
2013-08-27 10:39:51 -07:00
Phillip Webb 620c16f5c7 Ensure @Conditions consider super classes
Fix @Condition evaluation to also consider super classes for both
@Configuration classes and regular @Components. This change allows
@Conditional annotations to be inherited and restores the previous
behavior of @Profile.

Issue: SPR-10840
2013-08-26 17:12:02 -07:00
Juergen Hoeller 8f90eacd92 Polishing 2013-08-26 20:04:40 +02:00
Juergen Hoeller aecf60d21f Discovering and accumulating all @Profile meta-annotations
Issue: SPR-10812
2013-08-26 20:03:32 +02:00
Juergen Hoeller c9771012e9 Introduced @Description annotation for populating BeanDefinition.getDescription()
Issue: SPR-10583
2013-08-23 16:49:25 +02:00
Juergen Hoeller 88115212eb Consistent xsd header formatting 2013-08-22 19:37:42 +02:00
Juergen Hoeller 3d462b6dd9 Added missing spring.schemas entries for 4.0 xsds
Also fixing an old XmlBeanFactory test that relies on "ref local" which is gone in the 4.0 xsd now, redeclaring the affected file to an older xsd version.
2013-08-22 19:36:53 +02:00
Juergen Hoeller f2fb0ec9e7 Minor polishing of related files
Issue: SPR-10181
2013-08-21 17:37:06 +02:00
Juergen Hoeller 6d3649858e Allow meta-annotations to override attributes from their parent
Issue: SPR-10181
2013-08-21 17:35:56 +02:00
Sam Brannen 14ac023e01 Avoid use of repeated @Scheduled in tests
Commented out severalFixedRatesWithRepeatedScheduledAnnotation() until
we have full Java 8 support in the IDEs (e.g., Eclipse).

Issue: SPR-10532
2013-08-12 23:32:35 +02:00
Sam Brannen c3dd9ff342 Add test with @Schedules container annotation
Issue: SPR-10532
2013-08-11 00:05:36 +02:00
Juergen Hoeller 1420b970a7 Introduced DefaultParameterNameDiscoverer which checks JDK 8's standard reflection first and then falls back to ASM-based debug symbol analysis
Also, StandardReflectionParameterNameDiscoverer calls "Parameter.isNamePresent()" now to return null (and pass on to the next discoverer) if no JDK 8 parameters are available. Note that this requires OpenJDK 8 b100 or higher to compile now.

Issue: SPR-10532
2013-08-08 15:52:43 +02:00
Juergen Hoeller f9325a8376 Added Java 8 compliant @Schedules container annotation for @Scheduled
Issue: SPR-10532
2013-08-08 15:52:41 +02:00
Juergen Hoeller ce06d1391f Polishing
Issue: SPR-10807
2013-08-06 02:05:49 +02:00
Juergen Hoeller 9645799264 Fixed accidental use of JDK 8 getOrDefault method on MultiValueMap
Issue: SPR-10807
2013-08-06 01:45:08 +02:00
Juergen Hoeller f88f5ed011 Optimized TomcatInstrumentableClassLoader implementation
Issue: SPR-10788
(cherry picked from commit d32a77a)
2013-08-01 17:27:06 +02:00
Juergen Hoeller 127b91fd4f PropertySourcesPlaceholderConfigurer's "ignoreUnresolvablePlaceholders" setting reliably applies to nested placeholders as well
Issue: SPR-10549
2013-07-31 17:50:44 +02:00
Juergen Hoeller 481aeeec98 Polishing
Issue: SPR-10609
2013-07-30 22:36:42 +02:00
Juergen Hoeller 01a71ef5ef Polishing 2013-07-24 13:40:15 +02:00
Juergen Hoeller b8f7a30790 OpenJDK 8 build 99: different toString() output from JSR-310 Instant 2013-07-24 13:37:52 +02:00
Juergen Hoeller 2d1b44202b OpenJDK 8 build 99: annotation discovery on bridge methods 2013-07-24 13:36:59 +02:00
Phillip Webb 1a8f0d6a9e Resolve ${} placeholders in @ImportResource
Update ConfigurationClassParser to resolve any ${} placeholders from
@ImportResource values.

Issue: SPR-10686
2013-07-19 13:10:16 -07:00
Rossen Stoyanchev d3cecfc6cc Create spring-messaging module
Consolidates new, messaging-related classes from spring-context and
spring-websocket into one module.
2013-07-12 13:44:41 -04:00
Rossen Stoyanchev 2803845151 Update MessageConverter and reactor dependencies 2013-07-10 16:00:40 -04:00
Rossen Stoyanchev 0c92b85c3d Rename ChannelResolver to DestinationResolver 2013-07-05 11:11:19 -04:00
Rossen Stoyanchev 9dd7f6e5fb Update MessagingOperations hieararchy 2013-07-05 10:59:04 -04:00
Rossen Stoyanchev ef823721e5 Split AbstractMessagingTemplate across send/receive 2013-07-04 11:38:21 -04:00
Rossen Stoyanchev 078c766b80 Add new MessagingOperations ifc and class hieararchy 2013-07-04 11:23:40 -04:00
Rossen Stoyanchev 8560582c40 Add messaging.channel package 2013-07-03 20:59:17 -04:00
Phillip Webb 52d378d41f Add PublishSubscribeChannel
Add a PublishSubscribeChannel implementation of SubscribableChannel.
2013-07-03 20:44:53 -04:00
Phillip Webb 7a85827c48 Polish messaging code
Minor formatting and Javadoc changes.
2013-07-03 20:44:53 -04:00
Andy Wilkinson e694cc16c7 Consider original headers in pattern-based removal
When headers are being removed based on pattern matching, both the
new header names and the original header names need to be matched
against the pattern. Previously, only new headers were being
considered resulting in any matching original headers not being
removed.
2013-07-01 12:13:17 -04:00
Andy Wilkinson 98d7073370 Verify types when setting header
When a header is being set, verify that the type that's provided is
legal for the header that's been set. For example, the error channel's
type must be a MessageChannel or a String.

The method that performs type verification is protected so that it
can be overriden by sub-classes. It is expected that an overriding
method will call the super method.
2013-07-01 12:11:12 -04:00
Andy Wilkinson 465fc7638f Fix typo in MessageHeaderAccessor's class name
Remove the extra 's' from the class name
2013-06-28 13:01:52 +01:00
Rossen Stoyanchev d650e909b2 Merge branch 'master' into websocket-stomp 2013-06-27 15:58:12 -04:00
Rossen Stoyanchev 486b4101ec Introduce MessageHeader accessor types
A new type MessageHeaderAccesssor provides read/write access to
MessageHeaders along with typed getter/setter methods along the lines
of the existing MessageBuilder methods (internally MessageBuilder
merely delegates to MessageHeaderAccessor). This class is extensible
with sub-classes expected to provide typed getter/setter methods for
specific categories of message headers.

NativeMessageHeaderAccessor is one specific sub-class that further
provides read/write access to headers from some external message
source (e.g. STOMP headers). Native headers are stored in a separate
MultiValueMap and kept under a specific key.
2013-06-25 16:31:52 -04:00
Nick Williams 7b2c74b05c Improving method validation support for BV 1.1
Update MethodValidationPostProcessor.setValidator(...) to use
LocalValidatorFactoryBean.getValidator() when possible.

This is required because LocalValidatorFactoryBean does not directly
implement the forExecutables() method introduced in bean validation v1.1.

Issue: SPR-10644
2013-06-24 13:21:03 -07:00
Rossen Stoyanchev 32cb2ca2e7 Remove generic params from Message/MessageChannel 2013-06-24 11:14:48 -04:00
Phillip Webb eea230f2a8 Allow @CachePut 'key' SpEL to refer to #result
Allow the @CachePut 'key' SpEL to refer to the result of the method call
via a '#result' variable.

This change is particularly useful when working with JPA entities that
have generated @Id values since the ID will often not be available
until the entity has been saved.

Issue: SPR-10664
2013-06-23 09:07:16 -07:00
Phillip Webb f75d4e13a2 Polish cache abstraction code
Polish cache abstraction code and refactor CacheAspectSupport.
2013-06-23 09:07:16 -07:00
Sam Brannen b122ca688b Add missing @since tag to SimpleKey 2013-06-22 23:57:17 +02:00
Phillip Webb f1a18d29ba SimpleKeyGenerator to replace DefaultKeyGenerator
Introduce new SimpleKeyGenerator class to supersede DefaultKeyGenerator.
Unlike DefaultKeyGenerator, no collisions will occur with the keys
generated by SimpleKeyGenerator as the full parameter values are
considered within the SimpleKey.equals(...) method.

The SimpleKeyGenerator is now the default class used when no explicit
generator is configured.

Issue: SPR-10237
2013-06-21 12:21:29 -07:00
Phillip Webb a403e8f8b8 Inject @Configuration BeanFactory before autowire
Add EnhancedConfigurationBeanPostProcessor to inject the BeanFactory
into EnhancedConfiguration classes before the
AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues method
is called.

Prior to this commit it was possible for @Autowire in a @Configuration
class to invoke an enhanced configuration class method before the
BeanFactory was injected. This is due to the fact that the
AutowiredAnnotationBeanPostProcessor was called before
AbstractAutowireCapableBeanFactory.invokeAwareMethods().

Issue: SPR-10668
2013-06-20 20:21:18 -07:00
Rossen Stoyanchev 5cfc59d76d Refactor PubSubHeaders, StompHeaders, MessageBuilder
Rename to PubSubHeaderAccessor and StompHeaderAccessor
Move the renamed classes to support packages

Remove fromPayloadAndHeaders from MessageBuilder, just use
withPayload(..).copyHeaders(..) instead.
2013-06-19 11:41:43 -04:00
Rossen Stoyanchev c5b1f02c3a Add MessageBuilder 2013-06-14 16:30:02 -04:00
Sam Brannen e12311e364 Polish Javadoc 2013-06-14 16:06:57 +02:00
Andy Wilkinson 3022f5e34f Make Message type pluggable
To improve compatibility between Spring's messaging classes and
Spring Integration, the type of Message that is created has been made
pluggable through the introduction of a factory abstraction;
MessageFactory.

By default a MessageFactory is provided that will create
org.springframework.messaging.GenericMessage instances, however this
can be replaced with an alternative implementation. For example,
Spring Integration can provide an implementation that creates
org.springframework.integration.message.GenericMessage instances.

This control over the type of Message that's created allows messages
to flow from Spring messaging code into Spring Integration code without
any need for conversion. In further support of this goal,
MessageChannel, MessageHandler, and SubscribableChannel have been
genericized to make the Message type that they deal with more
flexible.
2013-06-14 12:34:12 +01:00
Rossen Stoyanchev d136d06eda Add method to create MessageHeaders in Message 2013-06-13 13:51:21 -04:00
Rossen Stoyanchev 3e0aac08dc Add SubscribableChannel and ReactorMessageChannel 2013-06-13 01:13:37 -04:00
Rossen Stoyanchev a1cfa3832e Polish 2013-06-13 01:13:04 -04:00
Phillip Webb b78dcc59fe Make ConfClassPostPro Ordered.HIGHEST_PRECEDENCE
Make ConfigurationClassPostProcessor Ordered.HIGHEST_PRECEDENCE in
case several BeanDefinitionRegistryPostProcessors are registered.

Issue: SPR-10645
2013-06-12 11:46:48 -07:00
Phillip Webb 2e2e9b8dd0 Improve support for @Conditional on @Configuration
Introduce new ConfigurationCondition interface allowing more
fine-grained control for @Conditional when used with @Configuration
beans.

Primarily added so that the evaluation of conditions that inspect bean
definitions can be deferred until all @Configuration classes have been
parsed.

Issue: SPR-10534
2013-06-12 11:45:20 -07:00
Rossen Stoyanchev d26b9d60e5 Refactor approach to working with STOMP headers 2013-06-11 01:52:32 -04:00
Phillip Webb e10e16cd6b Support fall-back to ASM parsing @Configuration
Update ConfigurationClassParser to fall-back to ASM parsing if standard
annotation processing fails. This change allows @Conditional annotations
that refer to missing classes to work.

This commit also introduces a new inner SourceClass object that
encapsulates the conditional logic required when reading the source
classes.

Issue: SPR-10646
2013-06-10 09:25:34 -07:00
Rossen Stoyanchev 84c55f90db Make MessageHeaders non-final 2013-06-10 10:09:24 -04:00
Rossen Stoyanchev de899820c9 Add Message, MessageChannel and refactor stomp support 2013-06-09 19:36:46 -04:00
Sam Brannen 96e1fbc3bb Polish @Conditional Javadoc and tests 2013-06-08 17:49:54 +02:00
Phillip Webb 239ce1466c Update @Conditional processing logic
Defer @Conditional processing on @Configuration classes until the bean
definitions are loaded, rather than when the @Configuration class is
parsed. This provides better support for @Conditional implementations
that inspect bean definitions.

This commit also fixes some minor problems with original implementation
and replaces the ConditionalAnnotationHelper class with
ConditionEvaluator.

Issue: SPR-10534
2013-06-04 10:27:51 -07:00
Phillip Webb 2ecc51f066 Do not consider all @Components as configuration
Update ConfigurationClassUtils to only consider beans with @Bean
methods as 'lite' configuration candidates.

Prior to this commit all @Component beans were considered 'lite'
configuration candidates which could result in a large number of
ConfigurationClass instance being created that would ultimately be
ignored.

Issue: SPR-10609
2013-06-04 10:26:31 -07:00
Phillip Webb a8fd832818 Support meta @Component with non-string value
Update AnnotationBeanNameGenerator to only use the value attribute of
a @Component meta-annotated annotation when it is a String.

Issue: SPR-10580
2013-06-04 10:23:23 -07:00
Phillip Webb 4d3383242e Support EnvironmentAware ImportSelector/Registrar
Add support for the EnvironmentAware interface with ImportSelector
and ImportBeanDefinitionRegistrar implementations.

Issue: SPR-10602
2013-06-03 12:19:47 -07:00
Phillip Webb d7ec20a286 Test for property placeholder with defaults
Test property placeholder with multiple locations and default values.

Issue: SPR-10619
2013-06-03 09:37:43 -07:00
Carson McDonald ae74a2158a Fix typo {explictly => explicitly}
- cherry-pick of pull request #257, which originally applied to 3.2.x
2013-05-31 08:22:36 +02:00
Juergen Hoeller 7e01578515 Avoid unnecessary creation of default StandardEnvironment instances
Issue: SPR-10568
2013-05-15 23:41:32 +02:00
Juergen Hoeller 7cddeb6db9 Polishing 2013-05-15 17:19:57 +02:00
Juergen Hoeller 3f7007f73a Properly handle knownSuperclasses in case of an overridden ConfigurationClass
Issue: SPR-10546
(cherry picked from commit 6e4317e)
2013-05-15 14:30:32 +02:00
Rob Winch d1859c8c86 Ensure Parent ConfigurationClass loaded on overrides
Previously ConfigurationClassParser could override a nested
@Configuration without consideration of @Bean's defined in parent
classes.

This commit ensures that if the original ConfigurationClass contains
additional bean definitions it is processed again.

Issue: SPR-10546
(cherry picked from commit 940011e)
2013-05-15 14:24:25 +02:00
Juergen Hoeller 5dbbd8fe72 Clarified that CronTrigger never schedules overlapping executions
Issue: SPR-10556
2013-05-14 21:16:04 +02:00
Juergen Hoeller 25e29b851d GenericTypeResolver defensively calls Class.getGenericSuperclass() and consistently uses Class<?>
Issue: SPR-10559
2013-05-14 16:02:52 +02:00
Rob Winch 9468548116 Add @Override to remaining source files
Issue: SPR-10130
2013-05-13 17:04:56 -05:00
Juergen Hoeller 640555194b Introduced assertions for bean accessor delegation in AbstractApplicationContext
Issue: SPR-10307
2013-05-10 01:32:00 +02:00
Phillip Webb 30b21a987e Make @Configuration classes thread-safe
Refactor ConfigurationClassEnhancer so that BeanFactory instances are
not held against CGLIB Callback objects. Enhanced @Configuration classes
now use the BeanFactoryAware interface in order to obtain a BeanFactory.

This change has the additional benefit that a static final field can
now be used to hold all Callback instances.

Issue: SPR-10307
2013-05-09 15:05:40 -07:00
Phillip Webb 7c7fdb0736 Add support for DeferredImportSelector
Add DeferredImportSelector interface that can be used to select imports
after all @Configuration beans have been processed.
2013-05-08 19:41:20 -07:00
Phillip Webb b257253a2b Support for @Conditional configuration
Introduce new @Conditional annotation that can be used to filter
which @Configuration classes or methods are loaded. @Conditional
can be used directly or as a meta-annotation. Condition implementations
are provided via the 'Condition' interface and are free to filter based
on any criteria available at the time that they run. The
ConditionalContext provides access to the BeanDefinitionRegistry,
Environment and ConfigurableListableBeanFactory along with a
ResourceLoader and ClassLoader.

The existing @Profile annotation has been refactored as a @Conditional
with the added benefit that it can now be used as a method level
annotation.
2013-05-08 19:41:20 -07:00
Phillip Webb eb1776e79d Allow access to applied property sources
Add PropertySourcesPlaceholderConfigurer.getAppliedPropertySources() to
allow access to the PropertySources that were actually applied.

Issue: SPR-10545
2013-05-08 19:40:57 -07:00
Juergen Hoeller 2a44228b98 Consistent use of <pre class="code">
Issue: SPR-8108
2013-05-07 21:31:26 +02:00
Juergen Hoeller 0fc5a5d912 Introduced 4.0 versions of all XML configuration schemas
Removed spring-beans.dtd (the 1.x variant) and spring-oxm-1.5.xsd (pre-Spring-Framework variant), in order to raise the backwards compatibility limit a little bit at least. We'll keep supporting the 2.0 and 2.5 xsd versions for the time being, as well as spring-beans-2.0.dtd.

Removed the ref 'local' attribute in spring-beans-4.0.xsd since 'local' lost its differentiating role to a regular bean ref back in the 3.1 days when we started allowing for the same bean id to reappear in a different beans section of the same configuration file (with a different profile).

Issue: SPR-10437
2013-05-07 18:11:51 +02:00
Phillip Webb 71f6da673a Consider @Import classes as lite @Configuration
Allow classes that are annotated with @Import to be considered as 'lite'
@Configuration candidates. Allows the AnnotationConfigApplicationContext
to directly register @Import beans even if they are not @Components.

Issue: SPR-10533
2013-05-06 16:00:59 -07:00
Phillip Webb d91ffb6a59 Filter source @Configuration with @ComponentScan
Exclude self @Component when parsing @ComponentScan annotations.

Issue: SPR-10531
2013-05-06 15:53:20 -07:00
Phillip Webb db0d780d43 Support *Aware ImportSelectors
Implementations of Spring's ImportSelector interface may
now implement any of the following *Aware interfaces and have their
respective methods called prior to #registerBeanDefinitions:

 - BeanFactoryAware
 - BeanClassLoaderAware
 - ResourceLoaderAware

Issue: SPR-10530
2013-05-06 15:43:52 -07:00
Phillip Webb f05d0885ef Add AnnotationConfigApplicationContext constructor
Add AnnotationConfigApplicationContext constructor allow use of a
custom DefaultListableBeanFactory.

Issue: SPR-10529
2013-05-06 15:36:32 -07:00
Juergen Hoeller 2a53a2de0e Raised Hibernate Validator support dependency to 4.3+
This allows for restoring a static MessageSourceResourceBundleLocator implementation, just implementing the interface at the new spi location introduced in HV 4.3 and preserved in 5.0.

Issue: SPR-8199
2013-05-03 15:37:02 +02:00
Juergen Hoeller cac76192e2 Added "postProcessConfiguration" template method to LocalValidatorFactoryBean 2013-05-03 15:04:18 +02:00
Juergen Hoeller ddbcf62edd Replaced shared editor usage with PropertyEditorRegistrar 2013-05-03 13:56:57 +02:00
Juergen Hoeller 0a8f5b2919 Removed deprecated helper classes and methods (that have been deprecated since 3.0 or before) 2013-05-02 17:25:10 +02:00
Juergen Hoeller 8ab16607d3 Support for JDK 8's "common" ForkJoinPool
Issue: SPR-9644
2013-04-23 14:01:51 +02:00
Juergen Hoeller 1733237579 Initial support for JDK 8 Date-Time (JSR-310)
This is largely derived from our existing Joda-Time support, with corresponding classes wherever possible.

Issue: SPR-9641
2013-04-23 13:59:19 +02:00
Juergen Hoeller 19f783bdd7 Fixed general test suite problems found during OpenJDK 8 upgrade
Issue: SPR-9639
2013-04-23 13:54:19 +02:00
Juergen Hoeller 9c09a0a037 Consistent Map/Set ordering
Use LinkedHashMaps/Sets wherever exposed to users, and code tests defensively in terms of expected Map/Set ordering. Otherwise, there'll be runtime order differences between JDK 7 and JDK 8 due to internal HashMap/Set implementation differences.

Issue: SPR-9639
2013-04-23 13:53:09 +02:00
Juergen Hoeller b5d44e1d15 Revised Joda-Time support (as a side effect of JSR-310 support in Spring 4.0)
Issue: SPR-9641
2013-04-23 13:50:25 +02:00
Juergen Hoeller d3a4068768 Minimized ASM usage
In particular, avoid accidental usage of ASM for core JDK types - which will fail in case of a new bytecode version in the JDK, even if the application itself has been compiled with an earlier bytecode target.

Issue: SPR-10292
2013-04-23 13:49:25 +02:00
Phillip Webb 761bd9fd56 Merge branch '3.2.x'
* 3.2.x:
  Update javadoc external links
  JdbcTemplate etc
  Removed unnecessary default value of LifecycleGroup.lifecycleBeans
  Introduced public ArgumentPreparedStatementSetter and ArgumentTypePreparedStatementSetter classes
  Defensively uses JDBC 3.0 getParameterType call for Oracle driver compatibility
  Preparations for 3.2.3
  Fixed ReflectiveMethodResolver to avoid potential UnsupportedOperationException on sort
  Fixed Jaxb2Marshaller's partial unmarshalling feature to consistently apply to all sources
  Update copyright year in reference documentation

Conflicts:
	build.gradle
	gradle.properties
	spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java
	spring-jdbc/src/main/java/org/springframework/jdbc/core/ArgumentPreparedStatementSetter.java
	spring-jdbc/src/main/java/org/springframework/jdbc/core/ArgumentTypePreparedStatementSetter.java
2013-04-13 09:39:09 -07:00
Juergen Hoeller 0d0122239d Initial support for Bean Validation 1.1 and Hibernate Validator 5.0
MethodValidationInterceptor autodetects Bean Validation 1.1's ExecutableValidator API now and uses it in favor of Hibernate Validator 4.2's native variant.
SpringConstraintValidatorFactory implements Bean Validation 1.1 "releaseInstance" method against new "destroyBean(Object)" method in AutowireCapableBeanFactory.
LocalValidatorFactoryBean adapts Spring-provided ParameterNameDiscoverer onto Bean Validation 1.1's ParameterNameProvider mechanism.
LocalValidatorFactoryBean reflectively adapts between the different ResourceBundleLocator SPI location in Hibernate Validator 4.2 versus 5.0.
LocalValidatorFactoryBean implements Bean Validation 1.1 "close" method.

Note: We still compile against Bean Validation 1.0 in order to not have to implement "forExecutables()" and "getParameterNameDiscoverer()" in LocalValidatorFactoryBean, SpringValidatorAdapter and CustomValidatorBean. Implementing those methods would imply references to Bean Validation 1.1 interfaces that break runtime compatibility with Bean Validation 1.0. Unfortunately, this means that all Bean Validation 1.1 API access has to be done via reflection.

Issue: SPR-8199
2013-03-28 21:54:25 +01:00
Juergen Hoeller 4004e53d97 JSR-236 support, in particular adapting to JSR-236 Triggers and exposing additional metadata through ManagedTasks
This is built into ConcurrentTaskExecutor and ConcurrentTaskScheduler now, automatically detecting the JSR-236 ExecutorService variants and adapting to them.

Issue: SPR-8195
2013-03-27 22:52:36 +01:00
Juergen Hoeller a272fd790a Clarified support for JRuby 1.5+ and Groovy 1.7+ 2013-03-19 22:40:14 +01:00
Juergen Hoeller 8832d59b7b Removed unintended backport-concurrency dependency 2013-03-19 19:25:49 +01:00
Juergen Hoeller 90f79f3f4f Require JRuby 1.6+ (avoiding the use of deprecated API) 2013-03-19 16:46:14 +01:00
Juergen Hoeller 55901e677f Removed EJB 2.x implementation class hierarchy (ejb.support package) 2013-03-19 15:07:51 +01:00
Juergen Hoeller 3f35bdc79a Removed scheduling.timer and scheduling.backportconcurrent packages 2013-03-19 15:01:11 +01:00
Juergen Hoeller 9c52ae9558 Removed OC4J support (including documentation references) 2013-03-19 14:53:26 +01:00
Juergen Hoeller 87e5f19c3f JDK 1.6+ API baseline across the codebase 2013-03-19 13:10:25 +01:00
Juergen Hoeller 2629208d5b Removed unnecessary default value of LifecycleGroup.lifecycleBeans
Issue: SPR-10388
2013-03-19 11:30:46 +01:00
Phillip Webb 4e1cab28df Merge branch '3.2.x'
* 3.2.x: (28 commits)
  Hide 'doc' changes from jdiff reports
  Document @Bean 'lite' mode vs @Configuration
  Final preparations for 3.2.2
  Remove Tiles 3 configuration method
  Polishing
  Extracted buildRequestAttributes template method from FrameworkServlet
  Added "beforeExistingAdvisors" flag to AbstractAdvisingBeanPostProcessor
  Minor refinements along the way of researching static CGLIB callbacks
  Compare Kind references before checking log levels
  Polish Javadoc in RequestAttributes
  Fix copy-n-paste errors in NativeWebRequest
  Fix issue with restoring included attributes
  Add additional test for daylight savings glitch
  Document context hierarchy support in the TCF
  Fix test for daylight savings glitch
  Make the methodParameter field of HandlerMethod final
  Disable AsyncTests in spring-test-mvc
  Reformat the testing chapter
  Document context hierarchy support in the TCF
  Document context hierarchy support in the TCF
  ...
2013-03-13 14:01:46 -07:00
Juergen Hoeller 43c1cec79b Added "beforeExistingAdvisors" flag to AbstractAdvisingBeanPostProcessor
Just AsyncAnnotationBeanPostProcessor switches "beforeExistingAdvisors" to "true" by default. So effectively, MethodValidation/PersistenceExceptionTranslationPostProcessor apply after existing advisors by default again, fixing the 3.1->3.2 regression.

Issue: SPR-10309
2013-03-13 16:58:00 +01:00
Juergen Hoeller fffeaee647 Minor refinements along the way of researching static CGLIB callbacks
Specifically, our CallbackFilter doesn't hold an implicit reference to the containing ConfigurationClassEnhancer class anymore.

Issue: SPR-10307
2013-03-13 16:57:59 +01:00
Dave Syer 6914aff825 Add additional test for daylight savings glitch
The problem was that clocks go forward *at* 2am, so
2am doesn't exist once a year. Users might be surprised
that their cron trigger doesn't go off one night, but that
is arguably correct (and what happens now). The test can be
modified if we decide to change the trigger behaviour.
2013-03-11 02:36:41 +01:00
Dave Syer 5b6f149bf8 Fix test for daylight savings glitch 2013-03-10 10:03:15 -07:00
Phillip Webb 85f8d6f695 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Replace EasyMock with Mockito
2013-03-06 11:08:17 -08:00
Phillip Webb 05765d7520 Replace EasyMock with Mockito
Issue: SPR-10126
2013-03-06 11:06:15 -08:00
Juergen Hoeller 2302b9b48b Added locale-independent "commonMessages" property to AbstractMessageSource
Issue: SPR-10291
2013-03-06 09:53:12 +01:00
Chris Beams ce4be3b46b Merge branch '3.2.x' into master
Conflicts:
	gradle.properties
	spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
	spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
	spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java
	spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java
	spring-jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
	spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/AbstractLobHandler.java
	spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpRequestWrapper.java
	spring-web/src/main/java/org/springframework/http/client/SimpleBufferingClientHttpRequest.java
	spring-web/src/main/java/org/springframework/http/converter/BufferedImageHttpMessageConverter.java
	spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
2013-03-04 15:41:15 +01:00
Juergen Hoeller 1bae80a241 Polishing 2013-02-27 00:31:05 +01:00
Chris Beams 9a48c10dcb Segregate tests that depend on the jmxmp: protocol
This commit introduces TestGroup#JMXMP and adds assumptions to related
tests accordingly. These tests require the jmxoptional_remote jar on the
classpath, and are run nightly in the SPR-PERF build.

Issue: SPR-8089
2013-02-26 16:52:29 +01:00
Chris Beams 10648942c3 Update AbstractMBeanServerTests hierarchy to JUnit 4
This commit lays the groundwork for introducing TestGroup#JMXMP and
related assumptions in select JMX-related tests in a subsequent commit;
JUnit assumptions require JUnit 4+ to function properly, so the entire
AbstractMBeanServerTests hierarchy must be moved over to JUnit 4+ style.

Issue: SPR-8089
2013-02-26 16:48:55 +01:00
Chris Beams cbe03093ba Revert "Revert "Re-enable ignored JMX tests""
This reverts commit cc814519c8.

Issue: SPR-8089
Conflicts:
	spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTestsIgnore.java
	spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTestsIgnore.java
2013-02-26 16:46:13 +01:00
Juergen Hoeller add6a7faa0 Updated note on Bean Validation 1.1 2013-02-15 18:24:11 +01:00
Phillip Webb 66ae626f91 Only register Date converters with global format
Change JodaTimeFormatterRegistrar and DateFormatterRegistrar to only
register converters for the Date and Calendar types when a global format
has been defined. This means that the ObjectToObject converter will
handle String->Date conversion using the deprecated Date(String)
constructor (as was the case with Spring 3.1).

Issue: SPR-10105
2013-02-12 11:09:32 -08:00
Phillip Webb dbe3c234d6 Polish 2013-02-12 10:33:01 -08:00
Juergen Hoeller cef97819c5 Fixed regression in SpringValidatorAdapter's retrieval of invalid values
Issue: SPR-10243
2013-02-11 12:21:46 +01:00
Phillip Webb 19eecb151b Add @Ignored Test case to reproduce SPR-10243
Issue: SPR-10243
2013-02-10 18:54:28 -08:00
Phillip Webb 36b2e1f192 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Replace EasyMock with Mockito in spring-jms
  Add testMany test to TestGroup.PERFORMANCE
  Polish @Test annotation position
2013-02-10 12:21:33 -08:00
Juergen Hoeller e9db785799 Polishing 2013-02-10 21:10:58 +01:00
Juergen Hoeller aa576e70be Fixed test class name 2013-02-10 21:10:51 +01:00
Juergen Hoeller a86a77ad81 ConfigurationClassPostProcessor detects covariant return type mismatch, avoiding infinite recursion
Issue: SPR-10261
2013-02-09 23:21:35 +01:00
Juergen Hoeller af8e6255e2 Refined CronSequenceGenerator's rounding up of seconds to address second-specific cron expressions
Issue: SPR-9459
2013-02-08 21:13:04 +01:00
Juergen Hoeller 89c3d03083 @Async's qualifier works for target class annotations behind a JDK proxy as well
Also optimized AsyncExecutionAspectSupport's Executor-per-Method caching to use a ConcurrentHashMap.

Issue: SPR-10274
2013-02-08 16:08:05 +01:00
Phillip Webb c4f79bb997 Merge branch '3.2.x' into cleanup-3.2.x
* 3.2.x:
  Promote use of @PostConstruct and @PreDestroy
  @Scheduled provides String variants of fixedDelay, fixedRate, initialDelay for placeholder support
  Further preparations for 3.2.2
  @Scheduled provides String variants of fixedDelay, fixedRate, initialDelay for placeholder support
  Folded a FactoryBean-specific check into predictBeanType now
  Fix Assert.instanceOf exception message
  Allow for ordering of mixed AspectJ before/after advices
  Minor javadoc and source layout polishing
  Fixed documentation for "depends-on" attribute
  "depends-on" attribute on lang namespace element actually respected at runtime now
  Allow for ordering of mixed AspectJ before/after advices
2013-02-07 17:37:13 -08:00
Juergen Hoeller 0058503cf0 @Scheduled provides String variants of fixedDelay, fixedRate, initialDelay for placeholder support
Issue: SPR-8067
2013-02-08 01:13:08 +01:00
Juergen Hoeller 9255d3038f @Scheduled provides String variants of fixedDelay, fixedRate, initialDelay for placeholder support
Issue: SPR-8067
2013-02-08 00:58:39 +01:00
Juergen Hoeller b3c9a11bd1 Folded a FactoryBean-specific check into predictBeanType now
This change means that we effectively revert SPR-8954's code change in favor of the isFactoryBean implementation simply relying on predictBeanType to sort it out, filtering a post-processed predictedType for FactoryBean applicability.

Issue: SPR-9177
Issue: SPR-9143
2013-02-07 23:23:25 +01:00
Juergen Hoeller 9ffbee332c Fixed documentation for "depends-on" attribute 2013-02-07 15:28:25 +01:00
Juergen Hoeller 0d66df26da "depends-on" attribute on lang namespace element actually respected at runtime now
Issue: SPR-8625
2013-02-07 15:27:43 +01:00
Phillip Webb fd831bc19e Add testMany test to TestGroup.PERFORMANCE 2013-02-06 14:29:06 -08:00
Phillip Webb b21063ec05 Polish @Test annotation position 2013-02-06 14:25:28 -08:00
Juergen Hoeller 6b82d293d5 ConfigurationClassPostProcessor allows for overriding of scoped-proxy bean definitions
Issue: SPR-10265
2013-02-06 21:01:49 +01:00
Phillip Webb 501ce65055 Polish @Configuration javadoc 2013-02-04 15:00:45 -08:00
Phillip Webb 8c2ace33cb Support 'unless' expression for cache veto
Allow @Cachable, @CachePut and equivalent XML configuration to provide
a SpEL expression that can be used to veto putting an item into the
cache. Unlike 'condition' the 'unless' parameter is evaluated after
the method has been called and can therefore reference the #result.

For example:

    @Cacheable(value="book",
        condition="#name.length < 32",
        unless="#result.hardback")

This commit also allows #result to be referenced from @CacheEvict
expressions as long as 'beforeInvocation' is false.

Issue: SPR-8871
2013-02-04 11:59:15 -08:00
Phillip Webb f464a45ba4 Polish formatting
Minor formatting polish across that codebase. Primarily fixing
whitespace issues.
2013-02-04 10:35:25 -08:00
Phillip Webb aac6b913d6 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Fix unnecessary @SupressWarnings annotations
  Fix Javadoc warnings
  Fix unused local variable warnings
  Fix unused type compiler warnings
  Fix 'is already an instance of type' warnings
2013-01-31 12:52:51 -08:00
Juergen Hoeller 6d77f1cf3b ConfigurationClassPostProcessor consistently uses ClassLoader, not loading core JDK annotations via ASM
Issue: SPR-10249
2013-01-31 16:51:56 +01:00
Phillip Webb d89e30b864 Fix unnecessary @SupressWarnings annotations 2013-01-29 15:37:25 -08:00
Phillip Webb 065b1c0e46 Fix unused local variable warnings 2013-01-25 14:35:19 -08:00
Phillip Webb 6a1e841952 Fix unused type compiler warnings 2013-01-25 14:35:07 -08:00
Phillip Webb 88f5dd6ce1 Fix 'is already an instance of type' warnings 2013-01-25 11:29:54 -08:00
Chris Beams 39c00c489e Avoid UnsupportedOperationEx. with active SecurityManager
Issue: SPR-9970
2013-01-24 15:08:07 +01:00
Juergen Hoeller ede9d535ea Updated resolvePath javadoc to reflect Environment-based placeholder resolution
Issue: SPR-9455
2013-01-23 22:00:35 +01:00
Juergen Hoeller 4c823a3f9b DisposableBeanAdapter detects "shutdown" as a destroy method as well (for EHCache CacheManager setup)
Issue: SPR-9713
2013-01-23 22:00:34 +01:00
Juergen Hoeller a425d717b7 ThreadPoolExecutorFactoryBean exposes "createExecutor" method for custom ThreadPoolExecutor subclasses
Issue: SPR-9435
2013-01-23 22:00:32 +01:00
Juergen Hoeller 4dde7c4c16 MBeanInfoAssembler impls expose actual method parameter names if possible
Issue: SPR-9985
2013-01-23 22:00:31 +01:00
Sam Brannen 3b8aba9ccd Fix typo in ContextLifecycleScheduledTaskRegistrar 2013-01-23 16:48:08 +01:00
Juergen Hoeller d5af9dc0a5 Polishing 2013-01-23 01:32:28 +01:00
Juergen Hoeller 89db04ec75 Added "awaitTerminationSeconds" property to ThreadPoolTaskExecutor/ThreadPoolTaskScheduler
Issue: SPR-5387
2013-01-23 01:32:27 +01:00
Juergen Hoeller ece727bf57 Introduced NoUniqueBeanDefinitionException as a dedicated subclass of NoSuchBeanDefinitionException
Issue: SPR-10194
2013-01-22 23:29:20 +01:00
Juergen Hoeller 0efdd3d566 Aligned XML scheduled-task elements with @Scheduled in terms of kicking in after context refresh
Issue: SPR-9231
2013-01-22 23:29:19 +01:00
Juergen Hoeller 8e75eee9b2 SpringValidationAdapter properly detects invalid value for JSR-303 field-level bean constraints
Issue: SPR-9332
2013-01-22 21:12:04 +01:00
Phillip Webb 21becef1bd Support Date to String in JodaTimeConverters
Update JodaTimeConverters in include support for Date to String
conversion.

The JodaTimeFormattingTests and DateFormattingTests have been extended
to ensure that Date to String conversion is supported with or without
Joda.

Issue: SPR-10198
2013-01-21 10:55:25 -08:00
Juergen Hoeller cca255bc79 Added "exposeAccessContext" flag JndiRmiClientInterceptor/ProxyFactoryBean (for WebLogic)
Issue: SPR-9428
2013-01-18 16:51:21 +01:00
Juergen Hoeller 3dd817585b MBeanExporter does not log warnings for manually unregistered MBeans
Issue: SPR-9451
2013-01-18 14:43:11 +01:00
Juergen Hoeller 721fa9db6a SpringBeanAutowiringInterceptor eagerly releases BeanFactory if post-construction fails
Issue: SPR-10013
2013-01-18 14:12:02 +01:00
Juergen Hoeller 2cd23a79a3 Polishing 2013-01-15 22:09:16 +01:00
Juergen Hoeller 450dbb2810 Reintroduced "mode" and "proxy-target-class" attributes in spring-task-3.1/3.2.xsd
Issue: SPR-10177
2013-01-15 22:05:21 +01:00
Juergen Hoeller a3211782a6 AbstractCacheManager accepts no caches defined, allowing for EHCache default cache setup
Issue: SPR-7955
2013-01-15 15:54:14 +01:00
Rossen Stoyanchev 54c873b4c4 Support multiple Validators in DataBinder
DataBinder now allows registering additional Validator instances.
This may be useful when adding a Spring Validator to a globally
registered JSR-303 LocalValidatorFactoryBean.

Issue: SPR-9436
2013-01-11 16:28:19 -05:00
Juergen Hoeller 3a9ca4a6bb MessageSourceResourceBundle overrides JDK 1.6 containsKey method, avoiding NPE in getKeys
Issue: SPR-10136
2013-01-10 17:00:40 +01:00
Chris Beams 662a02b952 Fix several miscellaneous compiler/Eclipse warnings
- Suppress an (intentional) AspectJ warning
 - Remove unused imports
 - Suppress a [hiding] warning
 - Fix a generics warning related to extension of final types

Issue: SPR-9431
2013-01-04 11:41:49 +01:00
Chris Beams 51b307681a Fix warnings due to unused import statements
Issue: SPR-9431
2013-01-04 11:04:54 +01:00
Chris Beams b836e14b5f Merge branch 'cleanup-test-duplicates' into cleanup-3.2.x
* cleanup-test-duplicates:
  Update Apache license headers for affected sources
  Remove duplicate test classes
  Replace test beans with test objects

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
2013-01-04 10:31:31 +01:00
Chris Beams d1e6dbe74a Update Apache license headers for affected sources 2013-01-04 10:29:11 +01:00
Phillip Webb 42b5d6dd7e Remove duplicate test classes
Prior to this commit many test utility classes and sample beans were
duplicated across projects. This was previously necessary due to the
fact that dependent test sources were not shared during a gradle
build. Since the introduction of the 'test-source-set-dependencies'
gradle plugin this is no longer the case.

This commit attempts to remove as much duplicate code as possible,
co-locating test utilities and beans in the most suitable project.
For example, test beans are now located in the 'spring-beans'
project.

Some of the duplicated code had started to drift apart when
modifications made in one project where not ported to others. All
changes have now been consolidated and when necessary existing tests
have been refactored to account for the differences.

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
2013-01-04 10:02:29 +01:00
Chris Beams 7a737bebdd Merge branch '3.2.x' into master
* 3.2.x:
  Fix ClassCastException when setting media types
  Enable execution of TestNG tests in spring-test
  Polish support for topic branch-specific versions
  Segregate add'l long-running and performance tests
  Eliminate EBR dependencies and repository config
  Skip creation of IDEA metadata for spring-aspects
  Fix Eclipse compilation error in Gradle plugin
  Polish build.gradle
  Fix null parameterName issue in content negotiation
  Recursively add test dependencies
2013-01-03 22:31:52 +01:00
Chris Beams 68e3b7773c Segregate add'l long-running and performance tests
- Add TestGroup#LONG_RUNNING to distinguish from #PERFORMANCE, the
   former being tests that simply take a long time vs the latter being
   tests that are actually dependent on certain actions happening within
   a given time window and are thefore CPU-dependent.

Issue: SPR-9984
2013-01-03 19:28:05 +01:00
Chris Beams 961dbdb68a Merge branch '3.2.x' into master
* 3.2.x:
  Exclude spring-build-src from maven publish
  Move spring-build-junit into spring-core
  Relocate MergePlugin package
  Develop a gradle plugin to add test dependencies
  Expose Gradle buildSrc for IDE support
  Fix [deprecation] compiler warnings
  Upgrade to xmlunit version 1.3
  Improve 'build' folder ignores
  Fix regression in static setter method support
  Fix SpEL JavaBean compliance for setters

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
2013-01-02 10:36:57 +01:00
Chris Beams 70eaf02b7f Revert "Merge branch 'SPR-10130' into cleanup-master"
This reverts commit 45fa50821a, reversing
changes made to a312d900f8.
2013-01-02 10:33:59 +01:00
Phillip Webb 65fb26f847 Move spring-build-junit into spring-core
Move code from spring-build-junit into spring-core/src/test along with
several other test utility classes. This commit removes the temporary
spring-build-junit project introduced in commit
b083bbdec7.
2013-01-01 19:49:45 -08:00
Phillip Webb 6626a38730 Fix [deprecation] compiler warnings
Fix deprecation compiler warnings by refactoring code or applying
@SuppressWarnings("deprecation") annotations. JUnit tests of
internally deprecated classes are now themselves marked as
@Deprecated.

Numerous EasyMock deprecation warnings will remain until the
migration to mockito can be completed.
2013-01-01 13:42:15 -08:00
Chris Beams b2a048b6f3 Update Apache license headers for affected sources 2012-12-28 23:57:33 +01:00
Chris Beams 3b40ce76bf Add @Override annotations to main sources
Issue: SPR-10130
2012-12-28 23:53:24 +01:00
Chris Beams 8472a2b2ab Update Apache license headers for affected sources 2012-12-28 23:09:31 +01:00
Phillip Webb 60032e0012 Ignore performance-sensitive tests by default
Make use of the new JUnit functionality introduced in the previous
commit to 'Assume' that perfomance- and timing-sensitive tests should
run only when TestGroup.PERFORMANCE is selected, i.e. when
-PtestGroups="performance" has been provided at the Gradle command line.

The net effect is that these tests are now ignored by default, which
will result in far fewer false-negative CI build failures due to
resource contention and other external factors that cause slowdowns.

We will set up a dedicated performance CI build to run these tests on
an isolated machine, etc.

Issue: SPR-9984
2012-12-28 23:08:37 +01:00