KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > spice > jndikit > StandardNamespace


1 /*
2  * Copyright (C) The Spice Group. All rights reserved.
3  *
4  * This software is published under the terms of the Spice
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.spice.jndikit;
9
10 import java.util.Hashtable JavaDoc;
11 import javax.naming.Context JavaDoc;
12 import javax.naming.Name JavaDoc;
13 import javax.naming.NameParser JavaDoc;
14 import javax.naming.NamingException JavaDoc;
15 import javax.naming.spi.NamingManager JavaDoc;
16
17 /**
18  * Namespace that directly uses NamingManager.
19  *
20  * @author Peter Donald
21  * @version $Revision: 1.1 $
22  */

23 public class StandardNamespace
24     implements Namespace
25 {
26     private NameParser JavaDoc m_nameParser;
27
28     /**
29      * Construct a Namespace with specified NameParser.
30      *
31      * @param nameParser the NameParser for Namespace
32      */

33     public StandardNamespace( final NameParser JavaDoc nameParser )
34     {
35         m_nameParser = nameParser;
36     }
37
38     public NameParser JavaDoc getNameParser()
39     {
40         return m_nameParser;
41     }
42
43     public Object JavaDoc getStateToBind( final Object JavaDoc object,
44                                   final Name JavaDoc name,
45                                   final Context JavaDoc parent,
46                                   final Hashtable JavaDoc environment )
47         throws NamingException JavaDoc
48     {
49         return NamingManager.getStateToBind( object, name, parent, environment );
50     }
51
52     public Object JavaDoc getObjectInstance( final Object JavaDoc object,
53                                      final Name JavaDoc name,
54                                      final Context JavaDoc parent,
55                                      final Hashtable JavaDoc environment )
56         throws Exception JavaDoc
57     {
58         return NamingManager.getObjectInstance( object, name, parent, environment );
59     }
60 }
61
Popular Tags