Repository: deltaspike Updated Branches: refs/heads/master 50f9555e4 -> 3c80f1820
DELTASPIKE-1082 documentation for configurable cron-expressions Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/3c80f182 Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/3c80f182 Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/3c80f182 Branch: refs/heads/master Commit: 3c80f182000f8165ac0e993540bdb233538700c7 Parents: 50f9555 Author: gpetracek <[email protected]> Authored: Sat Apr 2 14:52:28 2016 +0200 Committer: gpetracek <[email protected]> Committed: Sat Apr 2 14:52:28 2016 +0200 ---------------------------------------------------------------------- documentation/src/main/asciidoc/scheduler.adoc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/deltaspike/blob/3c80f182/documentation/src/main/asciidoc/scheduler.adoc ---------------------------------------------------------------------- diff --git a/documentation/src/main/asciidoc/scheduler.adoc b/documentation/src/main/asciidoc/scheduler.adoc index 6d14db2..8b211b7 100644 --- a/documentation/src/main/asciidoc/scheduler.adoc +++ b/documentation/src/main/asciidoc/scheduler.adoc @@ -160,9 +160,19 @@ public class ProjectStageAwareSchedulerController } ------------------------------------------------------------------------------------- +== Configurable CRON expressions + +In some cases it might be useful to configure a cron-expression e.g. per Project-Stage. +Therefore, DeltaSpike (v1.6.0+) allows to use keys instead of hardcoded expressions. + +In the previous examples we had e.g. `@Scheduled(cronExpression = "0 0/10 * * * ?")`. +Instead of hardcoding it that way, it's possible to use e.g. `@Scheduled(cronExpression = "{myCronExpression}")` and +in one of the active config-sources used by DeltaSpike a concrete expression can be defined e.g. via `myCronExpression=0 0/10 * * * ?`. +Using e.g. `myCronExpression.Development=0 0/5 * * * ?` would allow to change the configured expression for Project-Stage development. + == Manual Scheduler Control -Th SPI allows to control the scheduler (or integrate any other +The SPI allows to control the scheduler (or integrate any other compatible scheduler as an alternative to Quartz2) Via standard injection like
