throw new InvalidNameException("Name is empty");
}
// does the new context already exist?
String str = name.toString();
Fqn fqn = Fqn.fromString(str);
Fqn ctx = Fqn.fromRelativeFqn(FQN_ROOT, fqn);
if (this.cache.getRoot().hasChild(ctx))
{
throw new NameAlreadyBoundException(str);
}
// does the prefix context already exist?
Fqn pctx;
String newctx = name.get(size - 1);
if (size > 1) // find subcontext to which the context will be added
{
String prefix = name.getPrefix(size - 1).toString();
Fqn fqn2 = Fqn.fromString(prefix);
pctx = Fqn.fromRelativeFqn(FQN_ROOT, fqn2);
boolean exists = this.cache.getRoot().hasChild(pctx);
if (!exists)
{
throw new NotContextException(name.getPrefix(size - 1).toString());
}
}
else
{
pctx = FQN_ROOT;
}
Fqn newf = Fqn.fromRelativeFqn(pctx, Fqn.fromString(newctx));
try
{
this.cache.put(newf, new HashMap<String, Binding>());
}
catch (CacheException ce)