1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 package org.osjava.sj.jndi;
33
34 import java.util.Hashtable;
35
36 import javax.naming.Context;
37 import javax.naming.Name;
38 import javax.naming.NameParser;
39 import javax.naming.NamingEnumeration;
40 import javax.naming.NamingException;
41
42
43 /***
44 * Standard delegating pattern for JNDI Contexts.
45 * Sub-classes of this may filter calls to the JNDI code.
46 */
47 public abstract class DelegatingContext implements Context {
48
49 private Context target;
50
51 public DelegatingContext(Context ctxt) {
52 this.target = ctxt;
53 }
54
55 public Object lookup(Name name) throws NamingException {
56 return this.target.lookup(name);
57 }
58
59 public Object lookup(String name) throws NamingException {
60 return this.target.lookup(name);
61 }
62
63 public void bind(Name name, Object value) throws NamingException {
64 this.target.bind(name, value);
65 }
66
67 public void bind(String name, Object value) throws NamingException {
68 this.target.bind(name, value);
69 }
70
71 public void rebind(Name name, Object value) throws NamingException {
72 this.target.rebind(name, value);
73 }
74
75 public void rebind(String name, Object value) throws NamingException {
76 this.target.rebind(name, value);
77 }
78
79 public void unbind(Name name) throws NamingException {
80 this.target.unbind(name);
81 }
82
83 public void unbind(String name) throws NamingException {
84 this.target.unbind(name);
85 }
86
87 public void rename(Name name, Name name2) throws NamingException {
88 this.target.rename(name, name2);
89 }
90
91 public void rename(String name, String name2) throws NamingException {
92 this.target.rename(name, name2);
93 }
94
95 public NamingEnumeration list(Name name) throws NamingException {
96 return this.target.list(name);
97 }
98
99 public NamingEnumeration list(String name) throws NamingException {
100 return this.target.list(name);
101 }
102
103 public NamingEnumeration listBindings(Name name) throws NamingException {
104 return this.target.listBindings(name);
105 }
106
107 public NamingEnumeration listBindings(String name) throws NamingException {
108 return this.target.listBindings(name);
109 }
110
111 public void destroySubcontext(Name name) throws NamingException {
112 this.target.destroySubcontext(name);
113 }
114
115 public void destroySubcontext(String name) throws NamingException {
116 this.target.destroySubcontext(name);
117 }
118
119 public Context createSubcontext(Name name) throws NamingException {
120 return this.target.createSubcontext(name);
121 }
122
123 public Context createSubcontext(String name) throws NamingException {
124 return this.target.createSubcontext(name);
125 }
126
127 public Object lookupLink(Name name) throws NamingException {
128 return this.target.lookupLink(name);
129 }
130
131 public Object lookupLink(String name) throws NamingException {
132 return this.target.lookupLink(name);
133 }
134
135 public NameParser getNameParser(Name name) throws NamingException {
136 return this.target.getNameParser(name);
137 }
138
139 public NameParser getNameParser(String name) throws NamingException {
140 return this.target.getNameParser(name);
141 }
142
143 public Name composeName(Name name, Name name2) throws NamingException {
144 return this.target.composeName(name, name2);
145 }
146
147 public String composeName(String name, String name2) throws NamingException {
148 return this.target.composeName(name, name2);
149 }
150
151 public Object addToEnvironment(String key, Object value) throws NamingException {
152 return this.target.addToEnvironment(key, value);
153 }
154
155 public Object removeFromEnvironment(String key) throws NamingException {
156 return this.target.removeFromEnvironment(key);
157 }
158
159 public Hashtable getEnvironment() throws NamingException {
160 return this.target.getEnvironment();
161 }
162
163 public void close() throws NamingException {
164 this.target.close();
165 }
166
167 public String getNameInNamespace() throws NamingException {
168 return this.target.getNameInNamespace();
169 }
170
171 protected Context getTarget() {
172 return this.target;
173 }
174
175 }
176