亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? schedulerfactorybean.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * Copyright 2002-2007 the original author or authors.
 *
 * Licensed 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
 *
 *      http://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.
 */

package org.springframework.scheduling.quartz;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import javax.sql.DataSource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.Calendar;
import org.quartz.JobDetail;
import org.quartz.JobListener;
import org.quartz.ObjectAlreadyExistsException;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.SchedulerListener;
import org.quartz.Trigger;
import org.quartz.TriggerListener;
import org.quartz.impl.RemoteScheduler;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.simpl.SimpleThreadPool;
import org.quartz.spi.JobFactory;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.Lifecycle;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.SchedulingException;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.util.CollectionUtils;

/**
 * FactoryBean that sets up a Quartz {@link org.quartz.Scheduler},
 * manages its lifecycle as part of the Spring application context,
 * and exposes the Scheduler reference for dependency injection.
 *
 * <p>Allows registration of JobDetails, Calendars and Triggers, automatically
 * starting the scheduler on initialization and shutting it down on destruction.
 * In scenarios that just require static registration of jobs at startup, there
 * is no need to access the Scheduler instance itself in application code.
 *
 * <p>For dynamic registration of jobs at runtime, use a bean reference to
 * this SchedulerFactoryBean to get direct access to the Quartz Scheduler
 * (<code>org.quartz.Scheduler</code>). This allows you to create new jobs
 * and triggers, and also to control and monitor the entire Scheduler.
 *
 * <p>Note that Quartz instantiates a new Job for each execution, in
 * contrast to Timer which uses a TimerTask instance that is shared
 * between repeated executions. Just JobDetail descriptors are shared.
 *
 * <p>When using persistent jobs, it is strongly recommended to perform all
 * operations on the Scheduler within Spring-managed (or plain JTA) transactions.
 * Else, database locking will not properly work and might even break.
 * (See {@link #setDataSource setDataSource} javadoc for details.)
 *
 * <p>The preferred way to achieve transactional execution is to demarcate
 * declarative transactions at the business facade level, which will
 * automatically apply to Scheduler operations performed within those scopes.
 * Alternatively, you may add transactional advice for the Scheduler itself.
 *
 * <p>This version of Spring's SchedulerFactoryBean requires Quartz 1.5 or higher.
 *
 * @author Juergen Hoeller
 * @since 18.02.2004
 * @see #setDataSource
 * @see org.quartz.Scheduler
 * @see org.quartz.SchedulerFactory
 * @see org.quartz.impl.StdSchedulerFactory
 * @see org.springframework.transaction.interceptor.TransactionProxyFactoryBean
 */
public class SchedulerFactoryBean
    implements FactoryBean, ApplicationContextAware, InitializingBean, DisposableBean, Lifecycle {

	public static final String PROP_THREAD_COUNT = "org.quartz.threadPool.threadCount";

	public static final int DEFAULT_THREAD_COUNT = 10;


	private static final ThreadLocal configTimeTaskExecutorHolder = new ThreadLocal();

	private static final ThreadLocal configTimeDataSourceHolder = new ThreadLocal();

	private static final ThreadLocal configTimeNonTransactionalDataSourceHolder = new ThreadLocal();

	/**
	 * Return the TaskExecutor for the currently configured Quartz Scheduler,
	 * to be used by LocalTaskExecutorThreadPool.
	 * <p>This instance will be set before initialization of the corresponding
	 * Scheduler, and reset immediately afterwards. It is thus only available
	 * during configuration.
	 * @see #setDataSource
	 * @see LocalDataSourceJobStore
	 */
	public static TaskExecutor getConfigTimeTaskExecutor() {
		return (TaskExecutor) configTimeTaskExecutorHolder.get();
	}

	/**
	 * Return the DataSource for the currently configured Quartz Scheduler,
	 * to be used by LocalDataSourceJobStore.
	 * <p>This instance will be set before initialization of the corresponding
	 * Scheduler, and reset immediately afterwards. It is thus only available
	 * during configuration.
	 * @see #setDataSource
	 * @see LocalDataSourceJobStore
	 */
	public static DataSource getConfigTimeDataSource() {
		return (DataSource) configTimeDataSourceHolder.get();
	}

	/**
	 * Return the non-transactional DataSource for the currently configured
	 * Quartz Scheduler, to be used by LocalDataSourceJobStore.
	 * <p>This instance will be set before initialization of the corresponding
	 * Scheduler, and reset immediately afterwards. It is thus only available
	 * during configuration.
	 * @see #setNonTransactionalDataSource
	 * @see LocalDataSourceJobStore
	 */
	public static DataSource getConfigTimeNonTransactionalDataSource() {
		return (DataSource) configTimeNonTransactionalDataSourceHolder.get();
	}


	protected final Log logger = LogFactory.getLog(getClass());


	private Class schedulerFactoryClass = StdSchedulerFactory.class;

	private String schedulerName;

	private Resource configLocation;

	private Properties quartzProperties;


	private TaskExecutor taskExecutor;

	private DataSource dataSource;

	private DataSource nonTransactionalDataSource;

	private PlatformTransactionManager transactionManager;


	private Map schedulerContextMap;

	private ApplicationContext applicationContext;

	private String applicationContextSchedulerContextKey;

	private JobFactory jobFactory;

	private boolean jobFactorySet = false;


	private boolean overwriteExistingJobs = false;

	private String[] jobSchedulingDataLocations;

	private List jobDetails;

	private Map calendars;

	private List triggers;


	private SchedulerListener[] schedulerListeners;

	private JobListener[] globalJobListeners;

	private JobListener[] jobListeners;

	private TriggerListener[] globalTriggerListeners;

	private TriggerListener[] triggerListeners;


	private boolean autoStartup = true;

	private int startupDelay = 0;

	private boolean waitForJobsToCompleteOnShutdown = false;


	private Scheduler scheduler;


	/**
	 * Set the Quartz SchedulerFactory implementation to use.
	 * <p>Default is StdSchedulerFactory, reading in the standard
	 * quartz.properties from quartz.jar. To use custom Quartz
	 * properties, specify "configLocation" or "quartzProperties".
	 * @see org.quartz.impl.StdSchedulerFactory
	 * @see #setConfigLocation
	 * @see #setQuartzProperties
	 */
	public void setSchedulerFactoryClass(Class schedulerFactoryClass) {
		if (schedulerFactoryClass == null || !SchedulerFactory.class.isAssignableFrom(schedulerFactoryClass)) {
			throw new IllegalArgumentException("schedulerFactoryClass must implement [org.quartz.SchedulerFactory]");
		}
		this.schedulerFactoryClass = schedulerFactoryClass;
	}

	/**
	 * Set the name of the Scheduler to fetch from the SchedulerFactory.
	 * If not specified, the default Scheduler will be used.
	 * @see org.quartz.SchedulerFactory#getScheduler(String)
	 * @see org.quartz.SchedulerFactory#getScheduler
	 */
	public void setSchedulerName(String schedulerName) {
		this.schedulerName = schedulerName;
	}

	/**
	 * Set the location of the Quartz properties config file, for example
	 * as classpath resource "classpath:quartz.properties".
	 * <p>Note: Can be omitted when all necessary properties are specified
	 * locally via this bean, or when relying on Quartz' default configuration.
	 * @see #setQuartzProperties
	 */
	public void setConfigLocation(Resource configLocation) {
		this.configLocation = configLocation;
	}

	/**
	 * Set Quartz properties, like "org.quartz.threadPool.class".
	 * <p>Can be used to override values in a Quartz properties config file,
	 * or to specify all necessary properties locally.
	 * @see #setConfigLocation
	 */
	public void setQuartzProperties(Properties quartzProperties) {
		this.quartzProperties = quartzProperties;
	}


	/**
	 * Set the Spring TaskExecutor to use as Quartz backend.
	 * Exposed as thread pool through the Quartz SPI.
	 * <p>Can be used to assign a JDK 1.5 ThreadPoolExecutor or a CommonJ
	 * WorkManager as Quartz backend, to avoid Quartz's manual thread creation.
	 * <p>By default, a Quartz SimpleThreadPool will be used, configured through
	 * the corresponding Quartz properties.
	 * @see #setQuartzProperties
	 * @see LocalTaskExecutorThreadPool
	 * @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
	 * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor
	 */
	public void setTaskExecutor(TaskExecutor taskExecutor) {
		this.taskExecutor = taskExecutor;
	}

	/**
	 * Set the default DataSource to be used by the Scheduler. If set,
	 * this will override corresponding settings in Quartz properties.
	 * <p>Note: If this is set, the Quartz settings should not define
	 * a job store "dataSource" to avoid meaningless double configuration.
	 * <p>A Spring-specific subclass of Quartz' JobStoreCMT will be used.
	 * It is therefore strongly recommended to perform all operations on
	 * the Scheduler within Spring-managed (or plain JTA) transactions.
	 * Else, database locking will not properly work and might even break
	 * (e.g. if trying to obtain a lock on Oracle without a transaction).
	 * <p>Supports both transactional and non-transactional DataSource access.
	 * With a non-XA DataSource and local Spring transactions, a single DataSource
	 * argument is sufficient. In case of an XA DataSource and global JTA transactions,
	 * SchedulerFactoryBean's "nonTransactionalDataSource" property should be set,
	 * passing in a non-XA DataSource that will not participate in global transactions.
	 * @see #setNonTransactionalDataSource
	 * @see #setQuartzProperties
	 * @see #setTransactionManager
	 * @see LocalDataSourceJobStore
	 */
	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

	/**
	 * Set the DataSource to be used by the Scheduler <i>for non-transactional access</i>.
	 * <p>This is only necessary if the default DataSource is an XA DataSource that will
	 * always participate in transactions: A non-XA version of that DataSource should
	 * be specified as "nonTransactionalDataSource" in such a scenario.
	 * <p>This is not relevant with a local DataSource instance and Spring transactions.
	 * Specifying a single default DataSource as "dataSource" is sufficient there.
	 * @see #setDataSource
	 * @see LocalDataSourceJobStore
	 */
	public void setNonTransactionalDataSource(DataSource nonTransactionalDataSource) {
		this.nonTransactionalDataSource = nonTransactionalDataSource;
	}

	/**
	 * Set the transaction manager to be used for registering jobs and triggers
	 * that are defined by this SchedulerFactoryBean. Default is none; setting
	 * this only makes sense when specifying a DataSource for the Scheduler.
	 * @see #setDataSource
	 */
	public void setTransactionManager(PlatformTransactionManager transactionManager) {
		this.transactionManager = transactionManager;
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费观看成人短视频| 国产一区二区美女| 国产精品电影院| 日韩一区二区三区视频在线观看| 99精品在线免费| 岛国精品一区二区| 国产黄色91视频| 精品亚洲国内自在自线福利| 久久精品噜噜噜成人88aⅴ| 91精品国产一区二区三区香蕉| 欧美中文一区二区三区| 日本高清无吗v一区| 欧美色视频一区| 欧美精品三级日韩久久| 欧美一区二区三区色| 欧美一区二区精美| 久久精品无码一区二区三区| 国产欧美日韩麻豆91| 久久综合久久综合九色| 国产精品免费人成网站| 中文字幕日韩av资源站| 午夜欧美在线一二页| 开心九九激情九九欧美日韩精美视频电影| 久久激情综合网| 成人av在线资源网站| 91在线视频18| 日韩欧美色电影| 欧美—级在线免费片| 一区二区三区精品| 韩国女主播成人在线| 99精品偷自拍| 精品国产99国产精品| 亚洲精品视频免费看| 日韩精品电影一区亚洲| 成人h动漫精品一区二| 91精品国产全国免费观看| 欧美国产日本视频| 日韩中文字幕av电影| 三级一区在线视频先锋| 国产成人av福利| 欧美日韩国产区一| 国产精品毛片久久久久久| 日韩av成人高清| 成人ar影院免费观看视频| 欧美tk—视频vk| 亚洲特黄一级片| 国产成人亚洲综合色影视| 欧美三级中文字| 成人欧美一区二区三区黑人麻豆| 久久91精品久久久久久秒播| 91成人免费在线| 国产精品久久国产精麻豆99网站 | 国产91丝袜在线播放九色| 欧美丝袜自拍制服另类| 国产精品久99| 国产一区999| 精品久久免费看| 免费高清在线视频一区·| 欧美性色黄大片手机版| 中文字幕欧美一区| 成人综合婷婷国产精品久久免费| 欧美大片顶级少妇| 免费一级欧美片在线观看| 欧美性大战久久久久久久蜜臀| 国产精品嫩草久久久久| 国产suv精品一区二区6| 久久久一区二区| 国产尤物一区二区在线| 久久综合中文字幕| 激情综合亚洲精品| 精品国产伦一区二区三区免费| 日韩一区二区三区视频在线 | 伊人开心综合网| 国产欧美日韩在线观看| 国产原创一区二区三区| 日韩精品中文字幕在线不卡尤物| 亚洲精品视频在线看| 91亚洲资源网| 国产精品国产三级国产普通话三级| 国产精品影音先锋| 国产色91在线| 丁香婷婷综合网| 国产精品不卡在线| 在线视频亚洲一区| 一区二区日韩av| 在线免费观看日本一区| 日韩av一区二区三区| 欧洲av一区二区嗯嗯嗯啊| 一区二区三区四区不卡在线| 欧美主播一区二区三区| 亚洲大片一区二区三区| 91精品欧美久久久久久动漫| 久久精品国产一区二区| 国产精品久久久久久久久久久免费看 | 欧美成人a在线| 国产精品18久久久久| 亚洲三级在线观看| 欧美一区中文字幕| 国产一区二区精品在线观看| 最新欧美精品一区二区三区| 欧美日韩国产综合视频在线观看| 免费的成人av| 国产精品理论片在线观看| 99久久精品免费看国产免费软件| 一区二区欧美精品| 久久网站最新地址| 日本韩国精品在线| 国产一区二区91| **网站欧美大片在线观看| 4438成人网| 99久精品国产| 九一九一国产精品| 亚洲码国产岛国毛片在线| 日韩西西人体444www| 99免费精品视频| 经典三级视频一区| 国产视频一区在线观看| 91年精品国产| 国产一区二区精品久久99| 亚洲福利电影网| 亚洲视频一二三区| 久久精品视频在线看| 欧美精品在线一区二区三区| 风流少妇一区二区| 美女www一区二区| 亚洲主播在线观看| 中文字幕亚洲不卡| 国产欧美一区二区在线观看| 制服丝袜在线91| jlzzjlzz欧美大全| 国产精品羞羞答答xxdd| 日韩精品欧美成人高清一区二区| 日韩一区在线播放| 欧美激情综合五月色丁香小说| 欧美一区永久视频免费观看| 色婷婷一区二区| 成人福利在线看| 国内精品视频666| 五月天激情小说综合| 亚洲三级在线看| 亚洲欧美日韩国产综合| 国产精品久久久久婷婷| 国产一区二区在线影院| 亚洲成人一区二区| 亚洲高清免费视频| 亚洲午夜精品在线| 亚洲网友自拍偷拍| 欧美午夜影院一区| 欧美怡红院视频| 在线观看日韩av先锋影音电影院| 99久久综合99久久综合网站| 成人免费视频播放| 99视频热这里只有精品免费| 成人精品视频.| 国产亚洲欧美一级| 狠狠色丁香久久婷婷综合_中| ㊣最新国产の精品bt伙计久久| 国产福利视频一区二区三区| 成av人片一区二区| 黑人精品欧美一区二区蜜桃| 99国产欧美另类久久久精品| 亚洲无人区一区| 天天做天天摸天天爽国产一区| 五月婷婷激情综合网| 久久国内精品视频| 国产成人综合网站| 91在线观看一区二区| 91色在线porny| 欧美妇女性影城| 久久夜色精品国产噜噜av| 国产精品三级视频| 国产69精品久久久久毛片| 成人少妇影院yyyy| 色综合激情五月| 一本到高清视频免费精品| 欧美在线不卡一区| 欧美一区二区三区日韩视频| 精品国产污网站| 亚洲人成网站在线| 亚洲欧洲精品一区二区三区| 专区另类欧美日韩| 日韩av电影天堂| 高清av一区二区| 欧美日韩国产高清一区| 久久精品免视看| 亚洲欧美电影一区二区| 丝袜国产日韩另类美女| 粉嫩绯色av一区二区在线观看| 波多野结衣亚洲| 欧美日韩在线亚洲一区蜜芽| 久久久久久久久久久久久久久99 | 免费成人在线观看| 成人h精品动漫一区二区三区| 欧美日韩国产高清一区二区三区 | 亚洲精品日日夜夜| 国产一区91精品张津瑜| 欧美日韩一区不卡| 国产精品视频一二| 美腿丝袜一区二区三区| 色综合久久久久综合体桃花网|