| 240 | |
| 241 | |
| 242 | @Override |
| 243 | public NamingEnumeration<NameClassPair> list(Name name) throws NamingException { |
| 244 | // Removing empty parts |
| 245 | while ((!name.isEmpty()) && (name.get(0).isEmpty())) { |
| 246 | name = name.getSuffix(1); |
| 247 | } |
| 248 | if (name.isEmpty()) { |
| 249 | return new NamingContextEnumeration(bindings.values().iterator()); |
| 250 | } |
| 251 | |
| 252 | NamingEntry entry = bindings.get(name.get(0)); |
| 253 | |
| 254 | if (entry == null) { |
| 255 | throw new NameNotFoundException(sm.getString("namingContext.nameNotBound", name, name.get(0))); |
| 256 | } |
| 257 | |
| 258 | if (entry.type != NamingEntry.CONTEXT) { |
| 259 | throw new NamingException(sm.getString("namingContext.contextExpected", name.get(0))); |
| 260 | } |
| 261 | return ((Context) entry.value).list(name.getSuffix(1)); |
| 262 | } |
| 263 | |
| 264 | |
| 265 | @Override |