Skip to content

Commit

Permalink
Deprecate CommonJ scheduling in favor of JSR-236 Concurrency Utilities
Browse files Browse the repository at this point in the history
Issue: SPR-17117
  • Loading branch information
jhoeller committed Aug 2, 2018
1 parent 5055071 commit 6735e23
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
Expand Up @@ -28,7 +28,10 @@
* @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;
Expand Down
Expand Up @@ -26,9 +26,10 @@
*
* @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;
Expand Down
Expand Up @@ -36,10 +36,10 @@
*
* @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
Expand Down
Expand Up @@ -34,7 +34,10 @@
* @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 {

Expand Down
Expand Up @@ -51,7 +51,10 @@
* @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 {

Expand Down
Expand Up @@ -40,7 +40,10 @@
* @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
Expand Down
@@ -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.
Expand Down Expand Up @@ -63,7 +63,10 @@
*
* @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 {

Expand Down Expand Up @@ -195,14 +198,6 @@ public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
return future;
}

/**
* This task executor prefers short-lived work units.
*/
@Override
public boolean prefersShortLivedTasks() {
return true;
}


//-------------------------------------------------------------------------
// Implementation of the CommonJ WorkManager interface
Expand Down
Expand Up @@ -294,7 +294,7 @@ public void setQuartzProperties(Properties quartzProperties) {
* @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;
Expand Down

0 comments on commit 6735e23

Please sign in to comment.