throw new CannotProceed(); Name n = new Name(nc); Name ctx = n.ctxName(); NameComponent nb = n.baseNameComponent(); unbind(n.components()); else throw new AlreadyBound(); rebind_context(n.components(), obj); return; throw new CannotProceed(_this(), n.components()); org.omg.CORBA.Object context = this.resolve(ctx.components());
/** * @return the string representation of this NameComponent array */ public static String toString(org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if (n == null || n.length == 0) throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); StringBuffer b = new StringBuffer(); for (int i = 0; i < n.length; i++) { if (i > 0) b.append("/"); if (n[i].id.length() > 0) b.append(escape(n[i].id)); if (n[i].kind.length() > 0 || n[i].id.length() == 0) b.append("."); if (n[i].kind.length() > 0) b.append(escape(n[i].kind)); } return b.toString(); }
/** * * @return an a array of NameComponents * @throws org.omg.CosNaming.NamingContextPackage.InvalidName */ public static org.omg.CosNaming.NameComponent[] toName(String sn) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if (sn == null || sn.length() == 0 || sn.startsWith("/")) throw new InvalidName(); Vector v = new Vector(); int start = 0; int i = 0; for (; i < sn.length(); i++) { if (sn.charAt(i) == '/' && sn.charAt(i - 1) != '\\') { if (i - start == 0) throw new InvalidName(); v.addElement(getComponent(sn.substring(start, i))); start = i + 1; } } if (start < i) v.addElement(getComponent(sn.substring(start, i))); org.omg.CosNaming.NameComponent[] result = new org.omg.CosNaming.NameComponent[v.size()]; for (int j = 0; j < result.length; j++) { result[j] = (org.omg.CosNaming.NameComponent) v.elementAt(j); } return result; }
public org.omg.CORBA.Object resolve(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); Name n = new Name(nc[0]); if (nc.length > 1) { org.omg.CORBA.Object next_context = (org.omg.CORBA.Object) this.contexts.get(n); if ((next_context == null) || (isDead(next_context))) throw new NotFound(NotFoundReason.missing_node, nc); NameComponent[] nc_prime = new NameComponent[nc.length - 1]; System.arraycopy(nc, 1, nc_prime, 0, nc_prime.length); // try first to call the context implementation object directly. String contextOID = this.getObjectOID(next_context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) return jbossContext.resolve(nc_prime); else return NamingContextExtHelper.narrow(next_context).resolve(nc_prime); } else { org.omg.CORBA.Object result = (org.omg.CORBA.Object) this.contexts.get(n); if (result == null) result = (org.omg.CORBA.Object) this.names.get(n); if (result == null) throw new NotFound(NotFoundReason.missing_node, n.components()); if (!noPing && isDead(result)) throw new NotFound(NotFoundReason.missing_node, n.components()); return result; } }
/** * @return the string representation of this name */ public String toString() { try { return toString(fullName); } catch (InvalidName in) { return "<invalid>"; } }
/** * create a name from a stringified name */ public Name(String string_name) throws org.omg.CosNaming.NamingContextPackage.InvalidName { this(toName(string_name)); }
public Name fullName() throws org.omg.CosNaming.NamingContextPackage.InvalidName { return new Name(fullName); }
result[how_many_ctr - 1] = new Binding((names.next()).components(), BindingType.nobject); result[how_many_ctr - 1] = new Binding((contexts.next()).components(), BindingType.ncontext); Binding[] rest = new Binding[size]; for (; names.hasNext() && size > 0; size--) rest[size - 1] = new Binding((names.next()).components(), BindingType.nobject); rest[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext); result = new Binding[size]; for (; names.hasNext() && size > 0; size--) result[size - 1] = new Binding((names.next()).components(), BindingType.nobject); result[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);
public String to_string(NameComponent[] n) throws InvalidName { return Name.toString(n); }
public org.omg.CORBA.Object resolve(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); Name n = new Name(nc[0]); if (nc.length > 1) { org.omg.CORBA.Object next_context = (org.omg.CORBA.Object) this.contexts.get(n); if ((next_context == null) || (isDead(next_context))) throw new NotFound(NotFoundReason.missing_node, nc); NameComponent[] nc_prime = new NameComponent[nc.length - 1]; System.arraycopy(nc, 1, nc_prime, 0, nc_prime.length); // try first to call the context implementation object directly. String contextOID = this.getObjectOID(next_context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) return jbossContext.resolve(nc_prime); else return NamingContextExtHelper.narrow(next_context).resolve(nc_prime); } else { org.omg.CORBA.Object result = (org.omg.CORBA.Object) this.contexts.get(n); if (result == null) result = (org.omg.CORBA.Object) this.names.get(n); if (result == null) throw new NotFound(NotFoundReason.missing_node, n.components()); if (!noPing && isDead(result)) throw new NotFound(NotFoundReason.missing_node, n.components()); return result; } }
public NameComponent[] to_name(String sn) throws InvalidName { return Name.toName(sn); }
/** * @return a Name object representing the name of the enclosing context */ public Name ctxName() { // null if no further context if (ctxName != null) { try { return new Name(ctxName); } catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) { throw new INTERNAL(e.toString()); } } return null; }
result[how_many_ctr - 1] = new Binding((names.next()).components(), BindingType.nobject); result[how_many_ctr - 1] = new Binding((contexts.next()).components(), BindingType.ncontext); Binding[] rest = new Binding[size]; for (; names.hasNext() && size > 0; size--) rest[size - 1] = new Binding((names.next()).components(), BindingType.nobject); rest[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext); result = new Binding[size]; for (; names.hasNext() && size > 0; size--) result[size - 1] = new Binding((names.next()).components(), BindingType.nobject); result[size - 1] = new Binding((contexts.next()).components(), BindingType.ncontext);
throw new org.omg.CORBA.BAD_PARAM(); Name n = new Name(nc); Name ctx = n.ctxName(); NameComponent nb = n.baseNameComponent(); org.omg.CORBA.Object context = this.resolve(ctx.components());
public int hashCode() { return toString().hashCode(); }
public org.omg.CORBA.Object resolve(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); Name n = new Name(nc[0]); if (nc.length > 1) { org.omg.CORBA.Object next_context = (org.omg.CORBA.Object) this.contexts.get(n); if ((next_context == null) || (isDead(next_context))) throw new NotFound(NotFoundReason.missing_node, nc); NameComponent[] nc_prime = new NameComponent[nc.length - 1]; System.arraycopy(nc, 1, nc_prime, 0, nc_prime.length); // try first to call the context implementation object directly. String contextOID = this.getObjectOID(next_context); CorbaNamingContext jbossContext = (contextOID == null ? null : contextImpls.get(contextOID)); if (jbossContext != null) return jbossContext.resolve(nc_prime); else return NamingContextExtHelper.narrow(next_context).resolve(nc_prime); } else { org.omg.CORBA.Object result = (org.omg.CORBA.Object) this.contexts.get(n); if (result == null) result = (org.omg.CORBA.Object) this.names.get(n); if (result == null) throw new NotFound(NotFoundReason.missing_node, n.components()); if (!noPing && isDead(result)) throw new NotFound(NotFoundReason.missing_node, n.components()); return result; } }
/** * create a name from a stringified name */ public Name(String string_name) throws org.omg.CosNaming.NamingContextPackage.InvalidName { this(toName(string_name)); }
public Name fullName() throws org.omg.CosNaming.NamingContextPackage.InvalidName { return new Name(fullName); }
/** * @return the string representation of this NameComponent array */ public static String toString(org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if (n == null || n.length == 0) throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); StringBuffer b = new StringBuffer(); for (int i = 0; i < n.length; i++) { if (i > 0) b.append("/"); if (n[i].id.length() > 0) b.append(escape(n[i].id)); if (n[i].kind.length() > 0 || n[i].id.length() == 0) b.append("."); if (n[i].kind.length() > 0) b.append(escape(n[i].kind)); } return b.toString(); }
/** * * @return an a array of NameComponents * @throws org.omg.CosNaming.NamingContextPackage.InvalidName */ public static org.omg.CosNaming.NameComponent[] toName(String sn) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if (sn == null || sn.length() == 0 || sn.startsWith("/")) throw new InvalidName(); Vector v = new Vector(); int start = 0; int i = 0; for (; i < sn.length(); i++) { if (sn.charAt(i) == '/' && sn.charAt(i - 1) != '\\') { if (i - start == 0) throw new InvalidName(); v.addElement(getComponent(sn.substring(start, i))); start = i + 1; } } if (start < i) v.addElement(getComponent(sn.substring(start, i))); org.omg.CosNaming.NameComponent[] result = new org.omg.CosNaming.NameComponent[v.size()]; for (int j = 0; j < result.length; j++) { result[j] = (org.omg.CosNaming.NameComponent) v.elementAt(j); } return result; }