1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.eclipse.jetty.jndi;
16
17 import java.util.Iterator;
18
19 import javax.naming.Binding;
20 import javax.naming.NamingEnumeration;
21 import javax.naming.NamingException;
22
23
24
25
26
27
28
29
30
31
32 public class BindingEnumeration implements NamingEnumeration<Binding>
33 {
34 Iterator<Binding> _delegate;
35
36 public BindingEnumeration (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 Binding next()
53 throws NamingException
54 {
55 Binding b = (Binding)_delegate.next();
56 return new Binding (b.getName(), b.getClassName(), b.getObject(), true);
57 }
58
59 public boolean hasMoreElements()
60 {
61 return _delegate.hasNext();
62 }
63
64 public Binding nextElement()
65 {
66 Binding b = (Binding)_delegate.next();
67 return new Binding (b.getName(), b.getClassName(), b.getObject(),true);
68 }
69 }