Permalink
Commits on Oct 12, 2011
  1. Update changelog re destroy method inference

    Issue: SPR-8751
    cbeams committed Oct 12, 2011
  2. Support destroy method inference

    Anywhere the value of a destroy method may be expressed, specifying
    the value "(inferred)" now indicates that the container should attempt
    to automatically discover a destroy method. This functionality is
    currently limited to detecting public, no-arg methods named 'close';
    this is particularly useful for commonly used types such as Hibernate
    SessionFactory most JDBC DataSource implementations, JMS connection
    factories, and so forth.
    
    This special value is captured as the constant
    AbstractBeanDefinition#INFER_METHOD, which in turn serves as the default
    value of the @Bean#destroyMethod attribute.
    
    For example in the following case
    
        @Bean
        public BasicDataSource dataSource() { ... }
    
    the container will automatically detect BasicDataSource#close and invoke
    it when the enclosing ApplicationContext is closed. This is exactly
    equivalent to
    
        @Bean(destroyMethod="(inferred)")
        public BasicDataSource dataSource() { ... }
    
    A user may override this inference-by-default convention simply by
    specifying a different method
    
        @Bean(destroyMethod="myClose")
        public MyBasicDataSource dataSource() { ... }
    
    or, in the case of a bean that has an otherwise inferrable 'close'
    method, but the user wishes to disable handling it entirely, an empty
    string may be specified
    
        @Bean(destroyMethod="")
        public MyBasicDataSource dataSource() { ... }
    
    The special destroy method name "(inferred)" may also be specified in
    an XML context, e.g.
    
        <bean destroy-method="(inferred)">
            or
        <beans default-destroy-method="(inferred)">
    
    Note that "(inferred)" is the default value for @Bean#destroyMethod,
    but NOT for the destroy-method and default-destroy-method attributes
    in the spring-beans XML schema.
    
    The principal reason for introducing this feature is to avoid forcing
    @Configuration class users to type destroyMethod="close" every time a
    closeable bean is configured. This kind of boilerplate is easily
    forgotten, and this simple convention means the right thing is done
    by default, while allowing the user full control over customization or
    disablement in special cases.
    
    Issue: SPR-8751
    cbeams committed Oct 12, 2011
Commits on Oct 11, 2011
  1. extended LocalSessionFactoryBean options for Hibernate 4; factored ou…

    …t LocalSessionFactoryBuilder
    jhoeller committed Oct 11, 2011
  2. Update changelog re @EnableAspectJAutoProxy

    Issue: SPR-8138
    cbeams committed Oct 11, 2011
  3. Introduce @EnableAspectJAutoProxy

    Issue: SPR-8138
    cbeams committed Oct 11, 2011
  4. renamed mapKey/ValueTypeDescriptor methods back to getMapKey/ValueTyp…

    …eDescriptor (for Spring 3.0.x compatibility)
    jhoeller committed Oct 11, 2011
  5. [SPR-8240] Added new "Mixing XML resources and @Configuration classes…

    …" section to the testing chapter.
    sbrannen committed Oct 11, 2011
  6. SPR-8725 Change modifier in WebMvcConfigurationSupport methods from p…

    …ackage private to public.
    
    Use of package private @Bean methods can cause issues if the class
    is extended and the sub-class is in a different package. This is 
    covered in detail in SPR-8756.
    rstoyanchev committed Oct 11, 2011
  7. Add repro test case for package-private @Bean issue

    Reproduces the issue described in SPR-8756 in addition to demonstrating
    the suggested workaround.
    
    Issue: SPR-8756, SPR-8725
    cbeams committed Oct 11, 2011
  8. avoid hard JPA 2.0 dependency

    jhoeller committed Oct 11, 2011
  9. removed Hibernate EntityManager 4.0 dependency since it is not needed…

    … for compilation and not for standard runs of the test suite either
    jhoeller committed Oct 11, 2011
  10. polishing

    jhoeller committed Oct 11, 2011
  11. use internal Set for TransactionSynchronization objects in order to a…

    …llow for equals/hashCode based replacement
    jhoeller committed Oct 11, 2011
  12. polishing

    jhoeller committed Oct 11, 2011