scheduler
БесплатноБез исполняемых скриптовНе проверенAEM Cloud Service expert skill for Sling Scheduler. Routes to path-a.md (Runnable + OSGi properties) or path-b.md (Sling Jobs via JobManager). Covers…
от adobe★ 342 звезды на GitHubОб этом скилле
Scheduler — AEM as a Cloud Service
Overview
Schedules in AEM CS must be declared as OSGi component properties — Scheduler.schedule() is not persisted across restarts. There is no @SlingScheduled annotation in the CS SDK.
Three properties control every scheduler:
| Property | Required value | Why |
|---|---|---|
scheduler.expression |
Valid Quartz cron string | Declares the trigger |
scheduler.concurrent:Boolean=false |
:Boolean type hint required |
Without the hint OSGi treats it as String and concurrent runs are not suppressed |
scheduler.runOn |
SINGLE or LEADER for any write or external call |
Default ALL fires on every publish pod simultaneously |
Classification — choose before making any changes
Path A — Runnable + OSGi component properties when ALL are true:
- Cron is a hardcoded constant or single
@AttributeDefinition-backed value - Only one schedule per class
- Class
implements Runnable - No
ScheduleOptions.config(), no per-execution job payload
→ Read path-a.md and follow its steps.
Path B — Sling Jobs via JobManager when ANY is true in the legacy source:
- Cron comes from runtime config (
config.cronExpression()) - Multiple cron expressions per class
- Legacy code needs per-execution job data, config-driven scheduling, or a Scheduler + JobConsumer split
- Business logic needs job context or properties at execution time
@Modifiedre-registers schedules with new config values
→ Read path-b.md and follow its steps.
One pattern per session. If the codebase has both kinds, fix one class at a time.
Discovery
Detection is performed by the analyzer (../scripts/analyze.sh), run by the runbook:
bash ../scripts/analyze.sh <workspace-root> --pattern scheduler
Match criteria (what the detector flags):
- A class that
implements org.apache.sling.commons.scheduler.Job(import-aware). - The OSGi-property scheduler shape — a class that
implements Runnableand carries an OSGi@Componentdeclaring ascheduler.expression/scheduler.name/scheduler.periodproperty. - A file that imports
org.apache.sling.commons.scheduler.Scheduler(programmatic use via an injectedScheduler) but has no class-level match — one finding at the file's primary type.
Emitted at the class declaration, with the class header as the snippet. Parse-level only — direct implements clause and same-file @Component; reached-via-base-class and constant-valued properties are not resolved.
Resolution contract
guided — apply (guided). The analyzer locates and reports each scheduler class; remediation is judgment-based and routed by the Classification above to Path A (path-a.md, Runnable + OSGi properties) or Path B (path-b.md, Sling Jobs via JobManager). Open the chosen path and apply its steps in an apply session.
| Site shape | Disposition |
|---|---|
Single-schedule, hardcoded cron, implements Runnable |
apply (guided) → path-a.md |
Config-driven cron, multiple schedules, implements Job, or ScheduleOptions.config() |
apply (guided) → path-b.md |
Already Sling Jobs via JobManager with single-execution guard |
skipped: already-compliant |
Test code (src/test/) |
skipped: test-scope |
Review Checklist
Use the path-specific checklists in path-a.md and path-b.md for scheduler mechanics.
Cross-cutting checks:
- The chosen path matches the source shape: Path A for a single hardcoded cron +
Runnable; Path B for config-driven or multi-schedule legacy code - No
@SlingScheduledannotation - No
scheduler.schedule(),scheduler.unschedule(), orscheduler.EXPR()calls in the migrated code -
getServiceResourceResolverused — notgetAdministrativeResourceResolver - ResourceResolver in try-with-resources — not stored as a field
- OSGi DS R6 annotations (
org.osgi.service.component.annotations) — no Felix SCR - Service user subservice name matches a
ServiceUserMapperImpl.amendedconfig
Path A checks:
-
scheduler.expressionis a valid Quartz cron string (6 or 7 fields) -
scheduler.concurrent:Boolean=falsepresent with the:Booleantype hint -
scheduler.runOn=SINGLEorLEADERset when the job writes to repo or calls external systems
Path B checks:
- The job topic constant is shared between the Scheduler and JobConsumer classes
- Job properties are read with
job.getProperty("key", Type.class) -
JobResult.OK,FAILED, orCANCELis returned from the consumer
Troubleshooting
| Symptom | Log to search | Fix direction |
|---|---|---|
| Scheduler never fires after deployment | none (silent) | Inspect the component's runtime state: if UNSATISFIED, the cause is usually a missing config or a misspelled config field name (`scheduler_e |
Установить scheduler в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл scheduler?
AEM Cloud Service expert skill for Sling Scheduler. Routes to path-a.md (Runnable + OSGi properties) or path-b.md (Sling Jobs via JobManager). Covers classification, CS-specific constraints (no @SlingScheduled, multi-pod runOn, Boolean type hint), review checklist, troubleshooting fingerprints, and common pitfalls.
Как установить скилл scheduler?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scheduler запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic