/* * Decompiled with CFR 0.152. */ package com.tridium.space; import com.tridium.space.BIGatewaySpace; import javax.baja.naming.BOrd; import javax.baja.nav.BINavNode; import javax.baja.space.BSpace; import javax.baja.sys.BComponent; import javax.baja.sys.Sys; import javax.baja.sys.Type; /* * Illegal identifiers - consider using --renameillegalidents true */ public abstract class BGateway extends BComponent { public static final Type TYPE; private BSpace space; static /* synthetic */ Class class$com$tridium$space$BGateway; public Type getType() { return TYPE; } public final BSpace getGatewaySpace() { return this.space; } public final BOrd getGatewaySchemeOrd() { return BOrd.make(this.getGatewaySchemeId() + ':'); } public abstract String getGatewaySchemeId(); protected abstract BSpace makeGatewaySpace(); protected void startGatewaySpace() { } protected void stopGatewaySpace() { } public BOrd getNavOrd() { BOrd bOrd = super.getNavOrd(); if (bOrd != null) { bOrd = BOrd.make(bOrd, this.getGatewaySchemeOrd()); } return bOrd; } public boolean hasNavChildren() { return true; } public BINavNode getNavChild(String string) { if (this.space == null || !string.equals(this.getGatewaySchemeId())) { return super.getNavChild(string); } return this.space; } public BINavNode resolveNavChild(String string) { if (this.space == null || !string.equals(this.getGatewaySchemeId())) { return super.resolveNavChild(string); } return this.space; } public BINavNode[] getNavChildren() { if (this.space == null) { return super.getNavChildren(); } return new BINavNode[]{this.space}; } public Object fw(int n, Object object, Object object2, Object object3, Object object4) { switch (n) { case 11: { this.fwStarted(); break; } case 12: { this.fwStopped(); break; } case 108: { this.fwSetSpace((BSpace)object); break; } } return super.fw(n, object, object2, object3, object4); } private final void fwStarted() { BSpace bSpace = this.makeGatewaySpace(); if (!(bSpace instanceof BIGatewaySpace)) { throw new IllegalStateException("makeGatewaySpace() must return a BIGatewaySpace"); } this.fwSetSpace(bSpace); this.startGatewaySpace(); } /* * WARNING - Removed back jump from a try to a catch block - possible behaviour change. * Enabled aggressive block sorting * Enabled unnecessary exception pruning * Enabled aggressive exception aggregation */ private final void fwStopped() { if (this.space == null) return; try { this.stopGatewaySpace(); } catch (Throwable throwable) { Object var2_2 = null; this.space = null; throw throwable; } { Object var2_3 = null; this.space = null; return; } } private final void fwSetSpace(BSpace bSpace) { this.space = bSpace; } 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$space$BGateway; if (clazz == null) { clazz = class$com$tridium$space$BGateway = BGateway.class("[Lcom.tridium.space.BGateway;", false); } TYPE = Sys.loadType(clazz); } }