333 lines
10 KiB
Java
333 lines
10 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.naming.SlotPath
|
|
* javax.baja.nre.util.Array
|
|
* javax.baja.sys.Action
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BObject
|
|
* javax.baja.sys.BValue
|
|
* javax.baja.sys.BVector
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Cursor
|
|
* javax.baja.sys.Property
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
*/
|
|
package com.tridium.install;
|
|
|
|
import com.tridium.install.BDependency;
|
|
import com.tridium.install.installable.BInstallable;
|
|
import com.tridium.install.installable.BModuleInstallable;
|
|
import com.tridium.install.installable.ClosableCursor;
|
|
import com.tridium.install.installable.CursorUtil;
|
|
import com.tridium.install.installable.InstallableRegistry;
|
|
import com.tridium.install.part.BModulePart;
|
|
import com.tridium.install.part.BPart;
|
|
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
|
import java.util.HashMap;
|
|
import javax.baja.naming.SlotPath;
|
|
import javax.baja.nre.util.Array;
|
|
import javax.baja.sys.Action;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.BValue;
|
|
import javax.baja.sys.BVector;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Cursor;
|
|
import javax.baja.sys.Property;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BModuleList
|
|
extends BComponent
|
|
implements InstallableRegistry {
|
|
public static final Property modules = BModuleList.newProperty((int)1, (BValue)new BVector(), null);
|
|
public static final Action init = BModuleList.newAction((int)4, null);
|
|
public static final Type TYPE;
|
|
private HashMap dependentModuleNames;
|
|
private boolean isLocalInstance;
|
|
static /* synthetic */ Class class$com$tridium$install$BModuleList;
|
|
static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable;
|
|
|
|
public BVector getModules() {
|
|
return (BVector)this.get(modules);
|
|
}
|
|
|
|
public void setModules(BVector bVector) {
|
|
this.set(modules, (BValue)bVector, null);
|
|
}
|
|
|
|
public void init() {
|
|
this.invoke(init, null, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public final synchronized void load() {
|
|
this.load(null);
|
|
}
|
|
|
|
public final synchronized void load(DaemonSessionTaskListener daemonSessionTaskListener) {
|
|
this.checkLocalInstance();
|
|
this.doReload(daemonSessionTaskListener);
|
|
}
|
|
|
|
public final synchronized void reload() {
|
|
this.reload(null);
|
|
}
|
|
|
|
public final synchronized void reload(DaemonSessionTaskListener daemonSessionTaskListener) {
|
|
this.reset();
|
|
this.init(daemonSessionTaskListener);
|
|
this.doReload(daemonSessionTaskListener);
|
|
}
|
|
|
|
public synchronized void reset() {
|
|
this.checkLocalInstance();
|
|
this.dependentModuleNames = null;
|
|
}
|
|
|
|
protected synchronized void doReload(DaemonSessionTaskListener daemonSessionTaskListener) {
|
|
}
|
|
|
|
public BPart getPart(String string) {
|
|
BModuleInstallable bModuleInstallable = this.getModuleInstallable(string);
|
|
return bModuleInstallable == null ? null : bModuleInstallable.getModulePart();
|
|
}
|
|
|
|
public BModuleInstallable getModuleInstallable(String string) {
|
|
return (BModuleInstallable)this.getModules().get(SlotPath.escape((String)string));
|
|
}
|
|
|
|
public Array getDependentModuleNames(String string) {
|
|
Array array;
|
|
if (this.dependentModuleNames == null) {
|
|
this.dependentModuleNames = new HashMap();
|
|
array = this.getModules().getProperties();
|
|
while (array.next()) {
|
|
BModulePart bModulePart = ((BModuleInstallable)array.get()).getModulePart();
|
|
BDependency[] bDependencyArray = bModulePart.getDependencyArray();
|
|
int n = 0;
|
|
while (n < bDependencyArray.length) {
|
|
String string2 = bDependencyArray[n].getPartName();
|
|
Array array2 = (Array)this.dependentModuleNames.get(string2);
|
|
if (array2 == null) {
|
|
array2 = new Array();
|
|
this.dependentModuleNames.put(string2, array2);
|
|
}
|
|
array2.add((Object)bModulePart.getPartName());
|
|
++n;
|
|
}
|
|
}
|
|
}
|
|
return (array = (Array)this.dependentModuleNames.get(string)) == null ? new Array() : array;
|
|
}
|
|
|
|
public boolean meets(BDependency bDependency) {
|
|
BPart bPart = this.getPart(bDependency.getPartName());
|
|
if (bPart == null) {
|
|
return false;
|
|
}
|
|
return bPart.meets(bDependency);
|
|
}
|
|
|
|
public BInstallable[] findInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
|
BInstallable bInstallable = this.findInstallable(bDependency, daemonSessionTaskListener);
|
|
if (bInstallable == null) {
|
|
return new BInstallable[0];
|
|
}
|
|
return new BInstallable[]{bInstallable};
|
|
}
|
|
|
|
/*
|
|
* Unable to fully structure code
|
|
*/
|
|
public BInstallable findInstallable(BDependency var1_1, DaemonSessionTaskListener var2_2) throws Exception {
|
|
this.init(var2_2);
|
|
var3_3 = this.getModules().getProperties();
|
|
if (true) ** GOTO lbl7
|
|
do {
|
|
if ((var4_4 = (BModuleInstallable)var3_3.get()).meets(var1_1)) {
|
|
return var4_4;
|
|
}
|
|
lbl7:
|
|
// 3 sources
|
|
|
|
if ((v0 = BModuleList.class$com$tridium$install$installable$BModuleInstallable) != null) continue;
|
|
v0 = BModuleList.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
|
|
} while (var3_3.next(v0));
|
|
return null;
|
|
}
|
|
|
|
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener) {
|
|
this.init();
|
|
return CursorUtil.closable((Cursor)this.getModules().getProperties());
|
|
}
|
|
|
|
public ClosableCursor getInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
|
BInstallable bInstallable = this.findInstallable(bDependency, daemonSessionTaskListener);
|
|
if (bInstallable == null) {
|
|
return new ClosableCursor(){
|
|
|
|
public final void close() {
|
|
}
|
|
|
|
public final BObject get() {
|
|
throw new IllegalStateException();
|
|
}
|
|
|
|
public final Context getContext() {
|
|
return null;
|
|
}
|
|
|
|
public final boolean next() {
|
|
return false;
|
|
}
|
|
|
|
public final boolean next(Class clazz) {
|
|
return false;
|
|
}
|
|
|
|
public final boolean nextComponent() {
|
|
return false;
|
|
}
|
|
};
|
|
}
|
|
return new ItemCursor((BObject)bInstallable);
|
|
}
|
|
|
|
public final void init(DaemonSessionTaskListener daemonSessionTaskListener) {
|
|
this.doInit(daemonSessionTaskListener);
|
|
}
|
|
|
|
public final void doInit() {
|
|
this.doInit(null);
|
|
}
|
|
|
|
public synchronized void doInit(DaemonSessionTaskListener daemonSessionTaskListener) {
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
|
|
protected void setLocalInstance(boolean bl) {
|
|
this.isLocalInstance = bl;
|
|
}
|
|
|
|
protected boolean isLocalInstance() {
|
|
return this.isLocalInstance;
|
|
}
|
|
|
|
protected void checkLocalInstance() {
|
|
if (!this.isLocalInstance()) {
|
|
throw new IllegalStateException("operation not supported on remote BModuleList");
|
|
}
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.dependentModuleNames = null;
|
|
}
|
|
|
|
public BModuleList() {
|
|
this.this();
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$install$BModuleList;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$install$BModuleList = BModuleList.class("[Lcom.tridium.install.BModuleList;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public static class ItemCursor
|
|
implements ClosableCursor {
|
|
private BObject item;
|
|
private int index;
|
|
static /* synthetic */ Class class$javax$baja$sys$BComponent;
|
|
|
|
public void close() {
|
|
}
|
|
|
|
public BObject get() {
|
|
if (this.index == 0) {
|
|
return this.item;
|
|
}
|
|
throw new IllegalStateException();
|
|
}
|
|
|
|
public Context getContext() {
|
|
return null;
|
|
}
|
|
|
|
public boolean next() {
|
|
if (this.index < 0) {
|
|
++this.index;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public boolean next(Class clazz) {
|
|
boolean bl = this.next();
|
|
while (bl && !clazz.isAssignableFrom(this.get().getClass())) {
|
|
bl = this.next();
|
|
}
|
|
return bl;
|
|
}
|
|
|
|
public boolean nextComponent() {
|
|
Class clazz = class$javax$baja$sys$BComponent;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$sys$BComponent = ItemCursor.class("[Ljavax.baja.sys.BComponent;", false);
|
|
}
|
|
return this.next(clazz);
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.index = -1;
|
|
}
|
|
|
|
public ItemCursor(BObject bObject) {
|
|
this.this();
|
|
this.item = bObject;
|
|
this.index = -1;
|
|
}
|
|
}
|
|
}
|
|
|