import org.quartz.*
import org.quartz.impl.*
// スケジューラ取得
//sf = new StdSchedulerFactory()
sf = new StdSchedulerFactory("./myquartz.properties")
sched = sf.getScheduler()
// ジョブ情報の表示
job = sched.getJobDetail("job1", "group1")
if( job != null ){
println("name:" + job.name)
println("full name:" + job.fullName)
println("group:" + job.group)
println("job class:" + job.jobClass.name)
}
sched.shutdown(true)
設定ファイル(myquartz.properties)
org.quartz.scheduler.instanceName = DefaultQuartzScheduler
org.quartz.scheduler.rmi.export = false
org.quartz.scheduler.rmi.proxy = false
org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
org.quartz.jobStore.misfireThreshold = 60000
#org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
# データソースの設定
org.quartz.dataSource.QuartzDS.driver = org.postgresql.Driver
org.quartz.dataSource.QuartzDS.URL = jdbc:postgresql://localhost:5432/quartz
org.quartz.dataSource.QuartzDS.user = postgres
org.quartz.dataSource.QuartzDS.password = postgres
org.quartz.dataSource.QuartzDS.maxConnections = 10
org.quartz.dataSource.QuartzDS.validationQuery = select 1
# JDBC JobStore設定
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.jobStore.dataSource = QuartzDS
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.isClustered = false
org.quartz.jobStore.clusterCheckinInterval = 15000
org.quartz.jobStore.maxMisfiresToHandleAtATime = 20
org.quartz.jobStore.dontSetAutoCommitFalse = false
org.quartz.jobStore.selectWithLockSQL = SELECT * FROM {0}LOCKS WHERE LOCK_NAME = ? FOR UPDATE
org.quartz.jobStore.txIsolationLevelSerializable = false
org.quartz.jobStore.acquireTriggersWithinLock = false
0 件のコメント:
コメントを投稿