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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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;
	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人一二三区| www.亚洲人| 日本在线不卡视频一二三区| 一区二区三区av电影| 1区2区3区精品视频| 国产精品理论片| 国产精品伦理在线| 亚洲欧洲精品一区二区三区 | 成人欧美一区二区三区白人| 国产精品久久久久久久裸模| 国产精品伦一区二区三级视频| 国产日韩三级在线| 国产精品久久久久久久久图文区 | 麻豆精品在线看| 久久99精品久久久久婷婷| 久久99国产精品久久99| 韩国av一区二区| 成人精品免费视频| 一本大道久久a久久综合婷婷 | 国产人成亚洲第一网站在线播放| 精品久久久久久久久久久院品网| 欧美一级在线视频| 日韩欧美精品在线视频| 国产欧美视频在线观看| 亚洲色图.com| 日韩成人一区二区三区在线观看| 久久激五月天综合精品| 丰满亚洲少妇av| 91福利社在线观看| 91精品国产欧美一区二区18 | 国产欧美日韩另类一区| 国产精品久久久久久久裸模| 亚洲一区国产视频| 美女www一区二区| 国产精品18久久久久| 成人动漫一区二区| 欧美私人免费视频| 日韩欧美国产不卡| 国产精品女主播av| 亚洲国产精品久久人人爱| 另类人妖一区二区av| 成人国产亚洲欧美成人综合网| 欧美在线观看18| 久久嫩草精品久久久精品| 亚洲欧美日韩国产成人精品影院| 日韩电影一区二区三区| av色综合久久天堂av综合| 欧美日韩在线播放一区| 久久久精品综合| 亚洲精品国产品国语在线app| 免费在线观看一区| 91色porny蝌蚪| 欧美高清dvd| 国产精品嫩草99a| 日本在线观看不卡视频| 色综合天天做天天爱| 日韩欧美不卡在线观看视频| 亚洲乱码一区二区三区在线观看| 美女一区二区三区在线观看| www.久久久久久久久| 欧美一区二区三区在| 伊人婷婷欧美激情| 国产精品一区在线观看乱码| 欧美日韩一区二区三区四区| 国产亚洲成年网址在线观看| 日韩黄色在线观看| 91免费国产在线| 久久久91精品国产一区二区三区| 午夜视频在线观看一区二区三区| 丁香桃色午夜亚洲一区二区三区| 欧美一区二区三区免费在线看| 亚洲欧洲av色图| 国产精品综合网| 欧美一区国产二区| 亚洲电影第三页| 99久久99精品久久久久久 | 麻豆国产欧美日韩综合精品二区| 色综合天天天天做夜夜夜夜做| 久久久久久久久久看片| 青青草国产成人av片免费| 在线免费观看成人短视频| 国产精品久久午夜| 国产成人精品aa毛片| 久久综合色综合88| 麻豆精品在线观看| 欧美一区二区日韩一区二区| 亚洲va天堂va国产va久| 91国产免费看| 亚洲三级久久久| 91视频免费观看| 亚洲日穴在线视频| 91看片淫黄大片一级| 国产精品美女一区二区三区| 国产一区二区导航在线播放| 欧美tickling挠脚心丨vk| 青椒成人免费视频| 91精品国产综合久久婷婷香蕉| 亚洲午夜激情av| 欧美天堂一区二区三区| 亚洲国产一二三| 欧美日韩免费一区二区三区视频| 一区二区久久久| 欧美综合久久久| 伊人性伊人情综合网| 欧美午夜电影网| 天天综合日日夜夜精品| 欧美日韩国产bt| 日日夜夜免费精品| 日韩一二在线观看| 久久爱另类一区二区小说| 欧美精品一区二区高清在线观看| 蜜桃av噜噜一区二区三区小说| 日韩欧美国产午夜精品| 裸体歌舞表演一区二区| 久久免费视频色| 成人av网站大全| 一区二区三区加勒比av| 欧美日韩在线综合| 久久国产尿小便嘘嘘| 欧美激情自拍偷拍| 91色porny| 日韩国产欧美在线视频| 精品国内片67194| 国产精品一区三区| 亚洲日本韩国一区| 欧美猛男gaygay网站| 伦理电影国产精品| 国产精品色哟哟网站| 色婷婷国产精品| 欧美a一区二区| 久久丝袜美腿综合| 91丨porny丨首页| 天天综合天天综合色| 久久久不卡网国产精品二区| 色综合一区二区| 免费在线观看视频一区| 国产精品美女久久久久久久| 日本精品视频一区二区| 奇米综合一区二区三区精品视频| 国产欧美一区二区在线| 欧美日韩中文字幕一区| 精品一区二区三区久久久| 中文字幕一区二区三区四区不卡| 欧美撒尿777hd撒尿| 久久成人免费网| 国产精品大尺度| 欧美一区二区不卡视频| www.欧美色图| 免费看欧美美女黄的网站| 欧美国产亚洲另类动漫| 欧美另类z0zxhd电影| 国产成人aaa| 亚洲bt欧美bt精品777| 久久精品视频免费| 欧美另类久久久品| 99久久精品一区二区| 青青草原综合久久大伊人精品 | 国产精品91一区二区| 亚洲一级在线观看| 国产欧美一二三区| 制服丝袜激情欧洲亚洲| 成人av中文字幕| 韩国av一区二区三区四区 | 高清不卡一区二区| 视频一区二区中文字幕| 1024成人网| 国产视频一区二区三区在线观看| 欧美日韩国产a| 91在线精品一区二区| 国产精品综合久久| 天天色图综合网| 一区二区三区不卡视频 | 秋霞国产午夜精品免费视频| 最新国产精品久久精品| 久久久亚洲高清| 日韩一级二级三级| 欧美三级视频在线| aa级大片欧美| 国产成人精品一区二区三区四区 | 欧美日韩不卡在线| 欧美一级二级三级乱码| 国产精品一品视频| 奇米影视一区二区三区| 亚洲同性gay激情无套| 久久久另类综合| 日韩天堂在线观看| 欧美日本在线视频| 欧美亚洲免费在线一区| 美女一区二区三区在线观看| 国产盗摄一区二区| 国产在线一区二区综合免费视频| 香蕉影视欧美成人| 一二三区精品视频| 国产精品网站在线| 国产丝袜在线精品| 亚洲精品一线二线三线| 日韩欧美一区二区免费| 3d动漫精品啪啪一区二区竹菊| 欧美日韩成人综合天天影院| 欧美无人高清视频在线观看|