/*
* Copyright 2001-2009 Terracotta, Inc.
*
* 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.quartz.impl.jdbcjobstore;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.quartz.Calendar;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.JobPersistenceException;
import org.quartz.ObjectAlreadyExistsException;
import org.quartz.Scheduler;
import org.quartz.SchedulerConfigException;
import org.quartz.SchedulerException;
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;
import org.quartz.TriggerKey;
import org.quartz.Trigger.CompletedExecutionInstruction;
import org.quartz.Trigger.TriggerState;
import org.quartz.impl.matchers.GroupMatcher;
import org.quartz.impl.triggers.SimpleTriggerImpl;
import org.quartz.spi.ClassLoadHelper;
import org.quartz.spi.JobStore;
import org.quartz.spi.OperableTrigger;
import org.quartz.spi.SchedulerSignaler;
import org.quartz.spi.TriggerFiredBundle;
import org.quartz.spi.TriggerFiredResult;
import org.quartz.utils.DBConnectionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* <p>
* Contains base functionality for JDBC-based JobStore implementations.
* </p>
*
* @author <a href="mailto:jeff@binaryfeed.org">Jeffrey Wescott</a>
* @author James House
*/
public abstract class JobStoreSupport implements JobStore, Constants {
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Constants.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
protected static final String LOCK_TRIGGER_ACCESS = "TRIGGER_ACCESS";
protected static final String LOCK_JOB_ACCESS = "JOB_ACCESS";
protected static final String LOCK_CALENDAR_ACCESS = "CALENDAR_ACCESS";
protected static final String LOCK_STATE_ACCESS = "STATE_ACCESS";
protected static final String LOCK_MISFIRE_ACCESS = "MISFIRE_ACCESS";
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Data members.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
protected String dsName;
protected String tablePrefix = DEFAULT_TABLE_PREFIX;
protected boolean useProperties = false;
protected String instanceId;
protected String instanceName;
protected String delegateClassName;
protected String delegateInitString;
protected Class<? extends DriverDelegate> delegateClass = StdJDBCDelegate.class;
protected HashMap<String, Calendar> calendarCache = new HashMap<String, Calendar>();
private DriverDelegate delegate;
private long misfireThreshold = 60000L; // one minute
private boolean dontSetAutoCommitFalse = false;
private boolean isClustered = false;
private boolean useDBLocks = false;
private boolean lockOnInsert = true;
private Semaphore lockHandler = null; // set in initialize() method...
private String selectWithLockSQL = null;
private long clusterCheckinInterval = 7500L;
private ClusterManager clusterManagementThread = null;
private MisfireHandler misfireHandler = null;
private ClassLoadHelper classLoadHelper;
private SchedulerSignaler schedSignaler;
protected int maxToRecoverAtATime = 20;
private boolean setTxIsolationLevelSequential = false;
private boolean acquireTriggersWithinLock = false;
private long dbRetryInterval = 10000;
private boolean makeThreadsDaemons = false;
private boolean threadsInheritInitializersClassLoadContext = false;
private ClassLoader initializersLoader = null;
private boolean doubleCheckLockMisfireHandler = true;
private final Logger log = LoggerFactory.getLogger(getClass());
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Interface.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/**
* <p>
* Set the name of the <code>DataSource</code> that should be used for
* performing database functions.
* </p>
*/
public void setDataSource(String dsName) {
this.dsName = dsName;
}
/**
* <p>
* Get the name of the <code>DataSource</code> that should be used for
* performing database functions.
* </p>
*/
public String getDataSource() {
return dsName;
}
/**
* <p>
* Set the prefix that should be pre-pended to all table names.
* </p>
*/
public void setTablePrefix(String prefix) {
if (prefix == null) {
prefix = "";
}
this.tablePrefix = prefix;
}
/**
* <p>
* Get the prefix that should be pre-pended to all table names.
* </p>
*/
public String getTablePrefix() {
return tablePrefix;
}
/**
* <p>
* Set whether String-only properties will be handled in JobDataMaps.
* </p>
*/
public void setUseProperties(String useProp) {
if (useProp == null) {
useProp = "false";
}
this.useProperties = Boolean.valueOf(useProp).booleanValue();
}
/**
* <p>
* Get whether String-only properties will be handled in JobDataMaps.
* </p>
*/
public boolean canUseProperties() {
return useProperties;
}
/**
* <p>
* Set the instance Id of the Scheduler (must be unique within a cluster).
* </p>
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
/**
* <p>
* Get the instance Id of the Scheduler (must be unique within a cluster).
* </p>
*/
public String getInstanceId() {
return instanceId;
}
/**
* Set the instance name of the Scheduler (must be unique within this server instance).
*/
public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
}
public void setThreadPoolSize(final int poolSize) {
//
}
/**
* Get the instance name of the Scheduler (must be unique within this server instance).
*/
public String getInstanceName() {
return instanceName;
}
public long getEstimatedTimeToReleaseAndAcquireTrigger() {
return 70;
}
/**
* <p>
* Set whether this instance is part of a cluster.
* </p>
*/
public void setIsClustered(boolean isClustered) {
this.isClustered = isClustered;
}
/**
* <p>
* Get whether this instance is part of a cluster.
* </p>
*/
public boolean isClustered() {
return isClustered;
}
/**
* <p>
* Get the frequency (in milliseconds) at which this instance "checks-in"
* with the other instances of the cluster. -- Affects the rate of
* detecting failed instances.
* </p>
*/
public long getClusterCheckinInterval() {
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共1099个文件
html:657个
java:286个
xml:28个
Quartz是一个完全由java编写的开源作业调度框架,是OpenSymphony开源组织在Job scheduling领域又一个开源项目。,它可以与J2EE与J2SE应用程序相结合也可以单独使用。Quartz可以用来创建简单或为运行十个,百个,甚至是好几万个Jobs这样复杂的日程序表。Jobs可以做成标准的Java组件或 EJBs。
资源推荐
资源详情
资源评论
收起资源包目录
java作业调度插件quartz (1099个子文件)
instance2.bat 1KB
instance1.bat 1KB
instance2.bat 883B
instance1.bat 869B
client.bat 763B
server.bat 763B
example11.bat 758B
example10.bat 756B
example2.bat 621B
example6.bat 620B
example3.bat 619B
example14.bat 617B
example7.bat 617B
example9.bat 616B
example8.bat 616B
example4.bat 616B
example5.bat 615B
example1.bat 614B
buildcp.bat 462B
start-sample-server.bat 399B
stop-sample-server.bat 398B
addpath.bat 23B
stylesheet.css 1KB
inherit.gif 57B
index-all.html 1.25MB
StdJDBCDelegate.html 290KB
JobStoreSupport.html 274KB
SchedulerException.html 269KB
constant-values.html 240KB
QuartzSchedulerMBeanImpl.html 196KB
TriggerKey.html 184KB
DriverDelegate.html 183KB
QuartzScheduler.html 161KB
JobKey.html 153KB
RemoteMBeanScheduler.html 122KB
StdJDBCConstants.html 115KB
QuartzSchedulerMBean.html 114KB
RemoteScheduler.html 109KB
Scheduler.html 108KB
RAMJobStore.html 107KB
JobPersistenceException.html 106KB
package-use.html 103KB
StdScheduler.html 103KB
JobDetail.html 102KB
OracleDelegate.html 98KB
Trigger.html 96KB
CronTriggerImpl.html 93KB
StdSchedulerFactory.html 92KB
AbstractTrigger.html 88KB
XMLSchedulingDataProcessor.html 88KB
RemotableQuartzScheduler.html 87KB
serialized-form.html 86KB
SimpleTriggerImpl.html 84KB
PointbaseDelegate.html 83KB
overview-tree.html 81KB
GroupMatcher.html 79KB
CalendarIntervalTriggerImpl.html 76KB
Calendar.html 76KB
CronExpression.html 71KB
SimplePropertiesTriggerPersistenceDelegateSupport.html 69KB
Constants.html 69KB
DB2v6Delegate.html 67KB
DateBuilder.html 65KB
SybaseDelegate.html 64KB
PostgreSQLDelegate.html 62KB
WebLogicOracleDelegate.html 62KB
HSQLDBDelegate.html 62KB
WebLogicDelegate.html 62KB
JobStoreCMT.html 61KB
MSSQLDelegate.html 61KB
DailyCalendar.html 61KB
DelegatingLocalityTrigger.html 61KB
JobExecutionContext.html 59KB
DB2v7Delegate.html 59KB
QuartzSchedulerResources.html 59KB
ListenerManagerImpl.html 59KB
CloudscapeDelegate.html 59KB
JobDataMap.html 57KB
DB2v8Delegate.html 56KB
JobStoreTX.html 53KB
DBSemaphore.html 53KB
Matcher.html 51KB
TriggerBuilder.html 51KB
SimpleTriggerPersistenceDelegate.html 51KB
CronTriggerPersistenceDelegate.html 50KB
BroadcastSchedulerListener.html 48KB
JobDetailImpl.html 47KB
Scheduler.html 47KB
SchedulerListenerSupport.html 46KB
DirectSchedulerFactory.html 45KB
PropertiesParser.html 45KB
SimpleScheduleBuilder.html 45KB
ListenerManager.html 45KB
CalendarIntervalTriggerPersistenceDelegate.html 44KB
StringKeyDirtyFlagMap.html 43KB
StdRowLockSemaphore.html 43KB
UpdateLockRowSemaphore.html 42KB
JobDataMap.html 40KB
JobBuilder.html 39KB
JobExecutionContextImpl.html 39KB
共 1099 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
- zhouchang10242014-05-27版本是2.0的
NuclearB
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功