throws org.omg.CosNaming.NamingContextPackage.NotFound {
BindingTypeHolder type = new BindingTypeHolder();
// Resolve this to an object. We must be able to resolve this.
org.omg.CORBA.Object resolvedReference = resolveObject(name, type);
if (resolvedReference == null) {
throw new NotFound(NotFoundReason.missing_node, new NameComponent[] {name});
}
// it has to resolve to a naming context
if (type.value.value() != BindingType._ncontext) {
throw new NotFound(NotFoundReason.not_context, new NameComponent[] {name});
}
// in theory, this is a naming context. Narrow it an return. Any
// errors just become a NotFound exception
try {
return NamingContextHelper.narrow(resolvedReference);
} catch (org.omg.CORBA.BAD_PARAM ex) {
throw new NotFound(NotFoundReason.not_context, new NameComponent[] {name});
}
}