out.close();
log.debug("done");
return;
}
RegistryContext ctx = new RegistryContext();
if (g) {
BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
Object o = null;
try {
o = ctx.lookup(name);
} catch (NamingException ex) {
if (tex)
throw new RuntimeException(ex);
else
out.print("Name not bound: " + name);
return;
}
oout.writeObject(o);
oout.close();
return;
}
if (l) {
BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
Object o = ctx.lookup(name);
if (!(o instanceof Context)) {
if (tex)
throw new RuntimeException("Object is not instance of Context. Can't list it. : " + name);
else
out.print("Object is not instance of Context. Can't list it. : " + name);
return;
}
NamingEnumeration it = ctx.listBindings(name);
while (it.hasMore()) {
Binding bing = (Binding) it.next();
out.println(bing.toString());
}
out.close();