KickJava   Java API By Example, From Geeks To Geeks.

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


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 javax.naming.NameParser JavaDoc;
11 import javax.naming.spi.ObjectFactory JavaDoc;
12 import javax.naming.spi.StateFactory JavaDoc;
13
14 /**
15  * This is the default namespace implementation.
16  *
17  * @author Peter Donald
18  * @version $Revision: 1.1 $
19  */

20 public class DefaultNamespace
21     extends AbstractNamespace
22 {
23     private NameParser JavaDoc m_nameParser;
24
25     public DefaultNamespace( final NameParser JavaDoc nameParser )
26     {
27         this( nameParser,
28               new ObjectFactory JavaDoc[ 0 ],
29               new StateFactory JavaDoc[ 0 ] );
30     }
31
32     public DefaultNamespace( final NameParser JavaDoc nameParser,
33                              final ObjectFactory JavaDoc[] objectFactorySet,
34                              final StateFactory JavaDoc[] stateFactorySet )
35     {
36         m_nameParser = nameParser;
37         m_objectFactorySet = objectFactorySet;
38         m_stateFactorySet = stateFactorySet;
39     }
40
41     public NameParser JavaDoc getNameParser()
42     {
43         return m_nameParser;
44     }
45
46     public synchronized void addStateFactory( final StateFactory JavaDoc stateFactory )
47     {
48         super.addStateFactory( stateFactory );
49     }
50
51     public synchronized void addObjectFactory( final ObjectFactory JavaDoc objectFactory )
52     {
53         super.addObjectFactory( objectFactory );
54     }
55 }
56
Popular Tags