| 269 | |
| 270 | |
| 271 | @Override |
| 272 | public NamingEnumeration<Binding> listBindings(Name name) throws NamingException { |
| 273 | // Removing empty parts |
| 274 | while ((!name.isEmpty()) && (name.get(0).isEmpty())) { |
| 275 | name = name.getSuffix(1); |
| 276 | } |
| 277 | if (name.isEmpty()) { |
| 278 | return new NamingContextBindingsEnumeration(bindings.values().iterator(), this); |
| 279 | } |
| 280 | |
| 281 | NamingEntry entry = bindings.get(name.get(0)); |
| 282 | |
| 283 | if (entry == null) { |
| 284 | throw new NameNotFoundException(sm.getString("namingContext.nameNotBound", name, name.get(0))); |
| 285 | } |
| 286 | |
| 287 | if (entry.type != NamingEntry.CONTEXT) { |
| 288 | throw new NamingException(sm.getString("namingContext.contextExpected", name.get(0))); |
| 289 | } |
| 290 | return ((Context) entry.value).listBindings(name.getSuffix(1)); |
| 291 | } |
| 292 | |
| 293 | |
| 294 | @Override |