1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.eclipse.jetty.jndi;
15
16 import java.util.Iterator;
17
18 import javax.naming.Binding;
19 import javax.naming.NameClassPair;
20 import javax.naming.NamingEnumeration;
21 import javax.naming.NamingException;
22
23
24
25
26
27
28
29
30
31
32 public class NameEnumeration implements NamingEnumeration<NameClassPair>
33 {
34 Iterator<Binding> _delegate;
35
36 public NameEnumeration (Iterator<Binding> e)
37 {
38 _delegate = e;
39 }
40
41 public void close()
42 throws NamingException
43 {
44 }
45
46 public boolean hasMore ()
47 throws NamingException
48 {
49 return _delegate.hasNext();
50 }
51
52 public NameClassPair next()
53 throws NamingException
54 {
55 Binding b = _delegate.next();
56 return new NameClassPair(b.getName(),b.getClassName(),true);
57 }
58
59 public boolean hasMoreElements()
60 {
61 return _delegate.hasNext();
62 }
63
64 public NameClassPair nextElement()
65 {
66 Binding b = _delegate.next();
67 return new NameClassPair(b.getName(),b.getClassName(),true);
68 }
69 }