Browse Source

Declare CRON_DISABLED constant value only once

This commit removes the duplicated CRON_DISABLED constant value from
@Scheuled and simply refers to the ScheduledTaskRegistrar.CRON_DISABLED
constant.

This avoids a potential package cycle by ensuring that the `annotation`
package depends on the `config` package but not the other way around.

See gh-23568
pull/23645/head
Sam Brannen 6 years ago
parent
commit
a676059699
  1. 5
      spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java

5
spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java

@ -23,6 +23,8 @@ import java.lang.annotation.Retention; @@ -23,6 +23,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
/**
* Annotation that marks a method to be scheduled. Exactly one of the
* {@link #cron}, {@link #fixedDelay}, or {@link #fixedRate} attributes must be
@ -60,8 +62,9 @@ public @interface Scheduled { @@ -60,8 +62,9 @@ public @interface Scheduled {
* <p>This is primarily meant for use with <code>${...}</code> placeholders,
* allowing for external disabling of corresponding scheduled methods.
* @since 5.1
* @see ScheduledTaskRegistrar#CRON_DISABLED
*/
String CRON_DISABLED = "-";
String CRON_DISABLED = ScheduledTaskRegistrar.CRON_DISABLED;
/**

Loading…
Cancel
Save