// If the name points to something in this level, try to find it,
// and give
// an error if not available
if (searchName.size() == 1) {
if (thisValue == null)
throw new NameNotFoundException(ContainerJNDIManager.JNDI_RESOURCES.getString(
"WinstoneContext.NameNotFound", name.toString()));
try {
return NamingManager.getObjectInstance(thisValue,
new CompositeName().add(thisName), this,
this.environment);
} catch (Exception e) {
NamingException ne = new NamingException(ContainerJNDIManager.JNDI_RESOURCES
.getString("WinstoneContext.FailedToGetInstance"));
ne.setRootCause(e);
throw ne;
}
}
else if (thisValue == null)
throw new NameNotFoundException(ContainerJNDIManager.JNDI_RESOURCES.getString(
"WinstoneContext.NameNotFound", thisName.toString()));
// If it's not in this level and what we found is not a context,
// complain
else if (!(thisValue instanceof Context))