com.shinitech.djammadev.jobs.CancellableJob Maven / Gradle / Ivy
package com.shinitech.djammadev.jobs;
import akka.actor.Cancellable;
public class CancellableJob implements Cancellable {
private final Cancellable underline;
private final Job job;
public CancellableJob(Cancellable underline, Job job) {
this.underline = underline;
this.job = job;
}
@Override
public boolean cancel() {
boolean cancelled = this.underline.cancel();
this.job.stopJob();
return cancelled;
}
@Override
public boolean isCancelled() {
return this.underline.isCancelled();
}
}