/** * create a name from a singleNameComponent */ public Name(org.omg.CosNaming.NameComponent n) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if (n == null) throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); baseName = n; fullName = new org.omg.CosNaming.NameComponent[1]; fullName[0] = n; ctxName = null; }
/** * create a name from an array of NameComponents */ public Name(NameComponent[] n) throws InvalidName { if (n == null || n.length == 0) throw new InvalidName(); fullName = n; baseName = n[n.length - 1]; if (n.length > 1) { ctxName = new NameComponent[n.length - 1]; for (int i = 0; i < n.length - 1; i++) ctxName[i] = n[i]; } else ctxName = null; }
/** * * @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; }
/** * @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(); }
throw new InvalidName(); throw new InvalidName();
public NamingContext bind_new_context(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName, AlreadyBound { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); NamingContext context = new_context(); if (context == null) throw new CannotProceed(); bind_context(nc, context); return context; }
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; } }
throw new InvalidName();
throw new InvalidName();
throw new InvalidName();
throw new InvalidName();
/** * create a name from a singleNameComponent */ public Name(org.omg.CosNaming.NameComponent n) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if (n == null) throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); baseName = n; fullName = new org.omg.CosNaming.NameComponent[1]; fullName[0] = n; ctxName = null; }
/** * create a name from a singleNameComponent */ public Name(org.omg.CosNaming.NameComponent n) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if (n == null) throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); baseName = n; fullName = new org.omg.CosNaming.NameComponent[1]; fullName[0] = n; ctxName = null; }
/** * create a name from a singleNameComponent */ public Name(org.omg.CosNaming.NameComponent n) throws org.omg.CosNaming.NamingContextPackage.InvalidName { if( n == null ) throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); baseName = n; fullName = new org.omg.CosNaming.NameComponent[1]; fullName[0] = n; ctxName = null; }
public static org.omg.CosNaming.NamingContextPackage.InvalidName read (org.omg.CORBA.portable.InputStream istream) { org.omg.CosNaming.NamingContextPackage.InvalidName value = new org.omg.CosNaming.NamingContextPackage.InvalidName (); // read and discard the repository ID istream.read_string (); return value; }
public static org.omg.CosNaming.NamingContextPackage.InvalidName read (org.omg.CORBA.portable.InputStream istream) { org.omg.CosNaming.NamingContextPackage.InvalidName value = new org.omg.CosNaming.NamingContextPackage.InvalidName (); // read and discard the repository ID istream.read_string (); return value; }
public static org.omg.CosNaming.NamingContextPackage.InvalidName read (org.omg.CORBA.portable.InputStream istream) { org.omg.CosNaming.NamingContextPackage.InvalidName value = new org.omg.CosNaming.NamingContextPackage.InvalidName (); // read and discard the repository ID istream.read_string (); return value; }
public static org.omg.CosNaming.NamingContextPackage.InvalidName read (final org.omg.CORBA.portable.InputStream in) { String id = in.read_string(); if (!id.equals(id())) throw new org.omg.CORBA.MARSHAL("wrong id: " + id); final org.omg.CosNaming.NamingContextPackage.InvalidName result = new org.omg.CosNaming.NamingContextPackage.InvalidName(id); return result; } public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.CosNaming.NamingContextPackage.InvalidName s)
public NamingContext bind_new_context(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName, AlreadyBound { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); NamingContext context = new_context(); if (context == null) throw new CannotProceed(); bind_context(nc, context); return context; }
public NamingContext bind_new_context(NameComponent[] nc) throws NotFound, CannotProceed, InvalidName, AlreadyBound { if (this.destroyed) throw new CannotProceed(); if (nc == null || nc.length == 0) throw new InvalidName(); NamingContext context = new_context(); if (context == null) throw new CannotProceed(); bind_context(nc, context); return context; }