101 lines
2.4 KiB
Java
101 lines
2.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package javax.baja.util;
|
|
|
|
import javax.baja.spy.SpyWriter;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BIcon;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.util.Worker;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public abstract class BWorker
|
|
extends BComponent {
|
|
public static final Type TYPE;
|
|
private static final BIcon icon;
|
|
static /* synthetic */ Class class$javax$baja$util$BWorker;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public void started() throws Exception {
|
|
super.started();
|
|
if (!this.isSteadyStateWorker()) {
|
|
this.startWorker();
|
|
}
|
|
}
|
|
|
|
public void atSteadyState() throws Exception {
|
|
super.atSteadyState();
|
|
if (this.isSteadyStateWorker()) {
|
|
this.startWorker();
|
|
}
|
|
}
|
|
|
|
public void stopped() throws Exception {
|
|
super.stopped();
|
|
this.stopWorker();
|
|
}
|
|
|
|
public abstract Worker getWorker();
|
|
|
|
protected void startWorker() {
|
|
this.getWorker().start(this.getWorkerThreadName());
|
|
}
|
|
|
|
protected void stopWorker() {
|
|
this.getWorker().stop();
|
|
}
|
|
|
|
protected boolean isSteadyStateWorker() {
|
|
return false;
|
|
}
|
|
|
|
protected String getWorkerThreadName() {
|
|
return this.toPathString();
|
|
}
|
|
|
|
public void spy(SpyWriter spyWriter) throws Exception {
|
|
Worker worker = this.getWorker();
|
|
if (worker != null) {
|
|
worker.spy(spyWriter);
|
|
} else {
|
|
spyWriter.startProps("No Worker");
|
|
spyWriter.endProps();
|
|
}
|
|
super.spy(spyWriter);
|
|
}
|
|
|
|
public BIcon getIcon() {
|
|
return icon;
|
|
}
|
|
|
|
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$util$BWorker;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$util$BWorker = BWorker.class("[Ljavax.baja.util.BWorker;", false);
|
|
}
|
|
TYPE = Sys.loadType(clazz);
|
|
icon = BIcon.std("gears.png");
|
|
}
|
|
}
|
|
|