1. 06 3月, 2019 1 次提交
  2. 13 12月, 2018 1 次提交
  3. 08 8月, 2018 1 次提交
  4. 14 4月, 2018 1 次提交
  5. 03 4月, 2018 1 次提交
  6. 07 3月, 2018 2 次提交
  7. 21 11月, 2017 1 次提交
  8. 14 11月, 2017 1 次提交
    • S
      Avoid implicit autowiring with Kotlin secondary ctors · edf82325
      sdeleuze 提交于
      Autowiring implicitely Kotlin primary constructors
      when there are secondary constructors has side effects
      on ConstructorResolver. It seems reasonable to
      require explicit @Autowired annotation in such case.
      
      With this commit, implicit autowiring of Kotlin
      primary constructors is only performed when there
      is a primary constructor defined alone or with
      a default constructor (define explicitly or
      generated via the kotlin-noarg compiler plugin
      or via optional constructor parameters with default
      values).
      
      Issue: SPR-16022
      edf82325
  9. 06 11月, 2017 1 次提交
  10. 20 7月, 2017 1 次提交
  11. 17 4月, 2017 1 次提交
  12. 03 11月, 2016 1 次提交
  13. 01 9月, 2016 1 次提交
    • S
      Support for candidate components index · dcade06f
      Stephane Nicoll 提交于
      This commit adds a "spring-context-indexer" module that can be added to
      any project in order to generate an index of candidate components defined
      in the project.
      
      `CandidateComponentsIndexer` is a standard annotation processor that
      looks for source files with target annotations (typically `@Component`)
      and references them in a `META-INF/spring.components` generated file.
      
      Each entry in the index is the fully qualified name of a candidate
      component and the comma-separated list of stereotypes that apply to that
      candidate. A typical example of a stereotype is `@Component`. If a
      project has a `com.example.FooService` annotated with `@Component` the
      following `META-INF/spring.components` file is generated at compile time:
      
      ```
      com.example.FooService=org.springframework.stereotype.Component
      ```
      
      A new `@Indexed` annotation can be added on any annotation to instructs
      the scanner to include a source file that contains that annotation. For
      instance, `@Component` is meta-annotated with `@Indexed` now and adding
      `@Indexed` to more annotation types will transparently improve the index
      with additional information. This also works for interaces or parent
      classes: adding `@Indexed` on a `Repository` base interface means that
      the indexed can be queried for its implementation by using the fully
      qualified name of the `Repository` interface.
      
      The indexer also adds any class or interface that has a type-level
      annotation from the `javax` package. This includes obviously JPA
      (`@Entity` and related) but also CDI (`@Named`, `@ManagedBean`) and
      servlet annotations (i.e. `@WebFilter`). These are meant to handle
      cases where a component needs to identify candidates and use classpath
      scanning currently.
      
      If a `package-info.java` file exists, the package is registered using
      a "package-info" stereotype.
      
      Such files can later be reused by the `ApplicationContext` to avoid
      using component scan. A global `CandidateComponentsIndex` can be easily
      loaded from the current classpath using `CandidateComponentsIndexLoader`.
      
      The core framework uses such infrastructure in two areas: to retrieve
      the candidate `@Component`s and to build a default `PersistenceUnitInfo`.
      Rather than scanning the classpath and using ASM to identify candidates,
      the index is used if present.
      
      As long as the include filters refer to an annotation that is directly
      annotated with `@Indexed` or an assignable type that is directly
      annotated with `@Indexed`, the index can be used since a dedicated entry
      wil be present for that type. If any other unsupported include filter is
      specified, we fallback on classpath scanning.
      
      In case the index is incomplete or cannot be used, The
      `spring.index.ignore` system property can be set to `true` or,
      alternatively, in a "spring.properties" at the root of the classpath.
      
      Issue: SPR-11890
      dcade06f
  14. 17 8月, 2016 3 次提交
  15. 06 7月, 2016 3 次提交
  16. 05 7月, 2016 1 次提交
  17. 15 4月, 2016 1 次提交
  18. 19 3月, 2016 1 次提交
  19. 29 2月, 2016 1 次提交
  20. 20 2月, 2016 1 次提交
  21. 18 1月, 2016 1 次提交
  22. 21 12月, 2015 1 次提交
    • S
      Support for multi-threaded cache access · 19d97c42
      Stephane Nicoll 提交于
      Previously, if a `@Cacheable` method was accessed with the same key by
      multiple threads, the underlying method was invoked several times instead
      of blocking the threads while the value is computed. This scenario
      typically affects users that enable caching to avoid calling a costly
      method too often. When said method can be invoked by an arbitrary number
      of clients on startup, caching has close to no effect.
      
      This commit adds a new method on `Cache` that implements the read-through
      pattern:
      
      ```
      <T> T get(Object key, Callable<T> valueLoader);
      ```
      
      If an entry for a given key is not found, the specified `Callable` is
      invoked to "load" the value and cache it before returning it to the
      caller. Because the entire operation is managed by the underlying cache
      provider, it is much more easier to guarantee that the loader (e.g. the
      annotated method) will be called only once in case of concurrent access.
      
      A new `sync` attribute to the `@Cacheable` annotation has been addded.
      When this flag is enabled, the caching abstraction invokes the new
      `Cache` method define above. This new mode bring a set of limitations:
      
      * It can't be combined with other cache operations
      * Only one `@Cacheable` operation can be specified
      * Only one cache is allowed
      * `condition` and `unless` attribute are not supported
      
      The rationale behind those limitations is that the underlying Cache is
      taking care of the actual caching operation so we can't really apply
      any SpEL or multiple caches handling there.
      
      Issue: SPR-9254
      19d97c42
  23. 09 11月, 2015 1 次提交
    • S
      Allow null values to be cached with `@CacheResult` · 2a2a8d3f
      Stephane Nicoll 提交于
      Even though the JSR-107 spec forbids to store null values, our cache
      abstraction allows that behaviour with a special handled (and this is
      the default behaviour).
      
      While this was working fine with our own set of annotations, the
      JSR-107 interceptor counterpart was interpreting the spec sensu strictu.
      
      We now allow for that special case as well.
      
      Issue: SPR-13641
      2a2a8d3f
  24. 24 9月, 2015 2 次提交
  25. 22 9月, 2015 1 次提交
  26. 19 6月, 2015 1 次提交
  27. 05 6月, 2015 1 次提交
    • S
      Remove commons pool 2.x workaround · e8441edc
      Stephane Nicoll 提交于
      While working on SPR-12532, an extra IdentityWrapper was added to work
      around a backward compatible issue between commons pool 1.x and 2.x. This
      issue (POOL-283) has actually been fixed in 2.4 and their IdentityWrapper
      is using object equality so our wrapper is in the way.
      
      Looking retrospectively, the code looks all fine without the workaround
      and commons pool 2.4 or later so it has been removed.
      e8441edc
  28. 20 5月, 2015 1 次提交
    • S
      Customize destruction callback for AutoCloseable beans · 0ed9ca09
      Stephane Nicoll 提交于
      Previously, a Bean implementing `AutoCloseable` (or `Closeable`) was
      always destroyed regardless of its bean definition. In particular, the
      documented way of disabling the destruction callback via an empty String
      did not work.
      
      AutoCloseable beans are now treated pretty much as any other bean: we
      still use the presence of the interface to optimize the check of a
      destroy method and we only auto-discover the method name to invoke if
      the inferred mode is enabled.
      
      Issue: SPR-13022
      0ed9ca09
  29. 09 5月, 2015 1 次提交
  30. 01 3月, 2015 1 次提交
    • S
      Fully support XML config in GroovyBeanDefinitionReader · 7edc7c2c
      Sam Brannen 提交于
      Prior to this commit, the GroovyBeanDefinitionReader claimed (via its
      Javadoc) that it fully supported XML configuration files in addition to
      its Groovy DSL; however, this was unfortunately inaccurate since XML
      validation was disabled by default which led to certain features of XML
      configuration not working. For example, it was impossible to define a
      <qualifier> in an XML config file without specifying the 'type'
      attribute (which has a default value defined in the spring-beans XSD).
      
      This commit fixes this issue by ensuring that bean definitions in XML
      resources are loaded with a "standard" XmlBeanDefinitionReader that is
      created with default settings (i.e., with XML validation enabled). With
      regard to backwards compatibility, bean definitions defined using the
      Groovy DSL are still loaded with an XmlBeanDefinitionReader that has
      XML validation disabled by default which is necessary for proper
      parsing of the Groovy DSL.
      
      Issue: SPR-12769
      7edc7c2c
  31. 28 2月, 2015 1 次提交
  32. 12 2月, 2015 1 次提交
  33. 10 2月, 2015 1 次提交
    • S
      Annotation-based event listeners · f0fca890
      Stephane Nicoll 提交于
      Add support for annotation-based event listeners. Enabled automatically
      when using Java configuration or can be enabled explicitly via the
      regular <context:annotation-driven/> XML element. Detect methods of
      managed beans annotated with @EventListener, either directly or through
      a meta-annotation.
      
      Annotated methods must define the event type they listen to as a single
      parameter argument. Events are automatically filtered out according to
      the method signature. When additional runtime filtering is required, one
      can specify the `condition` attribute of the annotation that defines a
      SpEL expression that should match to actually invoke the method for a
      particular event. The root context exposes the actual `event`
      (`#root.event`) and method arguments (`#root.args`). Individual method
      arguments are also exposed via either the `a` or `p` alias (`#a0` refers
      to the first method argument). Finally, methods arguments are exposed via
      their names if that information can be discovered.
      
      Events can be either an ApplicationEvent or any arbitrary payload. Such
      payload is wrapped automatically in a PayloadApplicationEvent and managed
      explicitly internally. As a result, users can now publish and listen
      for arbitrary objects.
      
      If an annotated method has a return value, an non null result is actually
      published as a new event, something like:
      
      @EventListener
      public FooEvent handle(BarEvent event) { ... }
      
      Events can be handled in an aynchronous manner by adding `@Async` to the
      event method declaration and enabling such infrastructure. Events can
      also be ordered by adding an `@order` annotation to the event method.
      
      Issue: SPR-11622
      f0fca890
  34. 21 10月, 2014 1 次提交