/*
* 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.Trigger.CompletedExecutionInstruction;
import org.quartz.Trigger.TriggerState;
import org.quartz.TriggerKey;
import org.quartz.impl.DefaultThreadExecutor;
import org.quartz.impl.matchers.GroupMatcher;
import org.quartz.impl.matchers.StringMatcher;
import org.quartz.impl.matchers.StringMatcher.StringOperatorName;
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.ThreadExecutor;
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 = 15000L; // 15 secs
private boolean makeThreadsDaemons = false;
private boolean threadsInheritInitializersClassLoadContext = false;
private ClassLoader initializersLoader = null;
private boolean doubleCheckLockMisfireHandler = true;
private final Logger log = LoggerFactory.getLogger(getClass());
private ThreadExecutor threadExecutor = new DefaultThreadExecutor();
private boolean schedulerRunning = false;
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 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) {
//
}
public void setThreadExecutor(ThreadExecutor threadExecutor) {
this.threadExecutor = threadExecutor;
}
public ThreadExecutor getThreadExecutor() {
return threadExecutor;
}
/**
* 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
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
java 定时器quartz (1164个子文件)
instance2.bat 1KB
instance1.bat 1KB
instance2.bat 961B
instance1.bat 949B
client.bat 786B
server.bat 786B
example11.bat 781B
example10.bat 779B
example2.bat 642B
example6.bat 641B
example3.bat 640B
example14.bat 638B
example7.bat 638B
example8.bat 637B
example9.bat 637B
example4.bat 637B
example5.bat 636B
example1.bat 635B
buildcp.bat 482B
start-sample-server.bat 399B
stop-sample-server.bat 398B
addpath.bat 24B
stylesheet.css 1KB
inherit.gif 57B
index-all.html 1.32MB
StdJDBCDelegate.html 294KB
JobStoreSupport.html 276KB
SchedulerException.html 276KB
constant-values.html 247KB
QuartzSchedulerMBeanImpl.html 198KB
TriggerKey.html 195KB
DriverDelegate.html 186KB
QuartzScheduler.html 164KB
JobKey.html 162KB
RemoteMBeanScheduler.html 125KB
StdJDBCConstants.html 116KB
QuartzSchedulerMBean.html 115KB
RemoteScheduler.html 113KB
Scheduler.html 112KB
RAMJobStore.html 108KB
JobPersistenceException.html 106KB
StdScheduler.html 106KB
package-use.html 106KB
JobDetail.html 102KB
OracleDelegate.html 99KB
DailyTimeIntervalTriggerImpl.html 96KB
StdSchedulerFactory.html 94KB
Trigger.html 94KB
serialized-form.html 93KB
CronTriggerImpl.html 93KB
AbstractTrigger.html 88KB
RemotableQuartzScheduler.html 88KB
CalendarIntervalTriggerImpl.html 87KB
GroupMatcher.html 86KB
XMLSchedulingDataProcessor.html 86KB
overview-tree.html 84KB
SimpleTriggerImpl.html 84KB
PointbaseDelegate.html 83KB
Calendar.html 79KB
CronExpression.html 73KB
DateBuilder.html 72KB
Constants.html 70KB
SimplePropertiesTriggerPersistenceDelegateSupport.html 70KB
DB2v6Delegate.html 67KB
ListenerManagerImpl.html 66KB
CUBRIDDelegate.html 65KB
SybaseDelegate.html 64KB
PostgreSQLDelegate.html 62KB
WebLogicOracleDelegate.html 62KB
JobStoreCMT.html 62KB
HSQLDBDelegate.html 62KB
WebLogicDelegate.html 62KB
MSSQLDelegate.html 62KB
DailyCalendar.html 61KB
DelegatingLocalityTrigger.html 61KB
QuartzSchedulerResources.html 61KB
JobExecutionContext.html 60KB
DB2v7Delegate.html 60KB
CloudscapeDelegate.html 59KB
CacheDelegate.html 58KB
JobDataMap.html 57KB
DB2v8Delegate.html 56KB
DirectSchedulerFactory.html 55KB
Matcher.html 54KB
JobStoreTX.html 54KB
DBSemaphore.html 53KB
TriggerBuilder.html 52KB
ListenerManager.html 52KB
SimpleTriggerPersistenceDelegate.html 51KB
CronTriggerPersistenceDelegate.html 51KB
BroadcastSchedulerListener.html 49KB
JobDetailImpl.html 47KB
Scheduler.html 47KB
SimpleScheduleBuilder.html 46KB
SchedulerListenerSupport.html 46KB
PropertiesParser.html 45KB
DailyTimeIntervalTriggerPersistenceDelegate.html 45KB
CalendarIntervalTriggerPersistenceDelegate.html 44KB
StringKeyDirtyFlagMap.html 44KB
DailyTimeIntervalScheduleBuilder.html 43KB
共 1164 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
- 猪小小_up2014-10-22可以用,但是没有其他的包,还需要别的,不过还是感谢
王德伟
- 粉丝: 1
- 资源: 25
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功