use of org.quartz.SchedulerException in project openhab1-addons by openhab.
the class FHTBinding method unscheduleJob.
private void unscheduleJob(JobKey jobKey) {
if (jobKey == null) {
return;
}
try {
Scheduler sched = StdSchedulerFactory.getDefaultScheduler();
sched.deleteJob(jobKey);
} catch (SchedulerException e) {
logger.error("Error while unscheduling time update job", e);
}
}
use of org.quartz.SchedulerException in project openhab1-addons by openhab.
the class MapDBPersistenceService method scheduleJob.
/**
* Schedules new quartz scheduler jobs for committing transactions and
* backing up the database
*/
private void scheduleJob() {
try {
Scheduler sched = StdSchedulerFactory.getDefaultScheduler();
// schedule commit-job
JobDetail job = newJob(CommitJob.class).withIdentity("Commit_Transaction", SCHEDULER_GROUP).build();
SimpleTrigger trigger = newTrigger().withIdentity("Commit_Transaction", SCHEDULER_GROUP).withSchedule(repeatSecondlyForever(commitInterval)).build();
sched.scheduleJob(job, trigger);
logger.debug("Scheduled Commit-Job with interval {}sec.", commitInterval);
} catch (SchedulerException e) {
logger.warn("Could not create Job: {}", e.getMessage());
}
}
use of org.quartz.SchedulerException in project openhab1-addons by openhab.
the class MapDBPersistenceService method cancelAllJobs.
/**
* Delete all quartz scheduler jobs of the group <code>Dropbox</code>.
*/
private void cancelAllJobs() {
try {
Scheduler sched = StdSchedulerFactory.getDefaultScheduler();
Set<JobKey> jobKeys = sched.getJobKeys(jobGroupEquals(SCHEDULER_GROUP));
if (jobKeys.size() > 0) {
sched.deleteJobs(new ArrayList<JobKey>(jobKeys));
logger.debug("Found {} MapDB-Jobs to delete from DefaultScheduler (keys={})", jobKeys.size(), jobKeys);
}
} catch (SchedulerException e) {
logger.warn("Couldn't remove Commit-Job: {}", e.getMessage());
}
}
use of org.quartz.SchedulerException in project openhab1-addons by openhab.
the class GCalPersistenceService method scheduleUploadJob.
/**
* Schedules new quartz scheduler job for uploading calendar entries to Google
*/
private void scheduleUploadJob() {
try {
scheduler = StdSchedulerFactory.getDefaultScheduler();
JobDetail job = newJob(SynchronizationJob.class).withIdentity("Upload_GCal-Entries", GCAL_SCHEDULER_GROUP).build();
SimpleTrigger trigger = newTrigger().withIdentity("Upload_GCal-Entries", GCAL_SCHEDULER_GROUP).withSchedule(repeatSecondlyForever(uploadInterval)).build();
scheduler.scheduleJob(job, trigger);
logger.debug("Scheduled Google Calendar Upload-Job with interval '{}'", uploadInterval);
} catch (SchedulerException e) {
logger.warn("Could not create Google Calendar Upload-Job: {}", e.getMessage());
}
}
use of org.quartz.SchedulerException in project openhab1-addons by openhab.
the class Db4oPersistenceService method scheduleJob.
/**
* Schedules new quartz scheduler jobs for committing transactions and
* backing up the database
*/
private void scheduleJob() {
try {
Scheduler sched = StdSchedulerFactory.getDefaultScheduler();
// schedule commit-job
JobDetail job = newJob(CommitJob.class).withIdentity("Commit_Transaction", SCHEDULER_GROUP).build();
SimpleTrigger trigger = newTrigger().withIdentity("Commit_Transaction", SCHEDULER_GROUP).withSchedule(repeatSecondlyForever(commitInterval)).build();
sched.scheduleJob(job, trigger);
logger.debug("Scheduled Commit-Job with interval {}sec.", commitInterval);
// schedule backup-job
JobDetail backupJob = newJob(BackupJob.class).withIdentity("Backup_DB", SCHEDULER_GROUP).build();
CronTrigger backupTrigger = newTrigger().withIdentity("Backup_DB", SCHEDULER_GROUP).withSchedule(CronScheduleBuilder.cronSchedule(backupInterval)).build();
sched.scheduleJob(backupJob, backupTrigger);
logger.debug("Scheduled Backup-Job with cron expression '{}'", backupInterval);
} catch (SchedulerException e) {
logger.warn("Could not create Job: {}", e.getMessage());
}
}
Aggregations