org.omg.CORBA.Object obj = orb.resolve_initial_references("NameService");
initialContext = NamingContextExtHelper.narrow(obj);
String[] names = tssLink.getJndiNames();
for (int i = 0; i < names.length; i++) {
NameComponent[] nameComponent = initialContext.to_name(names[i]);
NamingContext currentContext = initialContext;
NameComponent[] nc = new NameComponent[1];
int lastComponent = nameComponent.length - 1;
for (int j = 0; j < lastComponent; ++j) {
nc[0] = nameComponent[j];
try {
currentContext = NamingContextHelper.narrow(currentContext.resolve(nc));
} catch (NotFound nf) {
currentContext = currentContext.bind_new_context(nc);
}
}
nc[0] = nameComponent[lastComponent];
currentContext.rebind(nc, homeReference);
}
} catch (Exception e) {
throw new CORBAException(e);
}