Commit Graph

511 Commits

Author SHA1 Message Date
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
Phillip Webb d66c733ef4 Replace EasyMock with Mockito in test sources
Issue: SPR-10126
2012-12-28 23:07:04 +01:00
Chris Beams 4c8cd7b0bd Add @Override annotations to test sources
Issue: SPR-10129
2012-12-28 23:05:44 +01:00
Chris Beams 40357be72b Fix various compiler warnings in spring-context
All warning types other than [deprecation] and [unchecked] are now
fixed in spring-context/src/test
2012-12-28 22:50:46 +01:00
Chris Beams 8d2e125e7b Fix [rawtypes] compiler warnings
- Suppress rawtypes warnings for src/main
 - Enable rawtypes warnings for src/test

This commit attempts to to resolve all rawtypes problems across tests as
aggressively as possible, i.e. without regard for binary compatibility,
whereas main sources must be treated much more cautiously with an eye
toward compatibility.
2012-12-28 22:50:46 +01:00
Phillip Webb 6c14eaad61 Fix [cast] compiler warnings 2012-12-28 22:41:06 +01:00
Phillip Webb b0986049a3 Fix [serial] compiler warnings
Fix serialization warnings by applying @SuppressWarnings("serial")
when appropriate.

In certain cases and for unknown reasons, a correctly-placed
@SuppressWarnings("serial") annotation will fix the warning at the
javac level (i.e. the Gradle command-line), but will produce an
"unnecessary @SuppressWarnings" warning within Eclipse. In these
cases, a private static final serialVersionUID field has been added
with the default value of 1L.
2012-12-28 22:41:06 +01:00
Phillip Webb 7f0aa5cfb2 Fix [varargs] compiler warnings
Remove unnecessary 'null' argument from calls to vararg supported
methods and fix cast in ValidationUtils.invokeValidator().
2012-12-28 22:40:49 +01:00
Phillip Webb 731d5be644 Fix warnings due to unused import statements 2012-12-28 22:40:49 +01:00
Chris Beams 9540d2c81b Replace <code> with {@code} throughout Javadoc
Issue: SPR-10128
2012-12-28 22:36:02 +01:00
Chris Beams 8597ec25ec Fix various Javadoc warnings
Issue: SPR-10128
2012-12-28 22:36:02 +01:00
Phillip Webb 2cf45bad86 Replace space indentation with tabs
Issue: SPR-10127
2012-12-28 20:49:56 +01:00
Phillip Webb 1762157ad1 Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
    xargs perl -p -i -e "s/[ \t]*$//g" {} \;

Issue: SPR-10127
2012-12-28 20:49:45 +01:00
Chris Beams 44a474a014 Various updates to support IDEA
Remove the 'final' modifier from SingletonBeanFactoryLocatorTests
to work around the "cannot extend final class" error issued when
running all tests. The error was due to confusion with IDEA between
the two variants of SingletonBeanFactoryLocatorTests across
spring-context and spring-beans.

Rename one of the GroovyMessenger classes to GroovyMessenger2.
Previously there were multiple Groovy classes named
'GroovyMessenger', causing a compilation error in certain IDE
arrangements.

Update import-into-idea.md documentation

Add various IDEA artifacts to .gitignore
 - ignore derby.log wherever it is written
 - ignore IDEA's test-output directory
 - ignore IDEA's Atlassian connector config file
2012-12-28 19:50:04 +01:00
Juergen Hoeller c242abada1 Fixed QualifierAnnotationAutowireCandidateResolver's detection of custom qualifier annotations
Issue: SPR-10107
2012-12-20 17:35:02 +01:00
Juergen Hoeller 047db8cdf8 Fixed AbstractAutoProxyCreator to accept null bean names again
Issue: SPR-10108
2012-12-20 17:33:26 +01:00
Juergen Hoeller c954d10be4 Allow for SpEL expressions in initial-delay attribute
Issue: SPR-10102
2012-12-19 12:09:18 +01:00
Juergen Hoeller b9df7d68d9 Consistent fine-tuning of synchronized and concurrent data structures
In particular, avoiding synchronized Sets and Maps wherever possible (preferring a ConcurrentHashMap even instead of a synchronized Set) and specifying appropriate ConcurrentHashMap initial capacities (even if we end up choosing 16).
2012-12-12 23:46:26 +01:00
Chris Beams f26534700a Eliminate all Javadoc warnings
- Support external Javadoc links using Gradle's javadoc.options.links

 - Fix all other Javadoc warnings, such as typos, references to
   non-existent (or no longer existent) types and members, etc,
   including changes related to the Quartz 2.0 upgrade (SPR-8275) and
   adding the HTTP PATCH method (SPR-7985).

 - Suppress all output for project-level `javadoc` tasks in order to
   hide false-negative warnings about cross-module @see and @link
   references (e.g. spring-core having a @see reference to spring-web).
   Use the `--info` (-i) flag to gradle at any time to see project-level
   javadoc warnings without running the entire `api` task. e.g.
   `gradle :spring-core:javadoc -i`

 - Favor root project level `api` task for detection of legitimate
   Javadoc warnings. There are now zero Javadoc warnings across the
   entirety of spring-framework. Goal: keep it that way.

 - Remove all @link and @see references to types and members that exist
   only in Servlet <= 2.5 and Hibernate <= 4.0, favoring 3.0+ and 4.0+
   respectively. This is necessary because only one version of each of
   these dependencies can be present on the global `api` javadoc task's
   classpath. To that end, the `api` task classpath has now been
   customized to ensure that the Servlet 3 API and Hibernate Core 4 jars
   have precedence.

 - SPR-8896 replaced our dependency on aspectjrt with a dependency on
   aspectjweaver, which is fine from a POM point of view, but causes
   a spurious warning to be emitted from the ant iajc task that it
   "cannot find aspectjrt on the classpath" - even though aspectjweaver
   is perfectly sufficient. In the name of keeping the console quiet, a
   new `rt` configuration has been added, and aspectjrt added as a
   dependency to it. In turn, configurations.rt.asPath is appended to
   the iajc classpath during both compileJava and compileTestJava for
   spring-aspects.

Issue: SPR-10078, SPR-8275, SPR-7985, SPR-8896
2012-12-12 12:55:10 +01:00
Juergen Hoeller c55446da9d Polishing 2012-12-12 03:29:47 +01:00
Juergen Hoeller 1cb6e3dbb6 Several enhancements with respect to CachingMetadataReaderFactory handling.
Added "clearCache()" method to CachingMetadataReaderFactory, for clearing the metadata cache once not needed anymore - in particular when the MetadataReaderFactory instance is long-lived. Also added "setMetadataReaderFactory" method to ClassPathScanningCandidateComponentProvider, analogous to ConfigurationClassPostProcessor.
2012-12-12 03:29:44 +01:00
Juergen Hoeller e298658ef0 Polishing 2012-12-12 03:29:44 +01:00
Juergen Hoeller 801d4714b1 Fixed CGLIB proxy class leaks through further equals/hashCode implementations in Spring AOP pointcuts
Issue: SPR-8008
2012-12-12 03:29:43 +01:00
Juergen Hoeller a92f7dd474 ConfigurationClassPostProcessor consistently uses ClassLoader, not loading core JDK classes via ASM
Issue: SPR-10058
2012-12-05 19:12:05 +01:00
Phillip Webb 0d73d199ec Reset MBean Servers after JRuby and JMX tests
Refactor MBean Server reset code from MBeanServerFactoryBeanTests
and reuse in AdvisedJRubyScriptFactoryTests and
AbstractMBeanServerTests.

Issue: SPR-9288
2012-11-29 14:47:24 -08:00
Juergen Hoeller f1923f406e Removed outdated EjbSupportTests 2012-11-29 23:42:26 +01:00
Juergen Hoeller 230dec8e6f Removed unnecessary dependency on JTA API 2012-11-29 23:14:08 +01:00
Juergen Hoeller 0614d312ed Polishing 2012-11-29 23:13:49 +01:00
Phillip Webb 6ca71abf93 Intermittent MBeanServerFactoryBeanTests failure
Prior to this commit the testWithLocateExistingAndExistingServer method
would fail if any preceding test called the ManagementFactory
getPlatformMBeanServer() method. In such situations the platform
server is located instead of the expected freshly created server.

These failures are more likely to happen when compiling with JDK 7
due to the fact that the reflection API no longer returns methods
in a consistent order.

Unfortunately there is no easy way to reset the platform MBean server
so the new code must resort to using reflection to access the private
static ManagementFactory.platformMBeanServer field.

Issue: SPR-9288
2012-11-26 15:45:21 -08:00
Juergen Hoeller 9c6aa3e43b Java 5 Closeable and Java 7 AutoCloseable automatically detected as destroy methods
Also, @Bean destroy method inference not applying for DisposableBean implementers anymore (avoiding double destruction).

Issue: SPR-10034
2012-11-26 22:47:08 +01:00
Juergen Hoeller 52124fa31b Avoid wide locks in order to remove deadlock potential in case of multi-threaded singleton creation/destruction
Issue: SPR-10020
Issue: SPR-8471
2012-11-25 23:32:52 +01:00
Juergen Hoeller 87b7e3d8cf Fixed @Lazy and @DependsOn annotation definitions to be non-inheritable
Issue: SPR-9589
Issue: SPR-9476
2012-11-25 22:28:23 +01:00
Juergen Hoeller e2f418ab4c Added "transactionAware" bean property to EhCacheCacheManager and JCacheCacheManager
In the course of this enhancement, the "cache.ehcache" and "cache.jcache" packages moved from spring-context to the spring-context-support module, expecting further transaction-related functionality. Also aligns with the presence of Spring's Quartz support in the spring-context-support module, since Quartz and EHCache are sort of sister projects at Terracotta now.

Issue: SPR-9966
2012-11-25 21:58:35 +01:00
Juergen Hoeller 0ec19dc95e Removed OC4J tests 2012-11-25 21:12:59 +01:00
Juergen Hoeller b0c6a24974 Deprecated "scheduling.backportconcurrent" package in favor of native JDK 6 "scheduling.concurrent" support 2012-11-25 21:08:06 +01:00
Juergen Hoeller 4dc336920c Deprecated EJB 2.x implementation class hierarchy in "ejb.support" package 2012-11-25 21:06:25 +01:00
Juergen Hoeller 3d5bfc35b6 Deprecated Oracle OC4J support in favor of Oracle WebLogic 2012-11-25 21:00:56 +01:00
Juergen Hoeller df76f1497a Replaced use of EmbeddedValueResolverAware with ConfigurableBeanFactory's resolveEmbeddedValue in order to avoid a package cycle with the org.springframework.context package
Issue: SPR-10021
2012-11-25 20:18:59 +01:00
Phillip Webb 838ba79f55 Fix Javadoc references to incorrect XML
Replace references to <task:annotation-config> with
<task:annotation-driven>
2012-11-20 12:17:25 -08:00
Phillip Webb 63ca14c33e Clarify use of @Bean with @EnableAsync executors
Update Javadoc to indicate that the getAsyncExecutor() method may be
optionally annotated with @Bean and in such circumstance the
executor.initialize() method need not be called.

Issue: SPR-9934
2012-11-19 10:42:33 -08:00
Oliver Gierke 146a66fe0b Support *Aware ImportBeanDefinitionRegistars
Implementations of Spring's ImportBeanDefinitionRegistrar interface may
now implement any of the following *Aware interfaces and have their
respective methods called prior to #registerBeanDefinitions:

 - BeanFactoryAware
 - BeanClassLoaderAware
 - ResourceLoaderAware

Issue: SPR-9568
2012-11-12 18:26:50 +01:00
Juergen Hoeller f6209cd7af DefaultSingletonBeanRegistry avoids singletonObjects lock wherever possible for non-singleton factory performance
Also fixing setCurrentlyInCreation to use a concurrent Set and to apply to prototype beans as well.

Issue: SPR-9819
2012-11-09 00:54:57 +01:00
Juergen Hoeller de91d754d8 Re-added InitializingBean declaration 2012-11-09 00:13:40 +01:00
Juergen Hoeller ea95da126a Implement java.io.Closeable where appropriate
Issue: SPR-9962
2012-11-08 23:44:49 +01:00
Juergen Hoeller 0a3ea42fe1 DefaultSingletonBeanRegistry avoids singletonObjects lock wherever possible for non-singleton factory performance
Issue: SPR-9819
2012-11-08 23:21:18 +01:00
Sam Brannen 85ab789f2f Refactor & polish DateTimeFormatterFactory[Bean]
This commit refactors the logic in DateTimeFormatterFactory's
createDateTimeFormatter() method to ensure forward compatibility with
possible future changes to the ISO enum.

This commit also polishes the Javadoc for DateTimeFormatterFactoryBean.

Issue: SPR-9959
2012-11-06 18:07:32 +01:00
Phillip Webb 432c6ebdae Refactor DateTimeFormatterFactory
Refactor DateTimeFormatterFactory into two distinct classes; a general
purpose factory and a specialized FactoryBean.  These changes are
modeled after the existing VelocityEngineFactory and
VelocityEngineFactoryBean classes.

Issue: SPR-9959
2012-11-05 11:30:25 -08:00
Sam Brannen 93c01e0710 Fix timezone issue in DateTimeFormatterFactory
The DateTimeFormatterFactory introduced in SPR-7121 supports a timeZone
property; however, this property is currently not properly supported.

This commit addresses this issue by ensuring that the timeZone properly
is honored.

Issue: SPR-9953
2012-11-04 18:59:01 +01:00
Sam Brannen cef5f0222e Polish Javadoc and imports in datetime package
Issue: SPR-7121
2012-11-04 15:37:26 +01:00
Phillip Webb 6660227d22 Support for custom global Joda DateTimeFormatters
Added dateFormatter, timeFormatter and dateTimeFormatter properties
to JodaTimeFormatterRegistrar allowing for custom global formatting.

DateTimeFormatterFactory can be used when configuring with XML.

Issue: SPR-7121
2012-11-03 16:55:23 -07:00
Phillip Webb a26059f94a Support DateTimeFormat annotation without Joda
Dependency on Joda Time when using the @DateTimeFormat annotation is
now optional. If Joda Time is not present the JDK SimpleDateFormat
will be used to parse and print date patterns. If Joda time is
present it will always be used in preference to SimpleDateFormat.

Issue: SPR-6508
2012-11-03 16:55:15 -07:00
Phillip Webb ddddec8719 Corrected date pattern in JavaDocs
The 'hh' pattern should be 'HH' as ISO dates use 24hr notation.
2012-11-03 15:52:31 -07:00
Phillip Webb a75b6ee5b6 Polish whitespace and formatting 2012-11-03 15:49:52 -07:00
Chris Beams c94bc2e709 Respect spring.profiles.active in #addActiveProfile
Prior to this commit, calls to ConfigurableEnvironment#addActiveProfile
would cause any active profile values provided via the
"spring.profiles.active" property to be ignored.

Now these two mechanisms can be used in conjunction and work as
expected.

Issue: SPR-9944
2012-11-02 15:02:13 +01:00
Phillip Webb 468f9c7814 Polish 2012-11-01 11:10:25 -07:00
Phillip Webb 4cdf46f83c Polish @Imports search code
Issue: SPR-9925
2012-10-31 09:30:17 -07:00
Phillip Webb 3416e058a0 Ensure @Imports are processed in correct order
Issue: SPR-9925
2012-10-31 13:40:06 +01:00
Juergen Hoeller 914a1b2088 @Autowired, @Value and qualifiers may be used as meta-annotations for custom injection annotations 2012-10-31 12:10:17 +01:00
Phillip Webb 6d8b37d8bb Prevent duplicate @Import processing
Refactor ConfigurationClassParser to recursively find values from
all @Import annotations, combining them into a single unique set.

This change prevents ImportBeanDefinitionRegistrars from being
invoked twice.

Issue: SPR-9925
2012-10-31 09:42:27 +01:00
Phillip Webb e6c4840356 Polish Javadoc for @Import 2012-10-31 09:42:27 +01:00
Juergen Hoeller 5b93b14392 DateTimeFormat annotation supports use as a meta-annotation as well 2012-10-31 02:53:23 +01:00
Juergen Hoeller 69763fe249 Added test for custom async annotation 2012-10-31 02:53:22 +01:00
Juergen Hoeller 0e0200769d ManagedResource annotation supports placeholders for String attributes
In particular, the specified object name may use a placeholder for its domain part now, allowing for several instances of the MBean to be registered against the same MBeanServer from different applications.

Issue: SPR-8244
2012-10-31 02:53:21 +01:00
Phillip Webb e9cdb3d24e Polish JavaDoc 2012-10-30 12:07:31 -07:00
Chris Beams 38bfb2bd89 Introduce MessageCodeFormatter abstraction
This commit refactors changes introduced in 21760a8 as follows:

 - Introduce top-level MessageCodeFormatter interface and
   DefaultMessageCodesResolver#setMessageCodeFormatter property to allow
   for user-defined message code formatting strategies

 - Rename DefaultMessageCodesResolver.Style enum => DMCR.Format

 - Refactor DefaultMessageCodesResolver.Format to implement the new
   MessageCodeFormatter interface

The result is that users have convenient access to common formatting
strategies via the Format enum, while retaining the flexibility to
provide their own custom MessageCodeFormatter implementation if desired.

See DefaultMessageCodesResolverTests#shouldSupport*Format tests for
usage examples.

Issue: SPR-9707
2012-10-30 12:19:45 +01:00
Phillip Webb 21760a8b6b Provide alternative message code resolver styles
Introduce new 'style' property to DefaultMessageCodesResolver allowing
for alternative message styles. Current styles are PREFIX_ERROR_CODE
and POSTFIX_ERROR_CODE. The default style retains existing behavior.

Issue: SPR-9707
2012-10-30 10:09:36 +01:00
Gareth Davis 0709c033a0 Allow 'arg-type' matches against element body
Allow the body of 'arg-type' XML elements to be used as an alternative to
'match' attribute when defining a 'replace-method' in XML configuration.

This change has been introduced primarily to support the samples printed
in the Apress 'Pro Spring' book.

Issue: SPR-9812
2012-10-27 19:49:54 -07:00
Phillip Webb 376eeed8b1 Polish whitespace 2012-10-27 19:49:54 -07:00
Chris Beams 5d4d1eaca4 Fix package cycle in @EnableMBeanExport
Prior to this commit, @EnableMBeanExport was declared in the
jmx.export.annotation package. This makes logical sense, but
nevertheless creates a package cycle, because @EnableMBeanExport depends
on MBeanExportConfiguration which in turn depends on context.annotation
types like @Configuration, @Bean, and @Role.

context.annotation.config.MBeanExportBeanDefinitionParser, on the other
hand already has dependencies on types in jmx.support. Together, this
means that a package cycle was introduced.

The solution to this is simple: move @EnableMBeanExport and friends from
jmx.export.annotation => context.annotation. This has been the strategy
for other @Enable annotations and for the same reasons. It also makes a
kind of logical sense: just like you find <context:mbean-export> and
<context:load-time-weaver> under the context: XML namespace, so too do
you find their @Enable* counterparts under the context.annotation
namespace.

Issue: SPR-8943
2012-10-26 15:08:14 +02:00
Phillip Webb cae08db6a9 Introduce @EnableMBeanExport
Add support for @EnableMBeanExport annotation allowing @Configuration
classes to easily export all MBeans and @ManagedResources from the
Spring application context. The annotation is functionally equivalent
to the XML <context:mbean-export/> element.

Issue: SPR-8943
2012-10-25 14:25:42 +02:00
Phillip Webb 6179261d58 Polish whitespace 2012-10-25 12:29:32 +02:00
Phillip Webb 33d37e8680 Polish 2012-10-23 07:07:59 -07:00
Phillip Webb 9582085950 Add DefaultMessageCodesResolverTests
Add unit test for DefaultMessageCodesResolver
2012-10-15 10:06:34 -04:00
Juergen Hoeller a6ce821ad8 Made AutoProxyCreatorTests less dependent on container's own interrogation of FactoryBeans
Issue: SPR-9857
2012-10-12 23:34:22 +02:00
Juergen Hoeller 3cf5572ee8 LoadTimeWeaverAware beans are consistently being created early for JPA weaving to work reliably
Reverted change for @Bean methods that declare FactoryBean as their return type: The effects of trying to create the FactoryBean to find out about its implementation type are too far-reaching. It's better to recommend declaring a specific return type in the method signature if you want the container to specifically react to your implementation type.

Issue: SPR-9857
2012-10-12 23:34:22 +02:00
Juergen Hoeller 0af9244571 LoadTimeWeaverAware beans are consistently being created early for JPA weaving to work reliably
Includes a change for factory methods that declare their return type as FactoryBean: When asked for a specific type match (e.g. LoadTimeWeaverAware), we do check early singleton instances as well (reusing the instances that we create for getObjectType checks). This is necessary in order to make @Bean method introspection as capable as XML bean definition introspection, even in case of the @Bean method using a generic FactoryBean declaration for its return type (instead of the FactoryBean impl class).

Issue: SPR-9857
2012-10-12 23:34:21 +02:00