Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.18 KB

File metadata and controls

28 lines (19 loc) · 1.18 KB

sample-java-job-decorator

Showing how to use @Scheduled to register a Quartz job in Eclipse Dirigible.

Layout

sample-java-job-decorator/   # Dirigible project (registry path)
└── demo/
    └── scheduled/
        └── CleanupJob.java  # @Scheduled — fires every second, logs "CleanupJob executed!"

Usage

Drop this project into the Dirigible IDE (clone via the Git perspective and publish, or copy it to /registry/public/sample-java-job-decorator/). The synchronizer compiles CleanupJob.java, registers the Quartz job, and it starts firing on the declared cron expression immediately.

Job styles

Two ways to write a Java job — pick one per @Component class (never both), like Spring:

  • Strong interfaceCleanupJob is a @Component that implements JobHandler and supplies its own cron() (like org.quartz.Job); no @Scheduled annotation.
  • Method-level annotationMaintenance is a @Component with @Scheduled-annotated methods (Spring @Scheduled-on-a-method style).

See the Develop guide and the Java SDK.