147 lines
4.6 KiB
Java
147 lines
4.6 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BIcon
|
|
* javax.baja.sys.BValue
|
|
* javax.baja.sys.SlotCursor
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
*/
|
|
package com.tridium.fox.sys;
|
|
|
|
import com.tridium.fox.session.FoxSession;
|
|
import com.tridium.fox.sys.BFoxChannel;
|
|
import com.tridium.fox.sys.BFoxConnection;
|
|
import com.tridium.fox.sys.BSysChannel;
|
|
import com.tridium.fox.sys.data.BDataChannel;
|
|
import com.tridium.fox.sys.file.BFileChannel;
|
|
import com.tridium.fox.sys.spy.BSpyChannel;
|
|
import com.tridium.fox.sys.user.BUserChannel;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BIcon;
|
|
import javax.baja.sys.BValue;
|
|
import javax.baja.sys.SlotCursor;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BFoxChannelRegistry
|
|
extends BComponent {
|
|
public static final Type TYPE;
|
|
private static BFoxChannelRegistry prototype;
|
|
private static final BIcon icon;
|
|
static /* synthetic */ Class class$com$tridium$fox$sys$BFoxChannelRegistry;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public final BSysChannel getSysChannel() {
|
|
return (BSysChannel)this.get("sys");
|
|
}
|
|
|
|
public final BFileChannel getFileChannel() {
|
|
return (BFileChannel)this.get("file");
|
|
}
|
|
|
|
public final BUserChannel getUserChannel() {
|
|
return (BUserChannel)this.get("user");
|
|
}
|
|
|
|
public final BFoxChannel get(String string, Type type) {
|
|
BFoxChannel bFoxChannel = (BFoxChannel)this.get(string);
|
|
if (bFoxChannel != null) {
|
|
if (bFoxChannel.getType() != type) {
|
|
throw new ClassCastException("Type mismatch: " + bFoxChannel.getType() + " != " + type);
|
|
}
|
|
} else {
|
|
bFoxChannel = (BFoxChannel)type.getInstance();
|
|
this.add(string, (BValue)bFoxChannel, 2);
|
|
if (((BFoxConnection)this.getParent()).isConnected()) {
|
|
this.sessionOpened(bFoxChannel);
|
|
}
|
|
}
|
|
return bFoxChannel;
|
|
}
|
|
|
|
public static BFoxChannelRegistry getPrototype() {
|
|
return prototype;
|
|
}
|
|
|
|
public void sessionOpened() {
|
|
SlotCursor slotCursor = this.getProperties();
|
|
while (slotCursor.nextComponent()) {
|
|
this.sessionOpened((BFoxChannel)slotCursor.get());
|
|
}
|
|
}
|
|
|
|
public void sessionClosed(Throwable throwable) {
|
|
SlotCursor slotCursor = this.getProperties();
|
|
while (slotCursor.nextComponent()) {
|
|
this.sessionClosed((BFoxChannel)slotCursor.get(), throwable);
|
|
}
|
|
}
|
|
|
|
private final void sessionOpened(BFoxChannel bFoxChannel) {
|
|
try {
|
|
FoxSession foxSession = ((BFoxConnection)this.getParent()).session();
|
|
bFoxChannel.log.setSession(foxSession);
|
|
bFoxChannel.sessionOpened();
|
|
}
|
|
catch (Throwable throwable) {
|
|
throwable.printStackTrace();
|
|
}
|
|
}
|
|
|
|
private final void sessionClosed(BFoxChannel bFoxChannel, Throwable throwable) {
|
|
try {
|
|
bFoxChannel.sessionClosed(throwable);
|
|
}
|
|
catch (Throwable throwable2) {
|
|
throwable2.printStackTrace();
|
|
}
|
|
bFoxChannel.log.setSession(null);
|
|
}
|
|
|
|
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$com$tridium$fox$sys$BFoxChannelRegistry;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$fox$sys$BFoxChannelRegistry = BFoxChannelRegistry.class("[Lcom.tridium.fox.sys.BFoxChannelRegistry;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
prototype = new BFoxChannelRegistry();
|
|
prototype.add("data", (BValue)new BDataChannel());
|
|
prototype.add("file", (BValue)new BFileChannel());
|
|
prototype.add("spy", (BValue)new BSpyChannel());
|
|
prototype.add("sys", (BValue)new BSysChannel());
|
|
prototype.add("user", (BValue)new BUserChannel());
|
|
try {
|
|
prototype.add("alarmui", (BValue)((BFoxChannel)((Object)Sys.newInstance((String)"alarm", (String)"com.tridium.alarm.BAlarmConsoleChannel"))));
|
|
}
|
|
catch (Throwable throwable) {}
|
|
icon = BIcon.std((String)"book.png");
|
|
}
|
|
}
|
|
|