Commit Graph

3874 Commits

Author SHA1 Message Date
Chris Beams 0e2ce565c9 All SFBuilder setters return 'this' & use varargs
Touch up a few setter methods across the SessionFactoryBuilder
hierarchy that were still returning void.

Use varargs... syntax wherever possible.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4151 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 14:28:30 +00:00
Chris Beams 63fdcbc1dc Fix obscure STS error
Remove all bean configuration files from .springBeans to avoid cryptic
STS error.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4150 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 14:28:08 +00:00
Rossen Stoyanchev 3473219bad Predictable index position for BindingResult keys and parameter annotation convenience methods in MethodParameter
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4149 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 14:16:37 +00:00
Chris Beams 2de526d31e Increase visibility of MapPropertySource constructor
Was protected due to oversight, now public.

Issue: SPR-8107

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4148 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:29:32 +00:00
Chris Beams 9e8259198f Introduce (Annotation)SessionFactoryBuilder types
Large refactoring of existing *SessionFactoryBean hierarchy designed to
support configuration of Hibernate SessionFactory objects within
@Configuration class @Bean methods without forcing use of a
FactoryBean type, which is generally discouraged due to awkwardness
of programming model and lifecycle issues.  Refactored and new types
include:

    * Removal of AbstractSessionFactoryBean, replacing it with
      SessionFactoryBeanSupport abstract base class

    * Introduction of SessionFactoryBuilder and
      AnnotationSessionFactoryBuilder types, both direct subclasses of
      SessionFactoryBuilderSupport. These types are intended for direct
      use within @Bean methods. They expose method-chainable set*
      methods allowing for concise and convenient use. See JavaDoc
      on both types for usage examples.

    * LocalSessionFactoryBean and AnnotationSessionFactoryBean types are
      now subclasses, respectively, of the *Builder types above.

LSFB and ASFB backward-compatibility has been maintained almost
entirely. The one exception is that there is no longer a protected
convertHibernateAccessException() method available in the hierarchy.
This method was not likely often used anyway and has been replaced
by the new (and public) setPersistenceExceptionTranslator() which
accepts instances of type HibernateExceptionTranslator as introduced in
SPR-8076.

LSFB and ASFB setter method signatures have changed. They no longer
return void in standard JavaBeans style but rather, and due to extending
the *Builder types above, return the 'this' reference. This posed a
problem because the Spring container has to date been unable to detect
and provide dependency injection against non-void returning setter
methods. This limitation was due to the way that the default JavaBeans
Introspector class and its getBeanInfo() method works, and prompted the
introduction and intergration of ExtendedBeanInfo, already completed in
SPR-8079. So have no concern if you notice this signature change - it
all works.

Certain deprecations have been made:

    * All LSFB/ASFB methods related to Hibernate's CacheProvider SPI,
      reflecting its deprecation in Hibernate 3.3 in favor of the new
      RegionFactory SPI. Note these methods have been preserved only
      on the FactoryBean types. The new *SessionFactoryBuilder
      supertypes do not expose CacheProvider services at all.

    * All protected LSFB/ASFB methods that accept a Hibernate
      Configuration parameter, such as newSessionFactory(Configuration),
      postProcessMappings(Configuration) and
      postProcessConfiguration(Configuation), in favor of no-arg methods
      with the same names. Due to the nature of the hierarchy
      refactoring mentioned above, the Configuration instance is always
      available when these methods are called, thus no need to pass it
      in as a parameter.

In the process, our approach to automatic detection of Hibernate dialect
has been improved (it was in fact broken before). Thanks to James
Roper for his suggestion in SPR-7936 as to how to fix this.

See HibernateSessionFactoryConfigurationTests as a starting point for
understanding the new builder-style approach to SessionFactory creation.
Note especially use of the SessionFactoryBuilder#doWithConfiguration
method which allows for direct programmatic configuration of the Native
Hibernate (Annotation)Configuration API.

As a final note, AnnotationConfiguration has been deprecated in
Hibernate 3.6, and great pains have been taken to ensure that users
of any supported Hibernate version (3.2 -> 3.6) will never need to
(a) cast from Configuration to AnnotationConfiguration or (b)
experience deprecation warnings due to being forced to use the
AnnotationConfiguration API. Explore the JavaDoc around the
doWithConfiguration() method and HibernateConfigurationCallback type
for complete details.

Issue: SPR-8066, SPR-7936, SPR-8076, SPR-8098

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4147 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:29:12 +00:00
Chris Beams 48089d0925 Propagate wrapped exception in SessionFactoryUtils
Improve stack traces in certain Hibernate failure cases by properly
chaining the cause exception.

Issue: SPR-7933

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4146 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:07:30 +00:00
Chris Beams 54a5a39de9 Introduce HibernateExceptionTranslator
Designed to allow persistence exception translation of
HibernateException types without being forced to use
LocalSessionFactoryBean types.

Committed now in support of the forthcoming introduction of
*SessionFactoryBuilder types.

Issue: SPR-8076

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4145 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:06:58 +00:00
Chris Beams 1271acb8eb Introduce ExtendedBeanInfo
Decorator for instances returned from
Introspector#getBeanInfo(Class<?>) that supports detection and inclusion
of non-void returning setter methods. Fully supports indexed properties
and otherwise faithfully mimics the default
BeanInfo#getPropertyDescriptors() behavior, e.g., PropertyDescriptor
ordering, etc.

This decorator has been integrated with CachedIntrospectionResults
meaning that, in simple terms, the Spring container now supports
injection of setter methods having any return type.

Issue: SPR-8079

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4144 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:06:36 +00:00
Sam Brannen 3c25a17ddf [SPR-6184] AnnotationConfigContextLoader now calls AnnotationConfigApplicationContext's register(Class<?>...) method in one go, via var-args.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4142 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 00:00:31 +00:00
Sam Brannen d20150b0d5 [SPR-6184] AnnotationConfigContextLoader now extends AbstractGenericContextLoader; added new extension points to AbstractGenericContextLoader.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4141 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-30 23:50:19 +00:00
Sam Brannen 8c4a19caf8 [SPR-6184] Initial draft of the new AnnotationConfigContextLoader.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4132 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-29 23:42:59 +00:00
Sam Brannen 80e0a5b8a5 [SPR-6184] Initial draft of the new AnnotationConfigContextLoader.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4131 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-29 23:38:37 +00:00
Sam Brannen c9ae95c578 [SPR-6184] Work in Progress
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4129 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 21:45:14 +00:00
Sam Brannen e3526bde80 Updating JUnit and TestNG versions for IDEs and Maven.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4128 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 19:59:09 +00:00
Sam Brannen 2c90cdf8e6 org.springframework.spring-parent can now be imported into Eclipse
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4127 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 19:58:03 +00:00
Sam Brannen 2bee329d1e [SPR-8089] Added TODOs.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4126 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 19:01:33 +00:00
Sam Brannen 956905a88d [SPR-8089] re-ignoring JMX tests that require the presence of jmxremote_optional.jar.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4124 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 18:38:34 +00:00
Sam Brannen 607d73b161 [SPR-8089] re-ignoring JMX tests that require the presence of jmxremote_optional.jar.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4123 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 18:26:30 +00:00
Sam Brannen fe5a764138 [SPR-8092] cleaning up ignored and broken ORM tests; suppressing warnings; fixed Eclipse classpath for tests.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4122 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 18:16:45 +00:00
Sam Brannen 6a134d83f3 [SPR-8091] developer notes
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4121 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 18:09:14 +00:00
Costin Leau a143e244e4 SPR-7971
+ add target object to KeyGenerator


git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4120 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 18:09:04 +00:00
Sam Brannen 18b5440a9e [SPR-8089] cleaning up ignored and broken JMX tests; suppressing warnings; using generics where feasible; documented the jmxremote_optional.jar requirement in AbstractMBeanServerTests.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4119 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 17:57:01 +00:00
Sam Brannen da384be170 Polishing and fixed broken support for @IfProfileValue in AbstractJpaTests (even though it's deprecated).
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4118 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 17:23:48 +00:00
Sam Brannen 56fa618e12 [SPR-8090] Fixed broken tests in Log4jWebConfigurerTests.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4117 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 17:20:40 +00:00
Sam Brannen 00c3ca6c3f [SPR-8030] AbstractJUnit38SpringContextTests and AbstractTransactionalJUnit38SpringContextTests are now officially deprecated.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4116 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 14:43:01 +00:00
Costin Leau 9fe871635b SPR-8007
+ add more logging

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4115 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 12:10:26 +00:00
Costin Leau a653a50be8 SPR-8007
SPR-7832
+ expose the invocation params through the cache root object
+ update javadocs


git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4114 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 11:36:05 +00:00
Agim Emruli e633c97bff fixed compile error in test with javac compiler
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4110 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-24 11:06:32 +00:00
Chris Beams 6e5a7ad072 Ignore fragile test dependent on debug symbols
Issue: SPR-8078

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4108 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-23 06:20:19 +00:00
Chris Beams d1c5bb0160 Eliminate warnings in .validation package
Issue: SPR-8062

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4103 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-18 06:47:12 +00:00
Chris Beams ea5f28a8fd Remove TODOs related to profile logging
Issue: SPR-8031, SPR-7508, SPR-8057

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4097 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-15 12:57:43 +00:00
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