/* * Decompiled with CFR 0.152. */ package javax.baja.naming; import javax.baja.naming.BOrdScheme; import javax.baja.naming.InvalidOrdBaseException; import javax.baja.naming.OrdQuery; import javax.baja.naming.OrdTarget; import javax.baja.naming.SlotPath; import javax.baja.naming.SyntaxException; import javax.baja.naming.UnresolvedException; import javax.baja.space.BComponentSpace; import javax.baja.sys.BComplex; import javax.baja.sys.BComponent; import javax.baja.sys.BIPropertyContainer; import javax.baja.sys.BObject; import javax.baja.sys.BValue; import javax.baja.sys.Property; import javax.baja.sys.Slot; import javax.baja.sys.Sys; import javax.baja.sys.Type; import javax.baja.virtual.BVirtualGateway; import javax.baja.virtual.VirtualPath; /* * Illegal identifiers - consider using --renameillegalidents true */ public class BSlotScheme extends BOrdScheme { public static final BSlotScheme INSTANCE = new BSlotScheme(); public static final Type TYPE; static /* synthetic */ Class class$javax$baja$naming$BSlotScheme; public OrdQuery parse(String string) { return new SlotPath(this.getId(), string); } public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException { BObject bObject; BObject bObject2 = ordTarget.get(); BIPropertyContainer bIPropertyContainer = null; SlotPath slotPath = (SlotPath)ordQuery; boolean bl = slotPath instanceof VirtualPath; BComponentSpace bComponentSpace = null; if (bObject2 instanceof BVirtualGateway && bl) { bComponentSpace = ((BVirtualGateway)bObject2).getVirtualSpace(); bIPropertyContainer = bComponentSpace.getRootComponent(); } else if (bObject2 instanceof BComponentSpace) { bComponentSpace = (BComponentSpace)bObject2; bIPropertyContainer = bComponentSpace.getRootComponent(); } else if (bObject2 instanceof BComponent) { bObject = bObject2.asComponent(); bComponentSpace = ((BComponent)bObject).getComponentSpace(); if (slotPath.isAbsolute()) { bObject = bComponentSpace.getRootComponent(); } bIPropertyContainer = bObject; } else if (bObject2 instanceof BIPropertyContainer) { bIPropertyContainer = (BIPropertyContainer)((Object)bObject2); } if (bl && slotPath.getBody().equals("")) { return new OrdTarget(ordTarget, bComponentSpace); } bObject = (BObject)((Object)bIPropertyContainer); if (bObject == null) { if (!(bObject2 instanceof BValue)) { throw new InvalidOrdBaseException("" + bObject2); } bObject = bObject2; } BIPropertyContainer bIPropertyContainer2 = bIPropertyContainer; Slot slot = null; int n = slotPath.depth(); Property[] propertyArray = null; int n2 = 0; int n3 = slotPath.getBackupDepth(); int n4 = 0; while (n4 < n3) { bObject = (BObject)((Object)(bIPropertyContainer2 = bIPropertyContainer2 instanceof BComponent ? (BComponent)((BComplex)((Object)bIPropertyContainer2)).getParent() : null)); if (bObject == null) { throw new UnresolvedException("Cannot walk backup depth" + bObject2); } ++n4; } n4 = 0; while (n4 < n) { String string = slotPath.nameAt(n4); if (bl) { string = SlotPath.escape(string); } boolean bl2 = true; if (bComponentSpace != null && bObject.isComponent()) { slot = bComponentSpace.getLoadCallbacks().loadSlot(bObject.asComponent(), string); boolean bl3 = false; if (slot == null) { bl3 = true; } bl2 = bl3; } boolean bl4 = bObject instanceof BIPropertyContainer; if (bl2) { if (bl4) { ((BIPropertyContainer)((Object)bObject)).loadSlots(); slot = ((BIPropertyContainer)((Object)bObject)).getSlot(string); } else { bObject.asComplex().loadSlots(); slot = bObject.asComplex().getSlot(string); } } if (slot == null) { throw new UnresolvedException(slotPath.getBody()); } if (!(slot instanceof Property)) { if (n4 != n - 1) { throw new UnresolvedException(slotPath.getBody()); } return new OrdTarget(ordTarget, bIPropertyContainer2, null, slot, null); } Property property = (Property)slot; BObject bObject3 = bObject = bl4 ? ((BIPropertyContainer)((Object)bObject)).get(property) : bObject.asComplex().get(property); if (n2 == 0 && bObject instanceof BIPropertyContainer) { bIPropertyContainer2 = (BIPropertyContainer)((Object)bObject); } else { if (propertyArray == null) { propertyArray = new Property[32]; } propertyArray[n2++] = property; } ++n4; } if (n2 == 0) { return new OrdTarget(ordTarget, (BObject)((Object)bIPropertyContainer2)); } slot = propertyArray[0]; Property[] propertyArray2 = new Property[n2]; System.arraycopy(propertyArray, 0, propertyArray2, 0, n2); return new OrdTarget(ordTarget, bIPropertyContainer2, bObject, slot, propertyArray2); } public Type getType() { return TYPE; } 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 BSlotScheme() { super("slot"); } protected BSlotScheme(String string) { super(string); } static { Class clazz = class$javax$baja$naming$BSlotScheme; if (clazz == null) { clazz = class$javax$baja$naming$BSlotScheme = BSlotScheme.class("[Ljavax.baja.naming.BSlotScheme;", false); } TYPE = Sys.loadType(clazz); } }