if (j > 0) {
subname += ".";
}
subname += composite.get(j);
}
throw new NameAlreadyBoundException(
"'" + subname + "' is already bound");
} else {
subcontext = (Context) object;
}
} catch (NameNotFoundException exception) {
subcontext = subcontext.createSubcontext(component);
}
}
component = composite.get(composite.size() - 1);
if (component.length() == 0) {
throw new InvalidNameException("'" + name
+ "' is not a valid name");
}
try {
Object object = subcontext.lookup(component);
if (object instanceof Context) {
throw new NameAlreadyBoundException("'" + name +
"' is already bound");
}
} catch (NameNotFoundException ignore) {
} catch (NamingException exception) {
}