Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from notoon/feat_props_config_sub
Add ability to configure Scheduled annotation using props
- Loading branch information
Showing
5 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package org.seedstack.scheduler; | ||
|
||
import org.seedstack.seed.Logging; | ||
import org.slf4j.Logger; | ||
|
||
import static org.seedstack.scheduler.ExceptionPolicy.UNSCHEDULE_ALL_TRIGGERS; | ||
|
||
/** | ||
* @author tuan.docao@ext.mpsa.com | ||
*/ | ||
@Scheduled(value = "${org.seedstack.addons.scheduling.cron.expression}", taskName = "${org.seedstack.addons.scheduling.task.name}", triggerName = "${org.seedstack.addons.scheduling.trigger.name}", exceptionPolicy = UNSCHEDULE_ALL_TRIGGERS) | ||
public class TimedTask4 implements Task { | ||
|
||
@Logging | ||
private Logger logger; | ||
|
||
@Override | ||
public void execute(SchedulingContext sc) throws Exception { | ||
logger.info("Executing timed task 4"); | ||
AutomaticScheduleIT.invocationCount4++; | ||
AutomaticScheduleIT.actualTaskName = sc.getTaskName(); | ||
AutomaticScheduleIT.actualTriggerName = sc.getTriggerName(); | ||
AutomaticScheduleIT.countDownLatch.countDown(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org> | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
|
||
[org.seedstack.addons.scheduling] | ||
cron.expression = * * * * * ? | ||
task.name = Task4 | ||
trigger.name = Trigger4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters