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