1. 22 5月, 2012 1 次提交
    • C
      Polish scheduled task execution infrastructure · 4d5fe57a
      Chris Beams 提交于
      In anticipation of substantive changes required to implement "initial
      delay" support in the <task:scheduled> element and @Scheduled
      annotation, the following updates have been made to the components and
      infrastructure supporting scheduled task execution:
      
       - Fix code style violations
       - Fix compiler warnings
       - Add Javadoc where missing, update to use {@code} tags, etc.
       - Organize imports to follow conventions
      4d5fe57a
  2. 20 5月, 2012 2 次提交
    • C
      Support executor qualification with @Async#value · ed0576c1
      Chris Beams 提交于
      Prior to this change, Spring's @Async annotation support was tied to a
      single AsyncTaskExecutor bean, meaning that all methods marked with
      @Async were forced to use the same executor. This is an undesirable
      limitation, given that certain methods may have different priorities,
      etc. This leads to the need to (optionally) qualify which executor
      should handle each method.
      
      This is similar to the way that Spring's @Transactional annotation was
      originally tied to a single PlatformTransactionManager, but in Spring
      3.0 was enhanced to allow for a qualifier via the #value attribute, e.g.
      
        @Transactional("ptm1")
        public void m() { ... }
      
      where "ptm1" is either the name of a PlatformTransactionManager bean or
      a qualifier value associated with a PlatformTransactionManager bean,
      e.g. via the <qualifier> element in XML or the @Qualifier annotation.
      
      This commit introduces the same approach to @Async and its relationship
      to underlying executor beans. As always, the following syntax remains
      supported
      
        @Async
        public void m() { ... }
      
      indicating that calls to #m will be delegated to the "default" executor,
      i.e. the executor provided to
      
        <task:annotation-driven executor="..."/>
      
      or the executor specified when authoring a @Configuration class that
      implements AsyncConfigurer and its #getAsyncExecutor method.
      
      However, it now also possible to qualify which executor should be used
      on a method-by-method basis, e.g.
      
        @Async("e1")
        public void m() { ... }
      
      indicating that calls to #m will be delegated to the executor bean
      named or otherwise qualified as "e1". Unlike the default executor
      which is specified up front at configuration time as described above,
      the "e1" executor bean is looked up within the container on the first
      execution of #m and then cached in association with that method for the
      lifetime of the container.
      
      Class-level use of Async#value behaves as expected, indicating that all
      methods within the annotated class should be executed with the named
      executor. In the case of both method- and class-level annotations, any
      method-level #value overrides any class level #value.
      
      This commit introduces the following major changes:
      
       - Add @Async#value attribute for executor qualification
      
       - Introduce AsyncExecutionAspectSupport as a common base class for
         both MethodInterceptor- and AspectJ-based async aspects. This base
         class provides common structure for specifying the default executor
         (#setExecutor) as well as logic for determining (and caching) which
         executor should execute a given method (#determineAsyncExecutor) and
         an abstract method to allow subclasses to provide specific strategies
         for executor qualification (#getExecutorQualifier).
      
       - Introduce AnnotationAsyncExecutionInterceptor as a specialization of
         the existing AsyncExecutionInterceptor to allow for introspection of
         the @Async annotation and its #value attribute for a given method.
         Note that this new subclass was necessary for packaging reasons -
         the original AsyncExecutionInterceptor lives in
         org.springframework.aop and therefore does not have visibility to
         the @Async annotation in org.springframework.scheduling.annotation.
         This new subclass replaces usage of AsyncExecutionInterceptor
         throughout the framework, though the latter remains usable and
         undeprecated for compatibility with any existing third-party
         extensions.
      
       - Add documentation to spring-task-3.2.xsd and reference manual
         explaining @Async executor qualification
      
       - Add tests covering all new functionality
      
      Note that the public API of all affected components remains backward-
      compatible.
      
      Issue: SPR-6847
      ed0576c1
    • C
      Polish async method execution infrastructure · 3fb11870
      Chris Beams 提交于
      In anticipation of substantive changes required to implement @Async
      executor qualification, the following updates have been made to the
      components and infrastructure supporting @Async functionality:
      
       - Fix trailing whitespace and indentation errors
       - Fix generics warnings
       - Add Javadoc where missing, update to use {@code} tags, etc.
       - Avoid NPE in AopUtils#canApply
       - Organize imports to follow conventions
       - Remove System.out.println statements from tests
       - Correct various punctuation and grammar problems
      3fb11870
  3. 16 5月, 2012 1 次提交
  4. 30 4月, 2012 1 次提交
    • S
      Fix javadoc warnings · effb7625
      Stevo Slavic 提交于
      Before this change there were numerous javadoc warnings being reported
      while building Spring framework API.
      
      This commit resolves most of the javadoc warnings, reducing the total
      number from 265 to 103.
      
      Issue: SPR-9113
      effb7625
  5. 31 1月, 2012 1 次提交
    • C
      Rename modules {org.springframework.*=>spring-*} · 02a4473c
      Chris Beams 提交于
      This renaming more intuitively expresses the relationship between
      subprojects and the JAR artifacts they produce.
      
      Tracking history across these renames is possible, but it requires
      use of the --follow flag to `git log`, for example
      
          $ git log spring-aop/src/main/java/org/springframework/aop/Advisor.java
      
      will show history up until the renaming event, where
      
          $ git log --follow spring-aop/src/main/java/org/springframework/aop/Advisor.java
      
      will show history for all changes to the file, before and after the
      renaming.
      
      See http://chrisbeams.com/git-diff-across-renamed-directories
      02a4473c