/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.Array
* javax.baja.nre.util.SortUtil
*/
package com.tridium.sys.registry;
import com.tridium.sys.Nre;
import com.tridium.sys.registry.NAdapterInfo;
import com.tridium.sys.registry.NModuleInfo;
import com.tridium.sys.registry.NTypeInfo;
import java.io.File;
import java.io.StringWriter;
import javax.baja.agent.AgentInfo;
import javax.baja.io.HtmlWriter;
import javax.baja.log.Log;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.SortUtil;
import javax.baja.registry.ModuleInfo;
import javax.baja.registry.RegistryException;
import javax.baja.registry.TypeInfo;
import javax.baja.spy.Spy;
import javax.baja.spy.SpyDir;
import javax.baja.spy.SpyWriter;
import javax.baja.sys.BAbsTime;
import javax.baja.sys.Sys;
public class Debug {
public static final Log log = Log.getLog("sys.registry");
private File root;
public File modulesFile() {
return new File(this.root, "modules.xml");
}
public File moduleDir(String string) {
return new File(this.root, string);
}
public static class AdaptersPage
extends Spy {
public void write(SpyWriter spyWriter) throws Exception {
String string = "../";
NAdapterInfo[] nAdapterInfoArray = Nre.registryManager.db().adapters;
spyWriter.startTable(true);
spyWriter.trTitle("Installed Adapters", 3);
spyWriter.w("
").th("Type").th("From").th("To").w("
\n");
int n = 0;
while (n < nAdapterInfoArray.length) {
NAdapterInfo nAdapterInfo = nAdapterInfoArray[n];
spyWriter.w("").td("" + nAdapterInfo.type + "").td("" + nAdapterInfo.from + "").td("" + nAdapterInfo.to + "").w("
\n");
++n;
}
spyWriter.endTable();
}
}
public static class OrdSchemesPage
extends Spy {
public void write(SpyWriter spyWriter) throws Exception {
String string = "../";
String[] stringArray = Sys.getRegistry().getOrdSchemes();
spyWriter.startTable(true);
spyWriter.trTitle("Installed Ord Schemes", 2);
int n = 0;
while (n < stringArray.length) {
TypeInfo typeInfo = Sys.getRegistry().getOrdScheme(stringArray[n]);
spyWriter.w("").td(stringArray[n]).td("" + typeInfo + "").w("
\n");
++n;
}
spyWriter.endTable();
}
}
public static class FileExtsPage
extends Spy {
public void write(SpyWriter spyWriter) throws Exception {
String string = "../";
String[] stringArray = Sys.getRegistry().getFileExtensions();
spyWriter.startTable(true);
spyWriter.trTitle("Installed File Extensions", 2);
int n = 0;
while (n < stringArray.length) {
TypeInfo typeInfo = Sys.getRegistry().getFileTypeForExtension(stringArray[n]);
spyWriter.w("").td(stringArray[n]).td("" + typeInfo + "").w("
\n");
++n;
}
spyWriter.endTable();
}
}
public static class DefsPage
extends Spy {
public void write(SpyWriter spyWriter) throws Exception {
Object[] objectArray = Sys.getRegistry().getDefs();
SortUtil.sort((Object[])objectArray, (Object[])objectArray);
spyWriter.startTable(true);
spyWriter.trTitle("Defs [" + objectArray.length + ']', 2);
int n = 0;
while (n < objectArray.length) {
Object object = objectArray[n];
String string = Sys.getRegistry().getDef((String)object);
spyWriter.tr(object, string);
++n;
}
spyWriter.endTable();
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public static class TypePage
extends Spy {
String typeSpec;
static /* synthetic */ Class class$javax$baja$registry$TypeInfo;
public void write(SpyWriter spyWriter) throws Exception {
NTypeInfo[] nTypeInfoArray;
NTypeInfo[] nTypeInfoArray2;
NTypeInfo nTypeInfo = (NTypeInfo)Sys.getRegistry().getType(this.typeSpec);
String string = "../";
spyWriter.startTable(true);
StringWriter stringWriter = new StringWriter();
new HtmlWriter(stringWriter).w("Type ").a("../../modules/" + nTypeInfo.getModuleName(), nTypeInfo.getModuleName()).w(":").w(nTypeInfo.getTypeName());
spyWriter.trTitle(stringWriter, 2);
spyWriter.w("").td("isAbstract").td("" + nTypeInfo.isAbstract()).w("
\n");
spyWriter.w("").td("isInterface").td("" + nTypeInfo.isInterface()).w("
\n");
spyWriter.w("").td("superType").td(this.typeref(string, nTypeInfo.getSuperType())).w("
\n");
TypeInfo[] typeInfoArray = nTypeInfo.getInterfaces();
if (typeInfoArray.length > 0) {
spyWriter.trTitle("Interfaces", 2);
int n = 0;
while (n < typeInfoArray.length) {
spyWriter.w("| ").w(this.typeref(string, typeInfoArray[n])).w(" |
\n");
++n;
}
}
if ((nTypeInfoArray2 = nTypeInfo.agents).length > 0) {
spyWriter.trTitle("Agents", 2);
int n = 0;
while (n < nTypeInfoArray2.length) {
spyWriter.w("| ").w(this.typeref(string, nTypeInfoArray2[n])).w(" |
\n");
++n;
}
}
if ((nTypeInfoArray = nTypeInfo.agentOn).length > 0) {
spyWriter.trTitle("Agent On", 2);
int n = 0;
while (n < nTypeInfoArray.length) {
spyWriter.w("| ").w(this.typeref(string, nTypeInfoArray[n])).w(" |
\n");
++n;
}
}
NTypeInfo[] nTypeInfoArray3 = nTypeInfo.is;
spyWriter.trTitle("Is Types", 2);
int n = 0;
while (n < nTypeInfoArray3.length) {
spyWriter.w("| ").w(this.typeref(string, nTypeInfoArray3[n])).w(" |
\n");
++n;
}
TypeInfo[] typeInfoArray2 = Sys.getRegistry().getTypes(nTypeInfo);
Class clazz = class$javax$baja$registry$TypeInfo;
if (clazz == null) {
clazz = class$javax$baja$registry$TypeInfo = TypePage.class("[Ljavax.baja.registry.TypeInfo;", false);
}
Array array = new Array(clazz);
int n2 = 0;
while (n2 < typeInfoArray2.length) {
if (nTypeInfo.isInterface()) {
if (new Array((Object[])typeInfoArray2[n2].getInterfaces()).indexOf((Object)nTypeInfo) != -1) {
array.add((Object)typeInfoArray2[n2]);
}
} else {
TypeInfo typeInfo = typeInfoArray2[n2].getSuperType();
if (typeInfo != null && typeInfo.equals(nTypeInfo)) {
array.add((Object)typeInfoArray2[n2]);
}
}
++n2;
}
if (array.size() > 0) {
typeInfoArray2 = (TypeInfo[])array.trim();
spyWriter.trTitle("Sub Types", 2);
n2 = 0;
while (n2 < typeInfoArray2.length) {
spyWriter.w("| ").w(this.typeref(string, typeInfoArray2[n2])).w(" |
\n");
++n2;
}
}
try {
AgentInfo agentInfo = nTypeInfo.getAgentInfo();
spyWriter.trTitle("AgentInfo", 2);
spyWriter.w("").td("requiredPermissions").td(agentInfo.getRequiredPermissions()).w("
\n");
spyWriter.w("").td("appName").td(agentInfo.getAppName()).w("
\n");
}
catch (RegistryException registryException) {}
spyWriter.endTable();
}
private final String typeref(String string, TypeInfo typeInfo) {
if (typeInfo == null) {
return "null";
}
return "" + typeInfo.toString() + "";
}
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());
}
}
TypePage(String string) {
this.typeSpec = string;
}
}
public static class TypesPage
extends SpyDir {
public Spy find(String string) {
return new TypePage(string);
}
public void write(SpyWriter spyWriter) throws Exception {
Object[] objectArray = Sys.getRegistry().getTypes();
SortUtil.sort((Object[])objectArray);
spyWriter.startTable(true);
spyWriter.trTitle("Installed Types", 1);
int n = 0;
while (n < objectArray.length) {
Object object = objectArray[n];
spyWriter.w("").td("" + object + "").w("
\n");
++n;
}
spyWriter.endTable();
}
}
public static class ModulePage
extends Spy {
String name;
public void write(SpyWriter spyWriter) throws Exception {
Object[] objectArray = Sys.getRegistry().getModule(this.name).getTypes();
SortUtil.sort((Object[])objectArray);
spyWriter.startTable(true);
spyWriter.trTitle("Module \"" + this.name + '\"', 1);
int n = 0;
while (n < objectArray.length) {
NTypeInfo nTypeInfo = (NTypeInfo)objectArray[n];
spyWriter.w("").td("" + nTypeInfo + "").w("
\n");
++n;
}
spyWriter.endTable();
}
ModulePage(String string) {
this.name = string;
}
}
public static class ModulesPage
extends SpyDir {
public Spy find(String string) {
return new ModulePage(string);
}
public void write(SpyWriter spyWriter) throws Exception {
ModuleInfo[] moduleInfoArray = Sys.getRegistry().getModules();
spyWriter.startTable(true);
spyWriter.trTitle("Installed Modules", 8);
int n = 0;
while (n < moduleInfoArray.length) {
NModuleInfo nModuleInfo = (NModuleInfo)moduleInfoArray[n];
spyWriter.w("").td("" + nModuleInfo.getModuleName() + "").td(nModuleInfo.getBajaVersion()).td(nModuleInfo.getVendor()).td(nModuleInfo.getVendorVersion()).td(nModuleInfo.getDescription()).td(BAbsTime.make(nModuleInfo.getBuildTime())).td(nModuleInfo.hasPalette() ? "palette" : "no palette").td(nModuleInfo.isAutoload() ? "autoload" : "non-autoload").td(nModuleInfo.isReloadable() ? "reloadable" : "non-reloadable").w("
\n");
++n;
}
spyWriter.endTable();
}
}
public static class SummaryPage
extends SpyDir {
public void write(SpyWriter spyWriter) throws Exception {
spyWriter.startTable(true);
spyWriter.trTitle("Registry", 1);
spyWriter.w("").td("Installed Modules").w("
");
spyWriter.w("").td("Installed Types").w("
");
spyWriter.w("").td("Registry Definitions").w("
");
spyWriter.w("").td("Installed File Extensions").w("
");
spyWriter.w("").td("Installed Ord Schemes").w("
");
spyWriter.w("").td("Installed Adapters").w("
");
spyWriter.endTable();
}
SummaryPage() {
this.add("modules", new ModulesPage());
this.add("types", new TypesPage());
this.add("defs", new DefsPage());
this.add("fileExts", new FileExtsPage());
this.add("ordSchemes", new OrdSchemesPage());
this.add("adapters", new AdaptersPage());
}
}
}