Skip to content

Add support for @Scheduled as a meta-annotation [SPR-6669] #11335

@spring-projects-issues

Description

@spring-projects-issues

Mark Fisher opened SPR-6669 and commented

Rather than requiring the @Scheduled annotation directly on a method, we should also support it as a meta-annotation. This would not only avoid a direct dependency on the Spring annotation class, but more importantly, it would enable the use of custom scheduling annotations with encapsulated trigger information to be applied via simplified annotations.

For example, the following annotation...

@Scheduled(cron = "0 0 * * * ?")
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Hourly {}

...could be applied to a method:

public class ReportGenerator {

    @Hourly
    public void generateReport() {
      ...
    }
}

Affects: 3.0 GA

Referenced from: commits 1284086

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions