90 lines
2.4 KiB
Java
90 lines
2.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package javax.baja.util;
|
|
|
|
import javax.baja.sys.BFacets;
|
|
import javax.baja.sys.BInteger;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Property;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.util.BWorker;
|
|
import javax.baja.util.ThreadPoolWorker;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public abstract class BThreadPoolWorker
|
|
extends BWorker {
|
|
public static final Property maxThreads = BThreadPoolWorker.newProperty(0, 4, BFacets.make("min", BInteger.make(1)));
|
|
public static final Type TYPE;
|
|
static /* synthetic */ Class class$javax$baja$util$BThreadPoolWorker;
|
|
|
|
public int getMaxThreads() {
|
|
return this.getInt(maxThreads);
|
|
}
|
|
|
|
public void setMaxThreads(int n) {
|
|
this.setInt(maxThreads, n, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public void started() throws Exception {
|
|
super.started();
|
|
this.updateMaxThreads();
|
|
}
|
|
|
|
public void atSteadyState() throws Exception {
|
|
super.atSteadyState();
|
|
this.updateMaxThreads();
|
|
}
|
|
|
|
public void changed(Property property, Context context) {
|
|
if (this.isRunning() && property.equals(maxThreads)) {
|
|
this.updateMaxThreads();
|
|
return;
|
|
}
|
|
super.changed(property, context);
|
|
}
|
|
|
|
void updateMaxThreads() {
|
|
ThreadPoolWorker threadPoolWorker = (ThreadPoolWorker)this.getWorker();
|
|
if (threadPoolWorker != null) {
|
|
threadPoolWorker.setMaxThreads(this.getMaxThreads());
|
|
}
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
|
|
public BThreadPoolWorker() {
|
|
}
|
|
|
|
public BThreadPoolWorker(int n) {
|
|
this.setMaxThreads(n);
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$javax$baja$util$BThreadPoolWorker;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$util$BThreadPoolWorker = BThreadPoolWorker.class("[Ljavax.baja.util.BThreadPoolWorker;", false);
|
|
}
|
|
TYPE = Sys.loadType(clazz);
|
|
}
|
|
}
|
|
|