/* * Decompiled with CFR 0.152. * * Could not load the following classes: * javax.baja.nre.util.TextUtil */ package javax.baja.naming; import javax.baja.naming.BHost; import javax.baja.naming.BISession; import javax.baja.naming.BIpHost; import javax.baja.naming.BLocalScheme; import javax.baja.naming.BOrd; import javax.baja.naming.BServiceScheme; import javax.baja.nav.BNavRoot; import javax.baja.nre.util.TextUtil; import javax.baja.sys.BComponent; import javax.baja.sys.BIcon; import javax.baja.sys.Context; import javax.baja.sys.ModuleNotFoundException; import javax.baja.sys.Sys; import javax.baja.sys.Type; import javax.baja.util.LexiconText; import javax.baja.util.Version; /* * Illegal identifiers - consider using --renameillegalidents true */ public class BLocalHost extends BIpHost implements BISession, BServiceScheme.ServiceSession { static final BIcon icon = BIcon.std("localhost.png"); public static final Type TYPE; public static final BLocalHost INSTANCE; private String navNameSuffix; static /* synthetic */ Class class$javax$baja$naming$BLocalHost; public BOrd getAbsoluteOrd() { return BLocalScheme.ORD; } public boolean isConnected() { return true; } public void connect() throws Exception { } public BHost getHost() { return this; } public BOrd getOrdInHost() { return BOrd.make(""); } public Context getSessionContext() { return null; } public Object fw(int n, Object object, Object object2, Object object3, Object object4) { if (n == 404) { if (object != null) { try { return Sys.getRegistry().getModule((String)object).getVendorVersion(); } catch (ModuleNotFoundException moduleNotFoundException) { return Version.NULL; } } return Sys.getBajaModule().getVendorVersion(); } return super.fw(n, object, object2, object3, object4); } public BComponent getService(Type type) { return Sys.getService(type); } public String getNavDisplayName(Context context) { if (this.getLexiconText() == null) { this.setLexiconText(LexiconText.make("baja", "nav.localHost")); } if (this.navNameSuffix == null) { try { this.navNameSuffix = " : " + Sys.getLocalHost().getHostName(); } catch (Exception exception) { this.navNameSuffix = ""; } } return this.appendStationName(this.getLexiconText().getText(context) + this.navNameSuffix); } public BIcon getIcon() { return icon; } 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 BLocalHost() { super("localhost"); } static { Class clazz = class$javax$baja$naming$BLocalHost; if (clazz == null) { clazz = class$javax$baja$naming$BLocalHost = BLocalHost.class("[Ljavax.baja.naming.BLocalHost;", false); } TYPE = Sys.loadType(clazz); INSTANCE = new BLocalHost(); BNavRoot.INSTANCE.addNavChild(INSTANCE); cache.put("localhost", INSTANCE); ++cachedLocalHostCount; try { String string = TextUtil.toLowerCase((String)Sys.getLocalHost().getHostName()); if (!string.equals("localhost")) { cache.put(string, INSTANCE); ++cachedLocalHostCount; } } catch (Exception exception) {} } }