1. 22 Jan, 2016 1 commit
  2. 21 Jan, 2016 34 commits
  3. 20 Jan, 2016 5 commits
    • Andy Wilkinson's avatar
      Handle multiple ContextRefreshedEvents in BackgroundPreinitializer · 6f8d4c77
      Andy Wilkinson authored
      The same initializer will receive multiple ContextRefreshedEvents
      when their is an application context hierarchy. This commit updates
      the initializer to correctly handle multiple ContextRefreshedEvents
      and only act upon the first that it receives.
      
      See gh-4871
      6f8d4c77
    • Andy Wilkinson's avatar
      Ensure that background preinit has completed before refresh returns · 992e90f4
      Andy Wilkinson authored
      This commit is a continuation of the changes made in b85b6082. It
      addresses an additional problem when testing applications where two
      contexts are refreshed in quick succession. In this scenario, it
      was possible, theoretically at least, for the first context’s background preinitialization to still be in progress and creating loggers when the
      second is refreshed and resets the logger context.
      
      This commit updates BackgroundPreinitializer so that, upon receipt of
      a ContextRefreshedEvent, it waits for preinitialization to have
      completed. In the scenario described above, this ensures that
      preinitialization has completed before the call to refresh() for the
      first context returns, thereby preventing it from running in parallel
      with the refresh of the second context.
      
      Closes gh-4871
      992e90f4
    • Stephane Nicoll's avatar
      Make HazelcastJpaDependencyAutoConfiguration public · 179467bd
      Stephane Nicoll authored
      If Both Hazelcast and Hibernate are available, Spring Boot takes the
      opinion that Hazelcast can be used for 2nd level caching and therefore
      need to start before Hibernate.
      
      Unfortunately, some users require Hibernate in some of their hazelcast
      use case so the link is actually reversed. One way for such user is to
      disable the auto-configuration that deals with this link. This class is
      now public so that users can locate them and exclude them if necessary.
      
      Closes gh-4960
      179467bd
    • Andy Wilkinson's avatar
      5e5542f0
    • Andy Wilkinson's avatar
      Perform background preinitialization after logging system setup · b85b6082
      Andy Wilkinson authored
      Previously, BackgroundPreinitializer would kick off preinitialization
      on a separate thread in response to an ApplicationStartedEvent. This
      work would then race with the logging system being set up in response
      to an ApplicationEnvironmentPreparedEvent. When Logback’s being used
      this race is problematic. As part of Logback’s setup,
      LoggerContext.stop() is called. This calls LoggerContext.reset() which
      can fail with a ConcurrentModificationException if another thread tries
      to create a Logger at the same time. This is a known bug in Logback [1].
      
      This commit updates BackgroundPreinitializer to respond to
      an ApplicationEnvironmentPreparedEvent and to order itself so that it’s
      called after LoggingApplicationListener has responded to the same event
      by initializing the logging system.
      
      Closes gh-4871
      
      [1] http://jira.qos.ch/browse/LOGBACK-397
      b85b6082