Deprecate CommonJ scheduling in favor of JSR-236 Concurrency Utilities

Issue: SPR-17117
This commit is contained in:
Juergen Hoeller 2018-08-02 14:38:30 +02:00
parent 50550717d6
commit 6735e2387c
8 changed files with 23 additions and 15 deletions

View File

@ -28,7 +28,10 @@ import org.springframework.util.Assert;
* @since 2.0
* @see commonj.timers.TimerListener
* @see java.lang.Runnable
* @deprecated as of 5.1, in favor of EE 7's
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler}
*/
@Deprecated
public class DelegatingTimerListener implements TimerListener {
private final Runnable runnable;

View File

@ -26,9 +26,10 @@ import org.springframework.util.Assert;
*
* @author Juergen Hoeller
* @since 2.0
* @see commonj.work.Work
* @see java.lang.Runnable
* @deprecated as of 5.1, in favor of EE 7's
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor}
*/
@Deprecated
public class DelegatingWork implements Work {
private final Runnable delegate;

View File

@ -36,10 +36,10 @@ import org.springframework.lang.Nullable;
*
* @author Juergen Hoeller
* @since 2.0
* @see commonj.timers.TimerListener
* @see commonj.timers.TimerManager#schedule(commonj.timers.TimerListener, long, long)
* @see commonj.timers.TimerManager#scheduleAtFixedRate(commonj.timers.TimerListener, long, long)
* @deprecated as of 5.1, in favor of EE 7's
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler}
*/
@Deprecated
public class ScheduledTimerListener {
@Nullable

View File

@ -34,7 +34,10 @@ import org.springframework.util.Assert;
* @author Juergen Hoeller
* @since 3.0
* @see commonj.timers.TimerManager
* @deprecated as of 5.1, in favor of EE 7's
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler}
*/
@Deprecated
public abstract class TimerManagerAccessor extends JndiLocatorSupport
implements InitializingBean, DisposableBean, Lifecycle {

View File

@ -51,7 +51,10 @@ import org.springframework.lang.Nullable;
* @see ScheduledTimerListener
* @see commonj.timers.TimerManager
* @see commonj.timers.TimerListener
* @deprecated as of 5.1, in favor of EE 7's
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler}
*/
@Deprecated
public class TimerManagerFactoryBean extends TimerManagerAccessor
implements FactoryBean<TimerManager>, InitializingBean, DisposableBean, Lifecycle {

View File

@ -40,7 +40,10 @@ import org.springframework.util.ErrorHandler;
* @author Juergen Hoeller
* @author Mark Fisher
* @since 3.0
* @deprecated as of 5.1, in favor of EE 7's
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler}
*/
@Deprecated
public class TimerManagerTaskScheduler extends TimerManagerAccessor implements TaskScheduler {
@Nullable

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -63,7 +63,10 @@ import org.springframework.util.concurrent.ListenableFutureTask;
*
* @author Juergen Hoeller
* @since 2.0
* @deprecated as of 5.1, in favor of EE 7's
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor}
*/
@Deprecated
public class WorkManagerTaskExecutor extends JndiLocatorSupport
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, WorkManager, InitializingBean {
@ -195,14 +198,6 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
return future;
}
/**
* This task executor prefers short-lived work units.
*/
@Override
public boolean prefersShortLivedTasks() {
return true;
}
//-------------------------------------------------------------------------
// Implementation of the CommonJ WorkManager interface

View File

@ -294,7 +294,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
* @see #setQuartzProperties
* @see LocalTaskExecutorThreadPool
* @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
* @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor
* @see org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor
*/
public void setTaskExecutor(Executor taskExecutor) {
this.taskExecutor = taskExecutor;