2026-03-17 13:31:18 -07:00

257 lines
7.9 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.schema.ComponentSlotMap
* javax.baja.naming.BHost
* javax.baja.naming.BISession
* javax.baja.naming.BOrd
* javax.baja.nav.BINavNode
* javax.baja.nre.util.Array
* javax.baja.sys.BComponent
* javax.baja.sys.BValue
* javax.baja.sys.Context
* javax.baja.sys.Property
* javax.baja.sys.Slot
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.LexiconText
* javax.baja.virtual.BVirtualComponent
* javax.baja.virtual.BVirtualGateway
*/
package com.tridium.fox.sys.broker;
import com.tridium.fox.sys.BFoxSession;
import com.tridium.fox.sys.broker.BFoxComponentSpace;
import com.tridium.sys.schema.ComponentSlotMap;
import java.util.HashMap;
import javax.baja.naming.BHost;
import javax.baja.naming.BISession;
import javax.baja.naming.BOrd;
import javax.baja.nav.BINavNode;
import javax.baja.nre.util.Array;
import javax.baja.sys.BComponent;
import javax.baja.sys.BValue;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Slot;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.LexiconText;
import javax.baja.virtual.BVirtualComponent;
import javax.baja.virtual.BVirtualGateway;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BFoxVirtualSpace
extends BFoxComponentSpace {
public static final Type TYPE;
BVirtualGateway gateway;
static /* synthetic */ Class class$com$tridium$fox$sys$broker$BFoxVirtualSpace;
static /* synthetic */ Class class$java$lang$String;
public Type getType() {
return TYPE;
}
public BVirtualGateway getVirtualGateway() {
return this.gateway;
}
public BFoxSession getFoxSession() {
return ((BFoxComponentSpace)this.gateway.getSpace()).channel.getFoxSession();
}
public BComponent getRootComponent() {
BComponent bComponent = super.getRootComponent();
if (bComponent == null) {
try {
BFoxSession bFoxSession = this.getFoxSession();
this.init(bFoxSession);
}
catch (Exception exception) {
exception.printStackTrace();
}
}
return super.getRootComponent();
}
public void childUnparented(BComponent bComponent, Property property, BValue bValue, Context context) {
super.childUnparented(bComponent, property, bValue, context);
if (bComponent instanceof BVirtualComponent) {
((ComponentSlotMap)bComponent.fw(1)).setBrokerPropsLoaded(false);
}
}
public BHost getHost() {
return this.gateway.getSpace().getHost();
}
public BISession getSession() {
return this.gateway.getSpace().getSession();
}
public BOrd getOrdInSession() {
return BOrd.make((BOrd)this.gateway.getOrdInSession(), (String)"virtual:");
}
public BOrd getAbsoluteOrd() {
return BOrd.make((BOrd)this.gateway.getAbsoluteOrd(), (String)"virtual:");
}
public BOrd getOrdInHost() {
return BOrd.make((BOrd)this.gateway.getOrdInHost(), (String)"virtual:");
}
public final BOrd getNavOrd() {
return this.gateway.getNavOrd();
}
public final BINavNode getNavParent() {
return this.gateway;
}
public boolean hasNavChildren() {
return true;
}
public BINavNode getNavChild(String string) {
this.getRootComponent();
return super.getNavChild(string);
}
public BINavNode resolveNavChild(String string) {
this.getRootComponent();
return super.resolveNavChild(string);
}
public BINavNode[] getNavChildren() {
this.getRootComponent();
return super.getNavChildren();
}
public Object fw(int n, Object object, Object object2, Object object3, Object object4) {
if (n == 110) {
this.touch((BOrd[])object);
}
return super.fw(n, object, object2, object3, object4);
}
void touch(BOrd[] bOrdArray) {
try {
Class clazz = class$java$lang$String;
if (clazz == null) {
clazz = class$java$lang$String = BFoxVirtualSpace.class("[Ljava.lang.String;", false);
}
Array array = new Array(clazz);
HashMap<String, String> hashMap = new HashMap<String, String>();
int n = 0;
while (n < bOrdArray.length) {
String string = bOrdArray[n].encodeToString();
if (hashMap.get(string) == null) {
hashMap.put(string, string);
array.add((Object)string);
}
++n;
}
if (array.size() == 0) {
return;
}
this.channel().touch((String[])array.trim());
}
catch (Throwable throwable) {
log.error("touch(): " + throwable);
throw BFoxSession.toException(throwable);
}
}
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 BFoxVirtualSpace(BVirtualGateway bVirtualGateway) {
super("virtual", LexiconText.make((String)"baja", (String)"nav.virtual"), BOrd.make((String)"virtual:"));
this.setLoadCallbacks(new FoxVirtualLoadCallbacks());
this.setSubscribeCallbacks(new FoxVirtualSubscribeCallbacks());
this.gateway = bVirtualGateway;
}
public BFoxVirtualSpace() {
this(null);
}
static {
Class clazz = class$com$tridium$fox$sys$broker$BFoxVirtualSpace;
if (clazz == null) {
clazz = class$com$tridium$fox$sys$broker$BFoxVirtualSpace = BFoxVirtualSpace.class("[Lcom.tridium.fox.sys.broker.BFoxVirtualSpace;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
class FoxVirtualLoadCallbacks
extends BFoxComponentSpace.FoxLoadCallbacks {
/*
* Enabled force condition propagation
* Lifted jumps to return sites
*/
public Slot loadSlot(BComponent bComponent, String string) {
block7: {
Slot slot = bComponent.getSlot(string);
if (slot == null) break block7;
if (!slot.isProperty()) return slot;
BValue bValue = bComponent.get(slot.asProperty());
if (!bValue.isComponent()) return slot;
if (bValue.asComponent().getComponentSpace() != null) {
return slot;
}
try {
}
catch (Throwable throwable) {}
}
try {
return BFoxVirtualSpace.this.channel().loadSlot(bComponent, string, 0);
}
catch (Throwable throwable) {
log.error("loadSlot(" + bComponent.toPathString() + ", " + string + "): " + throwable);
throw BFoxSession.toException(throwable);
}
}
FoxVirtualLoadCallbacks() {
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
class FoxVirtualSubscribeCallbacks
extends BFoxComponentSpace.FoxSubscribeCallbacks {
public void update(BComponent bComponent, int n) {
try {
BFoxVirtualSpace.this.channel().load(bComponent, n, true);
}
catch (Throwable throwable) {
log.error("update(" + bComponent.toPathString() + "): " + throwable);
throw BFoxSession.toException(throwable);
}
}
FoxVirtualSubscribeCallbacks() {
}
}
}