Skip to content

Commit 5d64515

Browse files
committed
fixed java doc
1 parent 4e6f32a commit 5d64515

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

core/src/main/java/org/sterl/spring/persistent_tasks/trigger/CronTrigger.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,26 @@
99

1010
import org.springframework.aot.hint.annotation.Reflective;
1111

12-
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
12+
@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
1313
@Retention(RetentionPolicy.RUNTIME)
1414
@Documented
1515
@Reflective
1616
public @interface CronTrigger {
1717
/**
18-
* A unique id for this trigger which is optional, by default the cron expression or the delay is used.
18+
* A unique id for this trigger which is optional, by default the cron
19+
* expression or the delay is used.
1920
*/
2021
String id() default "";
22+
2123
/**
22-
* A cron-like expression, extending the usual UN*X definition to include triggers
24+
* A cron-like expression, extending the usual UN*X definition to include
25+
* triggers
2326
* on the second, minute, hour, day of month, month, and day of week.
24-
* <p>For example, {@code "0 * * * * MON-FRI"} means once per minute on weekdays
27+
* <p>
28+
* For example, {@code "0 * * * * MON-FRI"} means once per minute on weekdays
2529
* (at the top of the minute - the 0th second).
26-
* <p>The fields read from left to right are interpreted as follows.
30+
* </p>
31+
* The fields read from left to right are interpreted as follows.
2732
* <ul>
2833
* <li>second</li>
2934
* <li>minute</li>
@@ -32,9 +37,7 @@
3237
* <li>month</li>
3338
* <li>day of week</li>
3439
* </ul>
35-
* <p>The special value {@link #CRON_DISABLED "-"} indicates a disabled cron
36-
* trigger, primarily meant for externally specified values resolved by a
37-
* <code>${...}</code> placeholder.
40+
*
3841
* @return an expression that can be parsed to a cron schedule
3942
* @see org.springframework.scheduling.support.CronExpression#parse(String)
4043
*/

core/src/main/java/org/sterl/spring/persistent_tasks/trigger/repository/CronTriggerRepository.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
/**
1717
* In-memory repository for cron trigger definitions.
18-
* Cron triggers are registered at startup and live in memory like task definitions.
18+
* Cron triggers are registered at startup and live in memory like task
19+
* definitions.
1920
*/
2021
@Slf4j
2122
@Component
@@ -35,15 +36,15 @@ public TriggerKey register(@NonNull CronTriggerEntity<? extends Serializable> cr
3536
if (cronTriggerEntities.containsKey(key)) {
3637
throw new IllegalStateException("Cron trigger with '" + key + "' is already registered!");
3738
}
38-
cronTriggerEntities.put(key , cronTrigger);
39+
cronTriggerEntities.put(key, cronTrigger);
3940
log.info("Registered cron for={}", cronTrigger);
4041
return key;
4142
}
4243

4344
/**
4445
* Gets a cron trigger by ID.
4546
*
46-
* @param id the trigger ID
47+
* @param key the TriggerKey
4748
* @return the cron trigger if found
4849
*/
4950
public Optional<CronTriggerEntity<? extends Serializable>> get(@NonNull TriggerKey key) {
@@ -68,6 +69,7 @@ public boolean suspend(@NonNull TriggerKey key) {
6869
}
6970
return false;
7071
}
72+
7173
public boolean resume(@NonNull TriggerKey key) {
7274
var cronTrigger = cronTriggerEntities.get(key);
7375
if (cronTrigger != null) {
@@ -81,7 +83,7 @@ public boolean resume(@NonNull TriggerKey key) {
8183
/**
8284
* Unregisters a cron trigger.
8385
*
84-
* @param id the trigger ID
86+
* @param key the TriggerKey of the cron
8587
* @return the removed cron trigger, or empty if not found
8688
*/
8789
public Optional<CronTriggerEntity<? extends Serializable>> unregister(@NonNull TriggerKey key) {

0 commit comments

Comments
 (0)