1. 10 2月, 2015 8 次提交
    • S
      Merge pull request #723 from svolsky/SPR-12653 · 13ccc8ed
      Stephane Nicoll 提交于
      * SPR-12653:
        Synchronize clear on TransactionAwareCacheDecorator
      13ccc8ed
    • S
      Synchronize clear on TransactionAwareCacheDecorator · ef95fc2f
      Stas Volsky 提交于
      Previously, a cache decorated with TransactionAwareCacheDecorator would
      clear the cache immediately, even when a transaction is running. This
      commit updates the decorator to synchronize to the afterCommit phase for
      the clear operation as well.
      
      Issue: SPR-12653
      ef95fc2f
    • S
      Clear expression caches on context shutdown · 6b3092c2
      Stephane Nicoll 提交于
      Issue: SPR-12691
      6b3092c2
    • S
      Fix usage of Java8 API · 37c04bd9
      Stephane Nicoll 提交于
      37c04bd9
    • S
      Support for transactional event listener · 4741a12f
      Stephane Nicoll 提交于
      Update the application event listener infrastructure to support events
      that are processed according to a transactional phase.
      
      Introduce EventListenerFactory that can be implemented to provide support
      for additional event listener types. TransactionalEventListener is a new
      annotation that can be used in lieu of the regular EventListener. Its
      related factory implementation is registered in the context automatically
      via @EnableTransactionManagement or <tx:annotation-driven/>
      
      By default, a TransactionalEventListener is invoked when the transaction
      has completed successfully (i.e. AFTER_COMMIT). Additional phases are
      provided to handle BEFORE_COMMIT and AFTER_ROLLBACK events.
      
      If no transaction is running, such listener is not invoked at all unless
      the `fallbackExecution` flag has been explicitly set.
      
      Issue: SPR-12080
      4741a12f
    • 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
    • S
      Support for generics-based events · 6d6422ac
      Stephane Nicoll 提交于
      Update the event publishing infrastructure to support generics-based
      events, that is support ApplicationListener implementations that define
      a generic event, something like:
      
      public class MyListener
              implements ApplicationListener<GenericEvent<String>> { ... }
      
      This listener should only receive events that are matching the generic
      signature, for instance:
      
      public class StringEvent extends GenericEvent<String> { ... }
      
      Note that because of type erasure, publishing an event that defines the
      generic type at the instance level will not work. In other words,
      publishing "new GenericEvent<String>" will not work as expected as type
      erasure will define it as GenericEvent<?>.
      
      To support this feature, use the new GenericApplicationListener that
      supersedes SmartApplicationListener to handle generics-based even types via
      `supportsEventType` that takes a ResolvableType instance instead of the
      simple Class of the event. ApplicationEventMulticaster has an additional
      method to multicast an event based on the event and its ResolvableType.
      
      Issue: SPR-8201
      6d6422ac
    • R
      Add fromHttpRequest to UriComponentsBuilder · f84c458a
      Rossen Stoyanchev 提交于
      Before this change, detection of X-Forwarded-* headers was only built
      into ServletUriComponentsBuilder.
      
      This change adds a new method for creating a UriComponentsBuilder from
      an existing HttpRequest. This is equivalent to the fromUri method +
      X-Forwarded-* header values.
      f84c458a
  2. 09 2月, 2015 3 次提交
    • S
      Fix SockJS origin check · 9b3319b3
      Sebastien Deleuze 提交于
      This commit introduces the following changes:
       - Requests without Origin header are not rejected anymore
       - Disable Iframe when allowedOrigins is not empty and not equals to *
       - The Iframe is not cached anymore in order to have a reliable origin check
       - allowedOrigins must not be null or empty
       - allowedOrigins format is now validated (should be * or start by http(s)://)
      
      Issue: SPR-12660
      9b3319b3
    • S
      Clarify the use of @Cacheable in PostConstruct code · 29a6d24d
      Stephane Nicoll 提交于
      Update documentation to explicitly mention that the cache interceptor
      must be fully initialized to provide the expected behavior and therefore
      initialization code should not rely on this feature, i;e. typically in
      PostConstruct callback.
      
      Since the Transactional infrastructure has the exact same infrastructure,
      update that section of the doc as well.
      
      Issue: SPR-12700
      29a6d24d
    • S
      Allow MBeans to be excluded additively · 982f9ce6
      Stephane Nicoll 提交于
      Previously, one could only set the list of bean names to exclude from
      auto-detection and there was no way to add additional bean names.
      
      MBeanExporter now exposes a addExcludedBean method that can be invoked
      during the initialization phase to add bean names to ignore.
      
      Issue: SPR-12686
      982f9ce6
  3. 06 2月, 2015 1 次提交
  4. 04 2月, 2015 1 次提交
    • B
      Sort handler matches in ResourceUrlProvider · 13cdd22f
      Brian Clozel 提交于
      Prior to this change, the `ResourceUrlProvider.getForLookupPath` method
      would try to match handlers using the keySet order in the
      handlerMappings Map. In case of several matches, the handler used for
      the return value could vary, since the registration order in the
      handlerMappings can't be guaranteed in the configuration.
      
      This commit now collects all matching handlers and sort them using a
      `PatternComparator`, in order to try each handler from the most specific
      mapping to the least.
      
      Issue: SPR-12647
      13cdd22f
  5. 03 2月, 2015 5 次提交
  6. 02 2月, 2015 1 次提交
    • S
      Allow subclasses to configure the Yaml instance · d8cec853
      Stephane Nicoll 提交于
      Provide an additional hook-point for YamlProcessor subclasses willing to
      change how the Yaml instance is configured. Also expose the default
      StrictMapAppenderConstructor so that  they can compose a custom instance
      with it.
      
      Issue: SPR-12671
      d8cec853
  7. 30 1月, 2015 1 次提交
    • R
      Add support for Server-Sent Events · a32b5e61
      Rossen Stoyanchev 提交于
      This commit adds ResponseBodyEmitter and SseEmitter (and also
      ResponseEntity<ResponseBodyEmitter> and ResponseEntity<SseEmitter>) as
      new return value types supported on @RequestMapping controller methods.
      
      See Javadoc on respective types for more details.
      
      Issue: SPR-12212
      a32b5e61
  8. 26 1月, 2015 4 次提交
    • S
      Use UTC timezone in Jackson builder and factory tests · ccb1c139
      Sebastien Deleuze 提交于
      Issue: SPR-12634
      ccb1c139
    • S
      Move cached expression evaluation abstraction · c7b324b8
      Stephane Nicoll 提交于
      Move MethodCacheKey and related classes to the expression package so that
      other parts of the framework can benefit ot it.
      
      CacheExpressionEvaluator is a base class that can be used to cache SpEL
      expressions based on its annotation source (i.e. method). Sub-classing
      that base class provides a simple to use API to retrieve Expression
      instances efficiently.
      
      Issue: SPR-12622
      c7b324b8
    • B
      Avoid loss of body content in AbstractRequestLoggingFilter · cf86ecdd
      Brian Clozel 提交于
      Prior to this commit, the `ContentCachingRequestWrapper` class would
      cache the response content only if the reponse would be consumed using
      its InputStream. In case of a Form request, Spring MVC consumes the
      response using the `getParameter*` Servlet API methods. This causes the
      cached content to never be written.
      
      This commit makes the `ContentCachingResponseWrapper` write the request
      body to the cache buffer by using the `getParameter*` API, thus avoiding
      those issues.
      
      Issue: SPR-7913
      cf86ecdd
    • S
      Allow Jackson builder modules configuration to be customized · 5fb6d6d8
      Sebastien Deleuze 提交于
      Modules (well-known or user provided) registration is now performed
      first in order to allow their configuration to be customized by more
      specific ones like custom serializers or deserializers.
      
      Issue: SPR-12634
      5fb6d6d8
  9. 25 1月, 2015 1 次提交
  10. 24 1月, 2015 3 次提交
    • S
      Support @Configuration as meta-annotation in the TCF · 2d918380
      Sam Brannen 提交于
      Spring Framework 4.0 introduced support for using test-related
      annotations as meta-annotations in the Spring TestContext Framework
      (TCF) in order to create custom composed annotations within a test
      suite; however, the detection of default @Configuration classes in test
      classes was not updated to search for @Configuration declared as a
      meta-annotation. Specifically, AnnotationConfigContextLoaderUtils
      invokes Class.isAnnotated() which only searches for annotations
      declared directly on the class in question.
      
      This commit addresses this issue by refactoring the
      isDefaultConfigurationClassCandidate() method in
      AnnotationConfigContextLoaderUtils so that it uses
      AnnotationUtils.findAnnotation() instead of Class.isAnnotated() for
      detecting the presence of the @Configuration annotation, either
      directly or as a meta-annotation.
      
      Issue: SPR-12659
      2d918380
    • S
      Refer to static nested classes, not static inner classes · c5c32ec2
      Sam Brannen 提交于
      Various parts of the reference manual as well as the Javadoc for
      AnnotationConfigContextLoaderUtils improperly refer to "static inner
      classes" even though this terminology does not exist in Java. The Java
      Language Specification explicitly refers to such classes as "static
      nested classes." An "inner class" must be non-static by definition.
      c5c32ec2
    • S
      Update copyright headers in IdGenerators · e97712b9
      Sam Brannen 提交于
      e97712b9
  11. 23 1月, 2015 7 次提交
  12. 22 1月, 2015 2 次提交
  13. 21 1月, 2015 3 次提交