synchronized void destroy(Transaction tx) throws IOException { List<Long> keys = new ArrayList<Long>(); for (Iterator<Map.Entry<Long, List<JobLocation>>> i = this.index.iterator(tx); i.hasNext();) { Map.Entry<Long, List<JobLocation>> entry = i.next(); keys.add(entry.getKey()); List<JobLocation> values = entry.getValue(); if (values != null) { for (JobLocation jl : values) { this.store.decrementJournalCount(tx, jl.getLocation()); } } } for (Long l : keys) { this.index.remove(tx, l); } }
void remove(Transaction tx, long time) throws IOException { List<JobLocation> values = this.index.remove(tx, time); if (values != null) { for (JobLocation jl : values) { this.store.decrementJournalCount(tx, jl.getLocation()); } } }
void remove(Transaction tx, long time, String jobId) throws IOException { JobLocation result = removeFromIndex(tx, time, jobId); if (result != null) { this.store.decrementJournalCount(tx, result.getLocation()); } }
synchronized void destroy(Transaction tx, long start, long finish) throws IOException { List<Long> keys = new ArrayList<Long>(); for (Iterator<Map.Entry<Long, List<JobLocation>>> i = this.index.iterator(tx, start); i.hasNext();) { Map.Entry<Long, List<JobLocation>> entry = i.next(); if (entry.getKey().longValue() <= finish) { keys.add(entry.getKey()); List<JobLocation> values = entry.getValue(); if (values != null) { for (JobLocation jl : values) { this.store.decrementJournalCount(tx, jl.getLocation()); } } } else { break; } } for (Long l : keys) { this.index.remove(tx, l); } }
void fireJob(JobLocation job) throws IllegalStateException, IOException { if (LOG.isDebugEnabled()) { LOG.debug("Firing " + job); } ByteSequence bs = this.store.getPayload(job.getLocation()); for (JobListener l : jobListeners) { l.scheduledJob(job.getJobId(), bs); } }
ByteSequence payload = getPayload(job.getLocation()); schedule(jobId, payload, "", job.getDelay(), job.getPeriod(), job.getRepeat()); waitTime = job.getDelay() != 0 ? job.getDelay() : job.getPeriod();