Enum Class ScheduleMode
- All Implemented Interfaces:
Serializable,Comparable<ScheduleMode>,Constable
This enum defines the different timing strategies that can be used to schedule agent execution.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCron-based scheduling using cron expressions.Fixed-delay scheduling with constant delays between execution completion and next start.Fixed-rate scheduling with constant intervals between execution starts.No scheduling - the agent will not be automatically scheduled. -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduleModeReturns the enum constant of this class with the specified name.static ScheduleMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No scheduling - the agent will not be automatically scheduled.This is the default mode. When set to NONE, the agent will not be executed automatically by the scheduler. The agent can still be called manually through its normal call methods.
Use case: Agents that should only be executed on-demand or manually triggered.
-
CRON
Cron-based scheduling using cron expressions.Allows flexible scheduling based on cron syntax, supporting complex patterns like "execute every Monday at 9 AM" or "execute on the first day of each month".
Example expressions:
- "0 0 8 * * ?" - Every day at 8:00 AM
- "0 0/30 * * * ?" - Every 30 minutes
- "0 0 9 * * MON-FRI" - Every weekday at 9:00 AM
- "0 0 0 1 * ?" - First day of every month at midnight
-
FIXED_RATE
Fixed-rate scheduling with constant intervals between execution starts.The task executes at fixed intervals regardless of execution duration. If an execution takes longer than the interval, the next execution may start immediately after the previous one completes (depending on concurrency policy).
Use case: Regular polling, periodic health checks, time-based triggers.
Example: With a 5-minute rate, executions start at T, T+5min, T+10min, etc.
-
FIXED_DELAY
Fixed-delay scheduling with constant delays between execution completion and next start.The task waits for a fixed duration after completion before starting the next execution. This ensures a minimum idle time between executions.
Use case: Sequential processing, rate-limited operations, preventing system overload.
Example: With a 5-minute delay, if execution takes 2 minutes, the next execution starts 7 minutes after the previous one started (2min execution + 5min delay).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-