1   package com.javaranch.unittest.helper.sql.pool;
2   
3   
4   import java.util.Hashtable;
5   
6   import javax.naming.Context;
7   import javax.naming.Name;
8   import javax.naming.NameParser;
9   import javax.naming.NamingEnumeration;
10  import javax.naming.NamingException;
11  
12  /*******************************************************************************
13   *  Copyright (c) 2005, 2006 Imola Informatica.
14   *  All rights reserved. This program and the accompanying materials
15   *  are made available under the terms of the LGPL License v2.1
16   *  which accompanies this distribution, and is available at
17   *  http://www.gnu.org/licenses/lgpl.html
18   *******************************************************************************/
19  public class SimpleContext implements Context
20  {
21  
22      private Hashtable table = new Hashtable();
23  
24      /**
25       * Method lookup not yet implemented.
26       *
27       *
28       * @param name
29       *
30       * @return
31       *
32       * @throws NamingException
33       *
34       */
35      public Object lookup( Name name )
36      throws NamingException
37      {
38  
39          /**@todo: Implement this javax.naming.Context method*/
40          throw new java.lang.UnsupportedOperationException(
41              "Method lookup() not yet implemented." );
42      }
43  
44      /**
45       * Method lookup Returns the SimpleDataSource.
46       *
47       *
48       * @param name
49       *
50       * @return A copy of the SimpleDataSource class
51       *
52       * @throws NamingException
53       *
54       */
55      public Object lookup( String name )
56      throws NamingException
57      {
58          return table.get( name );
59      }
60  
61      /**
62       * Method bind not yet implemented.
63       *
64       *
65       * @param name
66       * @param obj
67       *
68       * @throws NamingException
69       *
70       */
71      public void bind( Name name, Object obj )
72      throws NamingException
73      {
74  
75          /**@todo: Implement this javax.naming.Context method*/
76          throw new java.lang.UnsupportedOperationException(
77              "Method bind() not yet implemented." );
78      }
79  
80      /**
81       * Method bind the SimpleDataSource for use.
82       *
83       *
84       * @param name
85       * @param obj
86       *
87       * @throws NamingException
88       *
89       */
90      public void bind( String name, Object obj )
91      throws NamingException
92      {
93  
94          /**@todo: Implement this javax.naming.Context method*/
95          table.put( name, obj );
96      }
97  
98      /**
99       * Method rebind not yet implemented.
100      *
101      *
102      * @param name
103      * @param obj
104      *
105      * @throws NamingException
106      *
107      */
108     public void rebind( Name name, Object obj )
109     throws NamingException
110     {
111 
112         /**@todo: Implement this javax.naming.Context method*/
113         throw new java.lang.UnsupportedOperationException(
114             "Method rebind() not yet implemented." );
115     }
116 
117     /**
118      * Method rebind not yet implemented.
119      *
120      *
121      * @param name
122      * @param obj
123      *
124      * @throws NamingException
125      *
126      */
127     public void rebind( String name, Object obj )
128     throws NamingException
129     {
130 
131         /**@todo: Implement this javax.naming.Context method*/
132         throw new java.lang.UnsupportedOperationException(
133             "Method rebind() not yet implemented." );
134     }
135 
136     /**
137      * Method unbind not yet implemented.
138      *
139      *
140      * @param name
141      *
142      * @throws NamingException
143      *
144      */
145     public void unbind( Name name )
146     throws NamingException
147     {
148 
149         /**@todo: Implement this javax.naming.Context method*/
150         throw new java.lang.UnsupportedOperationException(
151             "Method unbind() not yet implemented." );
152     }
153 
154     /**
155      * Method unbind not yet implemented.
156      *
157      *
158      * @param name
159      *
160      * @throws NamingException
161      *
162      */
163     public void unbind( String name )
164     throws NamingException
165     {
166         table.remove( name );
167     }
168 
169     /**
170      * Method rename not yet implemented.
171      *
172      *
173      * @param oldName
174      * @param newName
175      *
176      * @throws NamingException
177      *
178      */
179     public void rename( Name oldName, Name newName )
180     throws NamingException
181     {
182 
183         /**@todo: Implement this javax.naming.Context method*/
184         throw new java.lang.UnsupportedOperationException(
185             "Method rename() not yet implemented." );
186     }
187 
188     /**
189      * Method rename not yet implemented.
190      *
191      *
192      * @param oldName
193      * @param newName
194      *
195      * @throws NamingException
196      *
197      */
198     public void rename( String oldName, String newName )
199     throws NamingException
200     {
201 
202         /**@todo: Implement this javax.naming.Context method*/
203         throw new java.lang.UnsupportedOperationException(
204             "Method rename() not yet implemented." );
205     }
206 
207     /**
208      * Method list not yet implemented.
209      *
210      *
211      * @param name
212      *
213      * @return
214      *
215      * @throws NamingException
216      *
217      */
218     public NamingEnumeration list( Name name )
219     throws NamingException
220     {
221 
222         /**@todo: Implement this javax.naming.Context method*/
223         throw new java.lang.UnsupportedOperationException(
224             "Method list() not yet implemented." );
225     }
226 
227     /**
228      * Method list not yet implemented.
229      *
230      *
231      * @param name
232      *
233      * @return
234      *
235      * @throws NamingException
236      *
237      */
238     public NamingEnumeration list( String name )
239     throws NamingException
240     {
241 
242         /**@todo: Implement this javax.naming.Context method*/
243         throw new java.lang.UnsupportedOperationException(
244             "Method list() not yet implemented." );
245     }
246 
247     /**
248      * Method listBindings not yet implemented.
249      *
250      *
251      * @param name
252      *
253      * @return
254      *
255      * @throws NamingException
256      *
257      */
258     public NamingEnumeration listBindings( Name name )
259     throws NamingException
260     {
261 
262         /**@todo: Implement this javax.naming.Context method*/
263         throw new java.lang.UnsupportedOperationException(
264             "Method listBindings() not yet implemented." );
265     }
266 
267     /**
268      * Method listBindings not yet implemented.
269      *
270      *
271      * @param name
272      *
273      * @return
274      *
275      * @throws NamingException
276      *
277      */
278     public NamingEnumeration listBindings( String name )
279     throws NamingException
280     {
281 
282         /**@todo: Implement this javax.naming.Context method*/
283         throw new java.lang.UnsupportedOperationException(
284             "Method listBindings() not yet implemented." );
285     }
286 
287     /**
288      * Method destroySubcontext not yet implemented.
289      *
290      *
291      * @param name
292      *
293      * @throws NamingException
294      *
295      */
296     public void destroySubcontext( Name name )
297     throws NamingException
298     {
299 
300         /**@todo: Implement this javax.naming.Context method*/
301         throw new java.lang.UnsupportedOperationException(
302             "Method destroySubcontext() not yet implemented." );
303     }
304 
305     /**
306      * Method destroySubcontext not yet implemented.
307      *
308      *
309      * @param name
310      *
311      * @throws NamingException
312      *
313      */
314     public void destroySubcontext( String name )
315     throws NamingException
316     {
317 
318         /**@todo: Implement this javax.naming.Context method*/
319         throw new java.lang.UnsupportedOperationException(
320             "Method destroySubcontext() not yet implemented." );
321     }
322 
323     /**
324      * Method createSubcontext not yet implemented.
325      *
326      *
327      * @param name
328      *
329      * @return
330      *
331      * @throws NamingException
332      *
333      */
334     public Context createSubcontext( Name name )
335     throws NamingException
336     {
337 
338         /**@todo: Implement this javax.naming.Context method*/
339         throw new java.lang.UnsupportedOperationException(
340             "Method createSubcontext() not yet implemented." );
341     }
342 
343     /**
344      * Method createSubcontext not yet implemented.
345      *
346      *
347      * @param name
348      *
349      * @return
350      *
351      * @throws NamingException
352      *
353      */
354     public Context createSubcontext( String name )
355     throws NamingException
356     {
357 
358         /**@todo: Implement this javax.naming.Context method*/
359         throw new java.lang.UnsupportedOperationException(
360             "Method createSubcontext() not yet implemented." );
361     }
362 
363     /**
364      * Method lookupLink not yet implemented.
365      *
366      *
367      * @param name
368      *
369      * @return
370      *
371      * @throws NamingException
372      *
373      */
374     public Object lookupLink( Name name )
375     throws NamingException
376     {
377 
378         /**@todo: Implement this javax.naming.Context method*/
379         throw new java.lang.UnsupportedOperationException(
380             "Method lookupLink() not yet implemented." );
381     }
382 
383     /**
384      * Method lookupLink not yet implemented.
385      *
386      *
387      * @param name
388      *
389      * @return
390      *
391      * @throws NamingException
392      *
393      */
394     public Object lookupLink( String name )
395     throws NamingException
396     {
397 
398         /**@todo: Implement this javax.naming.Context method*/
399         throw new java.lang.UnsupportedOperationException(
400             "Method lookupLink() not yet implemented." );
401     }
402 
403     /**
404      * Method getNameParser not yet implemented.
405      *
406      *
407      * @param name
408      *
409      * @return
410      *
411      * @throws NamingException
412      *
413      */
414     public NameParser getNameParser( Name name )
415     throws NamingException
416     {
417 
418         /**@todo: Implement this javax.naming.Context method*/
419         throw new java.lang.UnsupportedOperationException(
420             "Method getNameParser() not yet implemented." );
421     }
422 
423     /**
424      * Method getNameParser not yet implemented.
425      *
426      *
427      * @param name
428      *
429      * @return
430      *
431      * @throws NamingException
432      *
433      */
434     public NameParser getNameParser( String name )
435     throws NamingException
436     {
437 
438         /**@todo: Implement this javax.naming.Context method*/
439         throw new java.lang.UnsupportedOperationException(
440             "Method getNameParser() not yet implemented." );
441     }
442 
443     /**
444      * Method composeName not yet implemented.
445      *
446      *
447      * @param name
448      * @param prefix
449      *
450      * @return
451      *
452      * @throws NamingException
453      *
454      */
455     public Name composeName( Name name, Name prefix )
456     throws NamingException
457     {
458 
459         /**@todo: Implement this javax.naming.Context method*/
460         throw new java.lang.UnsupportedOperationException(
461             "Method composeName() not yet implemented." );
462     }
463 
464     /**
465      * Method composeName not yet implemented.
466      *
467      *
468      * @param name
469      * @param prefix
470      *
471      * @return
472      *
473      * @throws NamingException
474      *
475      */
476     public String composeName( String name, String prefix )
477     throws NamingException
478     {
479 
480         /**@todo: Implement this javax.naming.Context method*/
481         throw new java.lang.UnsupportedOperationException(
482             "Method composeName() not yet implemented." );
483     }
484 
485     /**
486      * Method addToEnvironment not yet implemented.
487      *
488      *
489      * @param propName
490      * @param propVal
491      *
492      * @return
493      *
494      * @throws NamingException
495      *
496      */
497     public Object addToEnvironment( String propName, Object propVal )
498     throws NamingException
499     {
500 
501         /**@todo: Implement this javax.naming.Context method*/
502         throw new java.lang.UnsupportedOperationException(
503             "Method addToEnvironment() not yet implemented." );
504     }
505 
506     /**
507      * Method removeFromEnvironment not yet implemented.
508      *
509      *
510      * @param propName
511      *
512      * @return
513      *
514      * @throws NamingException
515      *
516      */
517     public Object removeFromEnvironment( String propName )
518     throws NamingException
519     {
520 
521         /**@todo: Implement this javax.naming.Context method*/
522         throw new java.lang.UnsupportedOperationException(
523             "Method removeFromEnvironment() not yet implemented." );
524     }
525 
526     /**
527      * Method getEnvironment not yet implemented.
528      *
529      *
530      * @return
531      *
532      * @throws NamingException
533      *
534      */
535     public Hashtable getEnvironment()
536     throws NamingException
537     {
538 
539         /**@todo: Implement this javax.naming.Context method*/
540         throw new java.lang.UnsupportedOperationException(
541             "Method getEnvironment() not yet implemented." );
542     }
543 
544     /**
545      * Method close not yet implemented.
546      *
547      *
548      * @throws NamingException
549      *
550      */
551     public void close()
552     throws NamingException
553     {
554 
555         /**@todo: Implement this javax.naming.Context method*/
556         throw new java.lang.UnsupportedOperationException(
557             "Method close() not yet implemented." );
558     }
559 
560     /**
561      * Method getNameInNamespace not yet implemented.
562      *
563      *
564      * @return
565      *
566      * @throws NamingException
567      *
568      */
569     public String getNameInNamespace()
570     throws NamingException
571     {
572 
573         /**@todo: Implement this javax.naming.Context method*/
574         throw new java.lang.UnsupportedOperationException(
575             "Method getNameInNamespace() not yet implemented." );
576     }
577 }