Commit Graph

3843 Commits

Author SHA1 Message Date
Chris Beams 29764a98b9 Resolve or eliminate Environment-related TODOs
Issue: SPR-8031, SPR-7508

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4096 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-15 12:57:12 +00:00
Chris Beams 01ecc6600b @Feature methods accept @Value-annotated params
Previously errors were being raised when trying to inject @Value
annotated paramaters such as:

@Feature
public FeatureSpec feature(@Value("#{environment['foo']}") String foo) {
    return new FeatureSpec(foo);
}

This is not so much because dependency resolution of @Value-annotated
types was failing, but rather because the 'early bean reference'
proxying mechanism was throwing an exception if any final type was
detected as a parameter. This is of course because final types are
non-subclassable by CGLIB.  On review, however, it's obvious that
certain final types must be allowed for injection.  @Value injection
is an obvious one, but the rarer case of a Spring bean of type String
or int is another.

The explicit guard against final types as parameters to @Feature methods
has been removed. Final types are still checked for, however, and if
found, no proxing is attempted.  The dependency is immediately resolved
against the current BeanFactory and injected into the @Feature method.

This means that @Value injection, @Qualifier injection, etc all work
as expected, but does mean that premature bean instantiation may occur
if a user unwittingly injects non-String, non-primitive final bean types
as @Feature method parameters.

Issue: SPR-7974

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4094 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-15 07:09:49 +00:00
Chris Beams ea5b4c4b21 Docs reflect bean id change from xsd:ID->xsd:string
Issue: SPR-8054

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4091 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-14 11:10:12 +00:00
Chris Beams 807a960709 Deregister @Configuration CGLIB callbacks
CGLIB-enhanced @Configuration subclasses now implement DisposableBean
such that Enhancer.registerStaticCallbacks(subclass, null) is invoked
on container shutdown. This ensures that garbage collection can work
properly and avoids memory consumption issues for applications that
create and destroy many application contexts within the same JVM.

Issue: SPR-7901

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4090 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-14 09:20:19 +00:00
Chris Beams c4d13f6db9 Fix context:property-placeholder XSD type hierarchy
context:property-placeholder extends 'propertyPlaceholder' type
defintion once again.  This relationship was inadvertently removed in
3.1 M1, and the effect was that XML tooling would raise errors on
use of attributes like 'location'.

The updated schema has also been published to

    http://www.springframework.org/schema/context/spring-context-3.1.xsd

Issue: SPR-8037

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4088 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-13 19:12:50 +00:00
Chris Beams d57071b2f5 Polish imports
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4087 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-13 19:12:10 +00:00
Sam Brannen a89b9c69f9 [SPR-8030] Updated reference manual regarding deprecation of JUnit 3.8 base classes.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4086 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-13 00:25:58 +00:00
Chris Beams 5b14af2625 Process @ImportResource with current ResourceLoader
Issue: SPR-7973

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4085 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-12 12:24:38 +00:00
Chris Beams 8b98044d03 Test injection of Environment on @Feature methods
Issue: SPR-7975

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4084 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-12 12:24:20 +00:00
Chris Beams 6b616956fc Test injection of special types on @Feature methods
Prove that injection of special container types such as ResourceLoader,
BeanFactory, etc already works with the current implementation of
@Feature methods.

Issue: SPR-7975

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4082 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-11 12:40:51 +00:00
Chris Beams 39c43de27d Allow other delimiters in profile XML attribute
Previously, only commas could delimit <beans profile="p1,p2"/>.  Now, as
with <bean alias="..."/>, the profile attribute allows for delimiting
by comma, space and/or semicolon.

BeanDefinitionParserDelegate.MULTI_VALUE_ATTRIBUTE_DELIMITERS has been
added as a constant to reflect the fact this set of delimiters is used
in multiple locations throughout the framework.
BDPD.BEAN_NAME_DELIMITERS now refers to the above and has been has been
preserved but deprecated for backward compat (though use outside the
framework is unlikely).

Changes originally based on user comment at
http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/comment-page-1/#comment-184455

Issue: SPR-8033

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4081 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-11 04:08:10 +00:00
Chris Beams d0a22cd2ce Fix 'Dymaic'->'Dynamic' typo in graphic (SPR-7715)
Also regenerate all OmniGraffle-based PNG graphics for color consistency

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4077 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-10 14:09:11 +00:00
Chris Beams 9156a9d8f6 Polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4076 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-10 14:08:58 +00:00
Sam Brannen 890603543e [SPR-8030] AbstractJUnit38SpringContextTests and AbstractTransactionalJUnit38SpringContextTests are now officially deprecated.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4071 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-09 11:47:53 +00:00
Sam Brannen 07b55d2bac [SPR-8030] AbstractJUnit38SpringContextTests and AbstractTransactionalJUnit38SpringContextTests are now officially deprecated.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4070 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-09 11:45:43 +00:00
Costin Leau 401cc86d90 + fix missing tag
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4069 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-07 12:59:04 +00:00
Costin Leau 3a5bed2124 + revert back deleted resource
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4068 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 18:19:19 +00:00
Costin Leau fd6bea7b25 + more configuration file
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4067 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 17:14:10 +00:00
Costin Leau 1eb54b700d SPR-8015
+ update default key generator strategy to improve compatibility for implicit declaration on one arg method
+ updated docs


git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4066 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 17:13:24 +00:00
Costin Leau e4261b936a + fix bug that prevented internal expression cache from being used
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4065 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 17:06:28 +00:00
Costin Leau 040b5397ce SPR-8006
+ fix contains/get race-condition of caches (by adding an extra cache call)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4064 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 12:27:46 +00:00
Costin Leau fbc4c37946 + update copyright headers
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4063 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 11:53:12 +00:00
Costin Leau 580d8024fd SPR-8006
SPR-8023
- remove unneeded method


git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4062 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 11:43:25 +00:00
Costin Leau 8062b4ad59 SPR-8008
SPR-8023
+ fix bug in Ehcache cache that considered expired entries for key checks

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4061 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-06 11:36:36 +00:00
Sam Brannen 5cdc285aba Fixed typos
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4060 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-04 23:12:09 +00:00
Rossen Stoyanchev ea6f6d9696 SPR-7406 Improve documentation on handler method parameter type conversion.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4059 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-04 19:59:16 +00:00
Rossen Stoyanchev 8f5dc17ebc SPR-6932 Add option to extract value from single-key models in MappingJacksonJsonView
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4058 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-04 14:19:14 +00:00
Rossen Stoyanchev ffb76a6046 SPR-2692 Add URI template support to RedirectView
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4057 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-03 15:54:29 +00:00
Rossen Stoyanchev a9ddca1100 Improve docs for MvcDefaultServletHandler container feature.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4056 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-01 14:32:34 +00:00
Oliver Gierke 70f61b99d3 SPR-8005 - Made GenericTypeResolver.getTypeVariableMap(…) and resolvetype(…) public.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4055 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-28 17:09:09 +00:00
Arjen Poutsma 0cbaea735c @MVC 2.0: AbstractAnnotationMAR -> AbstractNamedValueMAR
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4037 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-25 11:05:14 +00:00
Costin Leau eda0a1049f + add missing # to SpEL variables
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4035 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-24 15:06:03 +00:00
Rossen Stoyanchev 00fde776d2 SPR-7976 Add MvcInterceptors features.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4030 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-22 16:13:04 +00:00
Arjen Poutsma 237b9b509d Added equals and hashcode
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4029 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-22 13:33:24 +00:00
Juergen Hoeller dcc91fc32a final preparations for 3.1 M1 release
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3996 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 23:20:28 +00:00
Juergen Hoeller 41245cd566 fixed scheduling tests
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3995 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 23:04:40 +00:00
Juergen Hoeller 637117c51a exceptions thrown by @Scheduled methods will be propagated to a registered ErrorHandler (SPR-7723)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3994 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 22:50:16 +00:00
Juergen Hoeller e116123f3e polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3993 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 22:19:10 +00:00
Chris Beams 53bf88ebaa Further compensation for STS version mismatch
Current STS version of Spring (3.0.5) does not contain
the BeanUtils.instantiateClass(Class<?>, Class<T>) signature
that was added in 3.1.0, therefore NoSuchMethodErrors are
being thrown when STS classloads and delegates to
3.1.0 NamespaceHandler and BeanDefinitionParser implementations
on the user project classpath.

In this case, it's AbstractSpecificationBeanDefinitionParser
doing the calling to the unknown new method.  In this specific
example, reverting back to the old single-arg signature is actually
not a problem, because it does accept Class<T> and returns an
instance of type T, which was the desired behavior in the first
place.

The newer signature remains in order to accommodate callers
who do not know the generic type of the Class to be instantiated
(i.e. Class<?>), but do know the type that it should be assignable
to -- this becomes the second argument Class<T>, and an instance
of type T is returned (if indeed it is assignable to the specified
type; otherwise IllegalArgumentException.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3992 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 17:59:26 +00:00
Chris Beams 780b32c909 Re-introduce and deprecate BDPD.initDefaults(Element)
For compatibility with Spring Integration's standalone usage of
BeanDefinitionParserDelegate.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3991 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 13:33:09 +00:00
Sam Brannen d94cbd236a [SPR-7953] BeanDefinitionVisitor now actually visits factory method names.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3990 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 13:08:31 +00:00
Sam Brannen ff2aae8ba3 [SPR-7953] BeanDefinitionVisitor now actually visits factory method names.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3989 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 13:01:58 +00:00
Juergen Hoeller 1b2625e20a prepared 3.1 M1 changelog
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3988 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 02:07:14 +00:00
Juergen Hoeller 27766b7fab renamed AbstractPropertyPlaceholderConfigurer to PlaceholderConfigurerSupport
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3987 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 02:01:02 +00:00
Juergen Hoeller c182283beb turned to package visibility
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3986 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 01:58:21 +00:00
Juergen Hoeller 541f8595ab renamed AbstractPropertyPlaceholderConfigurer to PlaceholderConfigurerSupport
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3985 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 01:55:11 +00:00
Juergen Hoeller c16e01cb14 removed ConversionService/TypeConverter convenience methods in order to restore 3.0's SPI (for backwards compatibility with implementers)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3984 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 01:36:57 +00:00
Juergen Hoeller 4bd265f0a4 removed ConversionService/TypeConverter convenience methods in order to restore 3.0's SPI (for backwards compatibility with implementers)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3983 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 01:24:08 +00:00
Chris Beams 1a751de04f Further compensations for STS; binary compat fixes
Defensively catch NoSuchMethodError when calling BDPD.getEnvironment()
and supply a DefaultEnvironment if not available.

Replace the single-arg constructor for BDPD and deprecate, preserving
binary compat particularly for Spring Integration who instantiates
this class directly, which is unusual.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3982 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 00:30:30 +00:00
Chris Beams 3fbe9d5a55 Fix STS compatibility issues; other improvements
Revert changes to ParserContext, ReaderContext, and XmlReaderContext

    These changes cause cross-version incompatibilities at tooling time
    -- for instance, an STS version that ships with Spring 3.0.5
    classloads the ParserContext defined in that version, whereas it
    classloads NamespaceHandlers and BeanDefinitionParsers (by default)
    from the user application classpath, which may be building against
    3.1.0. If so, the changes introduced to these types in 3.1.0 are
    incompatible with expectations in the 3.0.5 world and cause all
    manner of problems.  In this case, it was NoSuchMethodError due to
    the newly-added XmlReaderContext.getProblemReporter() method; also
    IncompatibleClassChangeError due to the introduction of the
    ComponentRegistrar interface on ParserContext.

    Each of these problems have been mitigated, though the solutions
    are not ideal. The method mentioned has been removed, and instead
    the problemReporter field is now accessed reflectively.
    ParserContext now no longer implements ComponentRegistrar, and
    rather a ComponentRegistrarAdapter class has been introduced that
    passes method calls through to a ParserContext delegate.

Introduce AbstractSpecificationBeanDefinitionParser

    AbstractSpecificationBeanDefinitionParser has been introduced in
    order to improve the programming model for BeanDefinitionParsers
    that have been refactored to the new FeatureSpecification model.
    This new base class and it's template method implementation of
    parse/doParse ensure that common concerns like (1) adapting a
    ParserContext into a SpecificationContext, (2) setting source and
    source name on the specification, and (3) actually executing the
    specification are all managed by the base class.  The subclass
    implementation of doParse need only actually parse XML, populate
    and return the FeatureSpecification object.  This change removed
    the many duplicate 'createSpecificationContext' methods that had
    been lingering.

Minor improvement to BeanDefinitionReaderUtils API

    Introduced new BeanDefinitionReaderUtils#registerWithGeneratedName
    variant that accepts BeanDefinition as opposed to
    AbstractBeanDefinition, as BeanDefinition is all that is actually
    necessary to satisfy the needs of the method implementation. The
    latter variant accepting AbstractBeanDefinition has been deprecated
    but remains intact and delegates to the new variant in order to
    maintain binary compatibility.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3980 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-09 16:44:26 +00:00