Skip to content

Commit

Permalink
[cron] fix minutely, Requirement and ConstantNames
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
  • Loading branch information
stbischof authored and pkriens committed Sep 5, 2024
1 parent 9d2bebe commit 0903fa1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private Constants() {
/**
* the named cron expression for daily execution.
*/
public static final String CRON_EXPRESSION_DAYLY = "@daily";
public static final String CRON_EXPRESSION_DAILY = "@daily";

/**
* the named cron expression for hourly execution.
Expand All @@ -69,12 +69,12 @@ private Constants() {
/**
* the named cron expression for minutely execution.
*/
public static final String CRON_EXPRESSION_MINUTLY = "@minutely";
public static final String CRON_EXPRESSION_MINUTELY = "@minutely";

/**
* the named cron expression for secondly execution.
*/
public static final String CRON_EXPRESSION_SECUNDLY = "@secondly";
public static final String CRON_EXPRESSION_SECONDLY = "@secondly";

/**
* the named cron expression for execution onreboot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import org.osgi.annotation.bundle.Requirement;
import org.osgi.namespace.implementation.ImplementationNamespace;

/**
* Require an implementation for the this specification
*/
@Requirement(namespace = ImplementationNamespace.IMPLEMENTATION_NAMESPACE, filter = "(&("
+ ImplementationNamespace.IMPLEMENTATION_NAMESPACE + "="
+ Constants.SPECIFICATION_NAME + ")${frange;${version;==;"
+ Constants.SPECIFICATION_VERSION + "}})")

@org.osgi.annotation.bundle.Requirement(
effective = "active",
namespace = ImplementationNamespace.IMPLEMENTATION_NAMESPACE,
name = Constants.SPECIFICATION_NAME,
version = Constants.SPECIFICATION_VERSION
)
@Retention(RetentionPolicy.CLASS)
public @interface RequireSchedulerImplementation {}
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ private String preDeclared(String expression) {
case Constants.CRON_EXPRESSION_WEEKLY :
return "2 0 0 ? * MON";

case Constants.CRON_EXPRESSION_DAYLY :
case Constants.CRON_EXPRESSION_DAILY :
return "3 0 0 * * ?";

case Constants.CRON_EXPRESSION_HOURLY :
return "4 0 * * * ?";

case Constants.CRON_EXPRESSION_MINUTLY :
return "* 0 * * * *";
case Constants.CRON_EXPRESSION_MINUTELY :
return "0 * * * * *";

case Constants.CRON_EXPRESSION_SECUNDLY:
case Constants.CRON_EXPRESSION_SECONDLY:
return "* * * * * *";

case Constants.CRON_EXPRESSION_REBOOT :
Expand Down

0 comments on commit 0903fa1

Please sign in to comment.