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
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.
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
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.
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.
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.
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
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
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
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
Rename to PubSubHeaderAccessor and StompHeaderAccessor
Move the renamed classes to support packages
Remove fromPayloadAndHeaders from MessageBuilder, just use
withPayload(..).copyHeaders(..) instead.
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.
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