KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jnp > interfaces > FastNamingProperties


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jnp.interfaces;
23
24 import java.io.InputStream JavaDoc;
25 import java.io.PrintStream JavaDoc;
26 import java.io.PrintWriter JavaDoc;
27 import java.util.Enumeration JavaDoc;
28 import java.util.Map JavaDoc;
29 import java.util.Properties JavaDoc;
30
31 /**
32  * This class exists because the JNDI API set wisely uses java.util.Properties
33  * which extends Hashtable, a threadsafe class. The NamingParser uses a static
34  * instance, making it a global source of contention. This results in
35  * a huge scalability problem, which can be seen in ECPerf, as sometimes half
36  * of the worker threads are stuck waiting for this stupid lock, sometimes
37  * themselves holdings global locks, e.g. to the AbstractInstanceCache.
38  *
39  * @version <tt>$Revision: 37459 $</tt>
40  * @author <a HREF="mailto:sreich@apple.com">Stefan Reich</a>
41  */

42 class FastNamingProperties extends Properties JavaDoc
43 {
44    /** serialVersionUID */
45    private static final long serialVersionUID = 190486940953472275L;
46
47    FastNamingProperties()
48    {
49    }
50
51    public Object JavaDoc setProperty(String JavaDoc s1, String JavaDoc s2)
52    {
53       throw new UnsupportedOperationException JavaDoc();
54    }
55
56    public void load(InputStream JavaDoc is) throws java.io.IOException JavaDoc
57    {
58       throw new UnsupportedOperationException JavaDoc();
59    }
60
61    public String JavaDoc getProperty(String JavaDoc s)
62    {
63       if (s.equals("jndi.syntax.direction"))
64       {
65          return "left_to_right";
66       }
67       else if (s.equals("jndi.syntax.ignorecase"))
68       {
69          return "false";
70       }
71       else if (s.equals("jndi.syntax.separator"))
72       {
73          return "/";
74       }
75       else
76       {
77          return null;
78       }
79    }
80
81    public String JavaDoc getProperty(String JavaDoc name, String JavaDoc defaultValue)
82    {
83       String JavaDoc ret = getProperty(name);
84       if (ret == null)
85       {
86          ret = defaultValue;
87       }
88       return ret;
89    }
90
91    public Enumeration JavaDoc propertyNames()
92    {
93       throw new UnsupportedOperationException JavaDoc();
94    }
95
96    public void list(PrintStream JavaDoc ps)
97    {
98       throw new UnsupportedOperationException JavaDoc();
99    }
100
101    public void list(PrintWriter JavaDoc ps)
102    {
103       throw new UnsupportedOperationException JavaDoc();
104    }
105
106    // methods from Hashtable
107

108    public int size()
109    {
110       throw new UnsupportedOperationException JavaDoc();
111    }
112
113    public boolean isEmpty()
114    {
115       throw new UnsupportedOperationException JavaDoc();
116    }
117
118    public Enumeration JavaDoc keys()
119    {
120       throw new UnsupportedOperationException JavaDoc();
121    }
122
123    public Enumeration JavaDoc elements()
124    {
125       throw new UnsupportedOperationException JavaDoc();
126    }
127
128    public boolean contains(Object JavaDoc o)
129    {
130       throw new UnsupportedOperationException JavaDoc();
131    }
132
133    public boolean containsValue(Object JavaDoc o)
134    {
135       throw new UnsupportedOperationException JavaDoc();
136    }
137
138    public boolean containsKey(Object JavaDoc o)
139    {
140       throw new UnsupportedOperationException JavaDoc();
141    }
142
143    public Object JavaDoc get(Object JavaDoc o)
144    {
145       throw new UnsupportedOperationException JavaDoc();
146    }
147
148    public Object JavaDoc put(Object JavaDoc o1, Object JavaDoc o2)
149    {
150       throw new UnsupportedOperationException JavaDoc();
151    }
152
153    public Object JavaDoc remove(Object JavaDoc o)
154    {
155       throw new UnsupportedOperationException JavaDoc();
156    }
157
158    public void putAll(Map JavaDoc m)
159    {
160       throw new UnsupportedOperationException JavaDoc();
161    }
162
163    public void clear()
164    {
165       throw new UnsupportedOperationException JavaDoc();
166    }
167
168    public Object JavaDoc clone()
169    {
170       throw new UnsupportedOperationException JavaDoc();
171    }
172
173    public String JavaDoc toString()
174    {
175       throw new UnsupportedOperationException JavaDoc();
176    }
177
178    public java.util.Set JavaDoc keySet()
179    {
180       throw new UnsupportedOperationException JavaDoc();
181    }
182
183    public java.util.Set JavaDoc entrySet()
184    {
185       throw new UnsupportedOperationException JavaDoc();
186    }
187
188    public java.util.Collection JavaDoc values()
189    {
190       throw new UnsupportedOperationException JavaDoc();
191    }
192
193    public boolean equals(Object JavaDoc o)
194    {
195       throw new UnsupportedOperationException JavaDoc();
196    }
197
198    public int hashCode()
199    {
200       throw new UnsupportedOperationException JavaDoc();
201    }
202 }
203
Popular Tags