////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

Beyond the `triggers` block, a job class can declare a number of `static` properties that control how it is registered with the scheduler.

[cols="2,1,4"]
|===
| Property | Default | Description

| `group`
| `GRAILS_JOBS`
| The Quartz job group the job belongs to. Grouping lets you pause or resume a set of related jobs together — see <<quartzJobManagerService,Managing Jobs at Runtime>>.

| `description`
| `Grails Job`
| A short description of the job. It is carried on the Quartz `JobDetail` and can be read back at runtime through the `jobManagerService`.

| `concurrent`
| `true`
| Whether a new execution may begin while a previous execution of the same job is still running. Set to `false` to serialize executions — the job is then registered with Quartz's `@DisallowConcurrentExecution` semantics.

| `sessionRequired`
| `true`
| Whether a Hibernate `Session` is bound to the job's execution thread. See <<quartzConfiguration,Configuration>>.

| `jobEnabled`
| `true`
| Set to `false` to leave the job out of the scheduler. A job that becomes disabled is removed from the scheduler, along with its triggers, when the application reloads.

| `durability`
| `true`
| Whether the job is retained by the scheduler once it has no remaining triggers. Only meaningful with a persistent job store.

| `requestsRecovery`
| `false`
| Whether the job is re-executed after a hard shutdown — the process crashing, or the machine being switched off — while it was running. On the recovered execution, `JobExecutionContext.isRecovering()` returns `true`. Only meaningful with a persistent job store.
|===

For example:

[source,groovy]
----
class ReportJob {

    static group = 'reporting'
    static description = 'Generates the nightly sales report'
    static concurrent = false
    static requestsRecovery = true

    static triggers = {
        cron cronExpression: '0 0 2 * * ?'
    }

    void execute() {
        // ...
    }
}
----
