Package org.springframework.scheduling.quartz

# Class SchedulerAccessorBean

java.lang.Object
org.springframework.scheduling.quartz.SchedulerAccessor
org.springframework.scheduling.quartz.SchedulerAccessorBean

All Implemented Interfaces:
  `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.BeanFactoryAware`, `org.springframework.beans.factory.InitializingBean`, `org.springframework.context.ResourceLoaderAware`

public class SchedulerAccessorBean extends SchedulerAccessor implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
Spring bean-style class for accessing a Quartz Scheduler, i.e. for registering jobs, triggers and listeners on a given `Scheduler` instance.

Compatible with Quartz 2.1.4 and higher, as of Spring 4.1.

Since:
  2.5.6
Author:
  Juergen Hoeller
See Also:
  - `setScheduler(org.quartz.Scheduler)`
  - `setSchedulerName(java.lang.String)`

## Field Summary

### Fields inherited from class org.springframework.scheduling.quartz.SchedulerAccessor

`logger, resourceLoader`

## Constructor Summary

Constructors
Constructor
Description
`SchedulerAccessorBean()`

## Method Summary

Modifier and Type
Method
Description
`void`
`afterPropertiesSet()`
`protected Scheduler`
`findDefaultScheduler()`
`protected Scheduler`
`findScheduler(String schedulerName)`
`Scheduler`
`getScheduler()`
Return the Quartz Scheduler instance that this accessor operates on.
`void`
`setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)`
`void`
`setScheduler(Scheduler scheduler)`
Specify the Quartz `Scheduler` instance to operate on.
`void`
`setSchedulerName(String schedulerName)`
Specify the Quartz `Scheduler` to operate on via its scheduler name in the Spring application context or also in the Quartz `SchedulerRepository`.

### Methods inherited from class org.springframework.scheduling.quartz.SchedulerAccessor

`registerJobsAndTriggers, registerListeners, setCalendars, setGlobalJobListeners, setGlobalTriggerListeners, setJobDetails, setJobSchedulingDataLocation, setJobSchedulingDataLocations, setOverwriteExistingJobs, setResourceLoader, setSchedulerListeners, setTransactionManager, setTriggers`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SchedulerAccessorBean

public SchedulerAccessorBean()

## Method Details

### setSchedulerName

public void setSchedulerName(String schedulerName)
Specify the Quartz `Scheduler` to operate on via its scheduler name in the Spring application context or also in the Quartz `SchedulerRepository`.

Schedulers can be registered in the repository through custom bootstrapping, for example, via the `StdSchedulerFactory` or `DirectSchedulerFactory` factory classes. However, in general, it's preferable to use Spring's `SchedulerFactoryBean` which includes the job/trigger/listener capabilities of this accessor as well.

If not specified, this accessor will try to retrieve a default `Scheduler` bean from the containing application context.

### setScheduler

public void setScheduler(Scheduler scheduler)
Specify the Quartz `Scheduler` instance to operate on.

If not specified, this accessor will try to retrieve a default `Scheduler` bean from the containing application context.

### getScheduler

public Scheduler getScheduler()
Return the Quartz Scheduler instance that this accessor operates on.

Specified by:
  `getScheduler` in class `SchedulerAccessor`

### setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)

Specified by:
  `setBeanFactory` in interface `org.springframework.beans.factory.BeanFactoryAware`

### afterPropertiesSet

public void afterPropertiesSet() throws SchedulerException

Specified by:
  `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
Throws:
  `SchedulerException`

### findScheduler

protected Scheduler findScheduler(String schedulerName) throws SchedulerException

Throws:
  `SchedulerException`

### findDefaultScheduler

protected Scheduler findDefaultScheduler()