86 lines
2.1 KiB
Java
86 lines
2.1 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package javax.baja.job;
|
|
|
|
import javax.baja.job.BJob;
|
|
import javax.baja.job.BJobState;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public abstract class BSimpleJob
|
|
extends BJob {
|
|
public static final Type TYPE;
|
|
JobThread thread;
|
|
static /* synthetic */ Class class$javax$baja$job$BSimpleJob;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public void doRun(Context context) {
|
|
this.thread = new JobThread(this.toPathString(), context);
|
|
this.thread.start();
|
|
}
|
|
|
|
public void doCancel(Context context) {
|
|
if (this.getJobState().isRunning()) {
|
|
this.setJobState(BJobState.canceling);
|
|
if (this.thread != null) {
|
|
this.thread.interrupt();
|
|
}
|
|
}
|
|
}
|
|
|
|
public abstract void run(Context var1) throws Exception;
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$javax$baja$job$BSimpleJob;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$job$BSimpleJob = BSimpleJob.class("[Ljavax.baja.job.BSimpleJob;", false);
|
|
}
|
|
TYPE = Sys.loadType(clazz);
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
class JobThread
|
|
extends Thread {
|
|
Context cx;
|
|
|
|
public void run() {
|
|
try {
|
|
BSimpleJob.this.run(this.cx);
|
|
BSimpleJob.this.success();
|
|
}
|
|
catch (Throwable throwable) {
|
|
BSimpleJob.this.failed(throwable);
|
|
}
|
|
}
|
|
|
|
JobThread(String string, Context context) {
|
|
super(string);
|
|
this.cx = context;
|
|
}
|
|
}
|
|
}
|
|
|