1. 16 7月, 2011 4 次提交
  2. 15 7月, 2011 5 次提交
  3. 14 7月, 2011 3 次提交
    • C
      Allow ConfigurationCPP to process multiple registries · fd42a65c
      Chris Beams 提交于
      Prior to this change, an instance of ConfigurationClassPostProcessor
      would throw IllegalStateException if its
      postProcessBeanDefinitionRegistry method were called more than once.
      This check is important to ensure that @Configuration classes are
      not proxied by CGLIB multiple times, and works for most normal use
      cases.
      
      However, if the same CCPP instance is used to process multiple
      registries/factories/contexts, this check creates a false negative
      because it does not distinguish between invocations of
      postProcessBeanDefinitionRegistry across different registries.
      
      A use case for this, though admittedly uncommon, would be creating
      a CCPP instance and registering it via
      ConfigurableApplicationContext#addBeanDefinitionPostProcessor against
      several ApplicationContexts. In such a case, the same CCPP instance
      will post-process multiple different registry instances, and throw the
      above mentioned exception.
      
      With this change, CCPP now performs lightweight tracking of the
      registries/beanFactories that it has already processed by recording
      the identity hashcodes of these objects.  This is only slightly more
      complex than the previous boolean-based 'already processed' flags, and
      prevents this issue (however rare it may be) from occurring.
      
      Issue: SPR-8527
      fd42a65c
    • C
      Move ImportSelector.Context to a top-level class · c5463a2e
      Chris Beams 提交于
      Issue: SPR-8411, SPR-8494
      c5463a2e
    • J
      0c2a6395
  4. 13 7月, 2011 2 次提交
  5. 12 7月, 2011 1 次提交
    • C
      Remove references to 'bold' text in reference docs · a2a98efa
      Chris Beams 提交于
      <emphasis role="bold"> blocks do not render properly, probably due to
      conflicting CSS used for syntax highlighting. For the moment, any
      mentions of bold text (e.g. "see bold text in the snippet below") have
      been removed to avoid confusion as reported in SPR-8520.  SPR-8526 has
      been created to address the underlying issue of getting bold to work
      even with syntax highlighting.
      
      Issue: SPR-8520, SPR-8526
      a2a98efa
  6. 11 7月, 2011 3 次提交
    • J
      an EntityManagerFactoryBean is only deserializable through a... · 81a27ce4
      Juergen Hoeller 提交于
      an EntityManagerFactoryBean is only deserializable through a SerializedEntityManagerFactoryBeanReference
      81a27ce4
    • J
    • C
      Fix APC registration for @EnableTransactionManagement · 431e9350
      Chris Beams 提交于
      Prior to this change, @EnableTransactionManagement (via the
      ProxyTransactionManagementConfiguration class) did not properly
      register its auto-proxy creator through the usual AopConfigUtils
      methods.  It was trying to register the APC as a normal @Bean method,
      but this causes issues (SPR-8494) with the logic in
      AopConfigUtils#registerOrEscalateApcAsRequired, which expects the APC
      bean definition to have a beanClassName property.  When the APC is
      registered via a @Bean definition, it is actually a
      factoryBean/factoryMethod situation with no directly resolvable
      beanClass/beanClassName.
      
      To solve this problem, ImportSelector#selectImports has been refactored
      to accept an ImportSelector.Context instance. This object contains the
      AnnotationMetadata of the importing class as well as the enclosing
      BeanDefinitionRegistry to allow for the kind of conditional bean
      registration necessary here. In this case, the bean definition that
      must be registered conditionally is that of the auto-proxy creator.
      It should only be registered if AdviceMode == PROXY, and thus the
      ImportSelector is an appropriate place to make this happen.  It must
      happen as a BeanDefinition (rather than a @Bean method) for
      compatibility with AopConfigUtils, and working with the
      BeanDefinitionRegistry API allows for that. This change does mean that
      in certain cases like this one, #selectImports has container modifying
      side effects. Documentation has been updated to reflect.
      
      Issue: SPR-8411, SPR-8494
      431e9350
  7. 08 7月, 2011 3 次提交
    • C
      Revert "Fix APC registration for @EnableTransactionManagement" · d8d9e3fc
      Chris Beams 提交于
      @PostConstruct added to ProxyTransactionManagementConfiguration cases
      ConcurrentModificationException (as detailed previously in SPR-8397.
      Backing out for now until a better solution can be devised.
      
      This reverts commit 235b729514d125aef79fc3fae4bcfb1893642212.
      d8d9e3fc
    • C
      Fix APC registration for @EnableTransactionManagement · f1ef3e4d
      Chris Beams 提交于
      Prior to this change, @EnableTransactionManagement (via the
      ProxyTransactionManagementConfiguration class) did not properly
      register its auto-proxy creator through the usual AopConfigUtils
      methods.  It was trying to register the APC as a normal @Bean method,
      but this causes issues (SPR-8494) with the logic in
      AopConfigUtils#registerOrEscalateApcAsRequired, which expects the APC
      bean definition to have a beanClassName property.  When the APC is
      registered via a @Bean definition, it is actually a
      factoryBean/factoryMethod situation with no directly resolvable
      beanClass/beanClassName.
      
      Rather than trying to rework how AopConfigUtils works, a @PostConstruct
      method has been added to ProxyTransactionManagementConfiguration to call
      the usual AopConfigUtils registration methods.
      
      Issue: SPR-8411, SPR-8494
      f1ef3e4d
    • C
      Implement SessionFactoryImplementor in SF proxies · 5aa24af1
      Chris Beams 提交于
      SessionFactoryBuilderSupport implementations create DisposableBean
      proxies for SessionFactory objects created using #buildSessionFactory.
      
      Prior to this change, these proxies create problems when working agaist
      SessionFactoryUtils.getDataSource(SessionFactory), because this method
      expects the given SessionFactory to implement Hibernate's
      SessionFactoryImplementor interface (which the stock SessionFactoryImpl
      does).
      
      With this change, the DisposableBean proxies created by SFBuilders
      now also implement SessionFactoryImplementor to satisfy this and
      probably other such cases.
      
      Issue: SPR-8469
      5aa24af1
  8. 07 7月, 2011 1 次提交
  9. 06 7月, 2011 9 次提交
    • C
      Determine FactoryBean object type via generics · 807d6129
      Chris Beams 提交于
      For the particular use case detailed in SPR-8514, with this change we
      now attempt to determine the object type of a FactoryBean through its
      generic type parameter if possible.
      
      For (a contrived) example:
      
      @Configuration
      public MyConfig {
          @Bean
          public FactoryBean<String> fb() {
              return new StringFactoryBean("foo");
          }
      }
      
      The implementation will now look at the <String> generic parameter
      instead of attempting to instantiate the FactoryBean in order to call
      its #getObjectType() method.
      
      This is important in order to avoid the autowiring lifecycle issues
      detailed in SPR-8514.  For example, prior to this change, the following
      code would fail:
      
      @Configuration
      public MyConfig {
          @Autowired Foo foo;
      
          @Bean
          public FactoryBean<String> fb() {
              Assert.notNull(foo);
              return new StringFactoryBean("foo");
          }
      }
      
      The reason for this failure is that in order to perform autowiring,
      the container must first determine the object type of all configured
      FactoryBeans.  Clearly a chicken-and-egg issue, now fixed by this
      change.
      
      And lest this be thought of as an obscure bug, keep in mind the use case
      of our own JPA support: in order to configure and return a
      LocalContainerEntityManagerFactoryBean from a @Bean method, one will
      need access to a DataSource, etc -- resources that are likely to
      be @Autowired across @Configuration classes for modularity purposes.
      
      Note that while the examples above feature methods with return
      types dealing directly with the FactoryBean interface, of course
      the implementation deals with subclasses/subinterfaces of FactoryBean
      equally as well.  See ConfigurationWithFactoryBeanAndAutowiringTests
      for complete examples.
      
      There is at least a slight risk here, in that the signature of a
      FactoryBean-returing @Bean method may advertise a generic type for the
      FactoryBean less specific than the actual object returned (or than
      advertised by #getObjectType for that matter). This could mean that an
      autowiring target may be missed, that we end up with a kind of
      autowiring 'false negative' where FactoryBeans are concerned. This is
      probably a less common scenario than the need to work with an autowired
      field within a FactoryBean-returning @Bean method, and also has a clear
      workaround of making the generic return type more specific.
      
      Issue: SPR-8514
      807d6129
    • C
      Introduce GenericTypeResolver#resolveReturnTypeArgument · 605f0e7a
      Chris Beams 提交于
      Issue: SPR-8514
      605f0e7a
    • C
      Deprecate/move CGLIB methods AopUtils=>ClassUtils · 7c25c84e
      Chris Beams 提交于
      isCglibProxy* methods in AopUtils are useful in lower-level modules,
      i.e. those that cannot depend on .aop.  Therefore copied these methods
      to ClassUtils; deprecated the existing ones in AopUtils and now
      delegating to the new location; switched all usage of
      AopUtils#isCglibProxy* within the framework to use
      ClassUtils#isCglibProxy* instead.
      7c25c84e
    • C
      Rename JMX tests to avoid jmxremote_optional error · 78b60947
      Chris Beams 提交于
      Even after applying @Ignore to these tests at the class level, they
      still run (and fail) under ant when the jmxremote_optional jar is not
      present. See the issues mentioned below for information on how these
      tests will be re-enabled.
      
      Issue: SPR-8089, SPR-8093, SPR-8458
      78b60947
    • M
      SPR-7858 · 4aeaaa08
      Michael Isvy 提交于
      removed references to JSR 330  since there is now a dedicated JSR 330 section inside beans-standard-annotations.xml
      4aeaaa08
    • M
      SPR-7858 · a590318b
      Michael Isvy 提交于
      removed reference to JSR 330's @Named since there is now a dedicated JSR 330 section inside beans-standard-annotations.xml
      a590318b
    • M
      SPR-7858 · 1bd75e5a
      Michael Isvy 提交于
      minor wording change
      1bd75e5a
    • M
      SPR-7858 · cf348f20
      Michael Isvy 提交于
      removed reference to @Provider
      cf348f20
    • J
      fixed TypeDescriptor rendering (SPR-8508) · c6802176
      Juergen Hoeller 提交于
      c6802176
  10. 05 7月, 2011 5 次提交
  11. 04 7月, 2011 4 次提交