Browse Source

deprecated scheduling support for JDK 1.3 Timer

pull/23217/head
Juergen Hoeller 15 years ago
parent
commit
cfa7216fac
  1. 1
      org.springframework.context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java
  2. 4
      org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java
  3. 6
      org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java
  4. 14
      org.springframework.context/src/main/java/org/springframework/scheduling/support/MethodInvokingRunnable.java
  5. 5
      org.springframework.context/src/main/java/org/springframework/scheduling/timer/DelegatingTimerTask.java
  6. 3
      org.springframework.context/src/main/java/org/springframework/scheduling/timer/MethodInvokingTimerTaskFactoryBean.java
  7. 5
      org.springframework.context/src/main/java/org/springframework/scheduling/timer/ScheduledTimerTask.java
  8. 3
      org.springframework.context/src/main/java/org/springframework/scheduling/timer/TimerFactoryBean.java
  9. 3
      org.springframework.context/src/main/java/org/springframework/scheduling/timer/TimerTaskExecutor.java
  10. 3
      org.springframework.core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java
  11. 17
      org.springframework.core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java

1
org.springframework.context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java

@ -68,7 +68,6 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM @@ -68,7 +68,6 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM
* transaction association) unless the TaskExecutor explicitly supports this.
* @see org.springframework.core.task.SyncTaskExecutor
* @see org.springframework.core.task.SimpleAsyncTaskExecutor
* @see org.springframework.scheduling.timer.TimerTaskExecutor
*/
public void setTaskExecutor(Executor taskExecutor) {
this.taskExecutor = taskExecutor;

4
org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java

@ -52,10 +52,6 @@ import org.springframework.util.ObjectUtils; @@ -52,10 +52,6 @@ import org.springframework.util.ObjectUtils;
* {@link #setContinueScheduledExecutionAfterException "continueScheduledExecutionAfterException"}
* property to "true".
*
* <p>This class is analogous to the
* {@link org.springframework.scheduling.timer.TimerFactoryBean}
* class for the JDK 1.3 {@link java.util.Timer} facility.
*
* @author Juergen Hoeller
* @since 2.0
* @see #setPoolSize

6
org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -31,14 +31,10 @@ import java.util.concurrent.TimeUnit; @@ -31,14 +31,10 @@ import java.util.concurrent.TimeUnit;
* uses a {@link Runnable} instance that is shared between repeated executions,
* in contrast to Quartz which creates a new Job instance for each execution.
*
* <p>This class is analogous to the {@link org.springframework.scheduling.timer.ScheduledTimerTask}
* class for the JDK 1.3 {@link java.util.Timer} facility.
*
* @author Juergen Hoeller
* @since 2.0
* @see java.util.concurrent.ScheduledExecutorService#scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)
* @see java.util.concurrent.ScheduledExecutorService#scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)
* @see org.springframework.scheduling.timer.ScheduledTimerTask
*/
public class ScheduledExecutorTask {

14
org.springframework.context/src/main/java/org/springframework/scheduling/support/MethodInvokingRunnable.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,18 +33,6 @@ import org.springframework.util.ClassUtils; @@ -33,18 +33,6 @@ import org.springframework.util.ClassUtils;
* <p>Inherits common configuration properties from
* {@link org.springframework.util.MethodInvoker}.
*
* <p>Useful to generically encapsulate a method invocation as timer task
* for <code>java.util.Timer</code>, in combination with a
* {@link org.springframework.scheduling.timer.DelegatingTimerTask} adapter.
* Can also be used with JDK 1.5's <code>java.util.concurrent.Executor</code>
* abstraction, which works with plain Runnables.
*
* <p>Extended by Spring's
* {@link org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean}
* adapter for <code>java.util.TimerTask</code>. Note that you can populate a
* ScheduledTimerTask object with a plain MethodInvokingRunnable instance
* as well, which will automatically get wrapped with a DelegatingTimerTask.
*
* @author Juergen Hoeller
* @since 1.2.4
* @see org.springframework.scheduling.timer.ScheduledTimerTask#setRunnable(Runnable)

5
org.springframework.context/src/main/java/org/springframework/scheduling/timer/DelegatingTimerTask.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -32,7 +32,10 @@ import org.springframework.util.Assert; @@ -32,7 +32,10 @@ import org.springframework.util.Assert;
*
* @author Juergen Hoeller
* @since 1.2.4
* @deprecated as of Spring 3.0, in favor of the <code>scheduling.concurrent</code>
* package which is based on Java 5's <code>java.util.concurrent.ExecutorService</code>
*/
@Deprecated
public class DelegatingTimerTask extends TimerTask {
private static final Log logger = LogFactory.getLog(DelegatingTimerTask.class);

3
org.springframework.context/src/main/java/org/springframework/scheduling/timer/MethodInvokingTimerTaskFactoryBean.java

@ -37,7 +37,10 @@ import org.springframework.scheduling.support.MethodInvokingRunnable; @@ -37,7 +37,10 @@ import org.springframework.scheduling.support.MethodInvokingRunnable;
* @see ScheduledTimerTask#setRunnable
* @see org.springframework.scheduling.support.MethodInvokingRunnable
* @see org.springframework.beans.factory.config.MethodInvokingFactoryBean
* @deprecated as of Spring 3.0, in favor of the <code>scheduling.concurrent</code>
* package which is based on Java 5's <code>java.util.concurrent.ExecutorService</code>
*/
@Deprecated
public class MethodInvokingTimerTaskFactoryBean extends MethodInvokingRunnable implements FactoryBean<TimerTask> {
private TimerTask timerTask;

5
org.springframework.context/src/main/java/org/springframework/scheduling/timer/ScheduledTimerTask.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -37,7 +37,10 @@ import java.util.TimerTask; @@ -37,7 +37,10 @@ import java.util.TimerTask;
* @see java.util.TimerTask
* @see java.util.Timer#schedule(TimerTask, long, long)
* @see java.util.Timer#scheduleAtFixedRate(TimerTask, long, long)
* @deprecated as of Spring 3.0, in favor of the <code>scheduling.concurrent</code>
* package which is based on Java 5's <code>java.util.concurrent.ExecutorService</code>
*/
@Deprecated
public class ScheduledTimerTask {
private TimerTask timerTask;

3
org.springframework.context/src/main/java/org/springframework/scheduling/timer/TimerFactoryBean.java

@ -46,7 +46,10 @@ import org.springframework.util.StringUtils; @@ -46,7 +46,10 @@ import org.springframework.util.StringUtils;
* @see ScheduledTimerTask
* @see java.util.Timer
* @see java.util.TimerTask
* @deprecated as of Spring 3.0, in favor of the <code>scheduling.concurrent</code>
* package which is based on Java 5's <code>java.util.concurrent.ExecutorService</code>
*/
@Deprecated
public class TimerFactoryBean implements FactoryBean<Timer>, BeanNameAware, InitializingBean, DisposableBean {
protected final Log logger = LogFactory.getLog(getClass());

3
org.springframework.context/src/main/java/org/springframework/scheduling/timer/TimerTaskExecutor.java

@ -39,7 +39,10 @@ import org.springframework.util.StringUtils; @@ -39,7 +39,10 @@ import org.springframework.util.StringUtils;
* @author Juergen Hoeller
* @since 2.0
* @see java.util.Timer
* @deprecated as of Spring 3.0, in favor of the <code>scheduling.concurrent</code>
* package which is based on Java 5's <code>java.util.concurrent.ExecutorService</code>
*/
@Deprecated
public class TimerTaskExecutor implements SchedulingTaskExecutor, BeanNameAware, InitializingBean, DisposableBean {
protected final Log logger = LogFactory.getLog(getClass());

3
org.springframework.core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java

@ -27,7 +27,7 @@ import org.springframework.util.ConcurrencyThrottleSupport; @@ -27,7 +27,7 @@ import org.springframework.util.ConcurrencyThrottleSupport;
import org.springframework.util.CustomizableThreadCreator;
/**
* TaskExecutor implementation that fires up a new Thread for each task,
* {@link TaskExecutor} implementation that fires up a new Thread for each task,
* executing it asynchronously.
*
* <p>Supports limiting concurrent threads through the "concurrencyLimit"
@ -41,7 +41,6 @@ import org.springframework.util.CustomizableThreadCreator; @@ -41,7 +41,6 @@ import org.springframework.util.CustomizableThreadCreator;
* @since 2.0
* @see #setConcurrencyLimit
* @see SyncTaskExecutor
* @see org.springframework.scheduling.timer.TimerTaskExecutor
* @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
* @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor
*/

17
org.springframework.core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,16 +16,16 @@ @@ -16,16 +16,16 @@
package org.springframework.core.task;
import org.springframework.util.Assert;
import java.io.Serializable;
import org.springframework.util.Assert;
/**
* <code>TaskExecutor</code> implementation that executes each task
* <i>synchronously</i> in the calling thread.
*
* {@link TaskExecutor} implementation that executes each task <i>synchronously</i>
* in the calling thread.
*
* <p>Mainly intended for testing scenarios.
*
*
* <p>Execution in the calling thread does have the advantage of participating
* in it's thread context, for example the thread context class loader or the
* thread's current transaction association. That said, in many cases,
@ -33,9 +33,8 @@ import java.io.Serializable; @@ -33,9 +33,8 @@ import java.io.Serializable;
* <code>TaskExecutor</code> instead for such scenarios.
*
* @author Juergen Hoeller
* @see SimpleAsyncTaskExecutor
* @see org.springframework.scheduling.timer.TimerTaskExecutor
* @since 2.0
* @see SimpleAsyncTaskExecutor
*/
public class SyncTaskExecutor implements TaskExecutor, Serializable {

Loading…
Cancel
Save