1. 22 5月, 2012 1 次提交
    • C
      Support initial delay attribute for scheduled tasks · 53673d6c
      Chris Beams 提交于
      java.util.concurrent's ScheduledExecutorService and its #schedule*
      methods allow for an 'initialDelay' parameter in milliseconds.
      Similarly, Spring's TaskExecutor abstraction allows for a concrete
      'startTime' expressed as a Date. However, Spring's <task:scheduled> XML
      element and @Scheduled annotation have, to date, not allowed for an
      initial delay parameter that can be propagated down to the underlying
      TaskScheduler/ScheduledExecutorService.
      
      This commit introduces initial-delay and #initialDelay attributes to
      task:scheduled and @Scheduled respectively, both indicating the number
      of milliseconds to wait before the first invocation of the method in
      question. Specifying a delay in this fashion is only valid in
      conjunction with fixed-rate and fixed-delay tasks (i.e. not with cron
      or trigger tasks).
      
      The principal changes required to support these new attributes lie in
      ScheduledTaskRegistrar, which previously supported registration of
      tasks in the form of a Runnable and a Long parameter indicating (in the
      case of fixed-rate and fixed-delay tasks), the interval with which the
      task should be executed. In order to accommodate a third (and optional)
      'initialDelay' parameter, the IntervalTask class has been added as a
      holder for the Runnable to be executed, the interval in which to run
      it, and the optional initial delay. For symmetry, a TriggerTask and
      CronTask have also been added, the latter subclassing the former. And a
      'Task' class has been added as a common ancestor for all the above.
      
      One oddity of the implementation is in the naming of the new
      setters in ScheduledTaskRegistrar. Prior to this commit, the setters
      were named #setFixedDelayTasks, #setFixedRateTasks, etc, each accepting
      a Map<Runnable, long>. In adding new setters for each task type, each
      accepting a List<IntervalTask>, List<CronTask> etc, naturally the
      approach would be to use method overloading and to introduce methods
      of the same name but with differing parameter types. Unfortunately
      however, Spring does not support injection against overloaded methods
      (due to fundamental limitations of the underlying JDK Introspector).
      This is not a problem when working with the ScheduledTaskRegistrar
      directly, e.g. from within a @Configuration class that implements
      SchedulingConfigurer, but is a problem from the point of view of the
      ScheduledTasksBeanDefinitionParser which parses the <task:scheduled>
      element - here the ScheduledTaskRegistrar is treated as a Spring bean
      and is thus subject to these limitations. The solution to this problem
      was simply to avoid overloading altogether, thus the naming of the new
      methods ending in "List", e.g. #setFixedDelayTasksList, etc. These
      methods exist primarily for use by the BeanDefinitionParser and are
      not really intended for use by application developers. The Javadoc for
      each of the new methods makes note of this.
      
      Issue: SPR-7022
      53673d6c
  2. 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
  3. 21 12月, 2011 2 次提交
    • C
      Convert CRLF (dos) to LF (unix) · 88913f2b
      Chris Beams 提交于
      Prior to this change, roughly 5% (~300 out of 6000+) of files under the
      source tree had CRLF line endings as opposed to the majority which have
      LF endings.
      
      This change normalizes these files to LF for consistency going forward.
      
      Command used:
      
      $ git ls-files | xargs file | grep CRLF | cut -d":" -f1 | xargs dos2unix
      
      Issue: SPR-5608
      88913f2b
    • C
      Convert CRLF (dos) to LF (unix) · ae72cf2f
      Chris Beams 提交于
      Prior to this change, roughly 5% (~300 out of 6000+) of files under the
      source tree had CRLF line endings as opposed to the majority which have
      LF endings.
      
      This change normalizes these files to LF for consistency going forward.
      
      Command used:
      
      $ git ls-files | xargs file | grep CRLF | cut -d":" -f1 | xargs dos2unix
      
      Issue: SPR-5608
      ae72cf2f
  4. 27 5月, 2010 2 次提交
  5. 25 5月, 2010 1 次提交
  6. 12 1月, 2010 1 次提交
  7. 23 3月, 2009 1 次提交