KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > cmi > jndi > FlatNameParser


1 /*
2  * Copyright (C) 2002-2003, Simon Nieuviarts
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA
18  */

19 /*
20  * @(#)FlatNameParser.java 1.3 99/07/26
21  *
22  * Copyright 1997, 1998, 1999 Sun Microsystems, Inc. All Rights
23  * Reserved.
24  *
25  * Sun grants you ("Licensee") a non-exclusive, royalty free,
26  * license to use, modify and redistribute this software in source and
27  * binary code form, provided that i) this copyright notice and license
28  * appear on all copies of the software; and ii) Licensee does not
29  * utilize the software in a manner which is disparaging to Sun.
30  *
31  * This software is provided "AS IS," without a warranty of any
32  * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
33  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
34  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
35  * HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE
36  * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
37  * MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN
38  * NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
39  * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
40  * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
41  * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT
42  * OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS
43  * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
44  *
45  * This software is not designed or intended for use in on-line
46  * control of aircraft, air traffic, aircraft navigation or aircraft
47  * communications; or in the design, construction, operation or
48  * maintenance of any nuclear facility. Licensee represents and warrants
49  * that it will not use or redistribute the Software for such purposes.
50  */

51 package org.objectweb.carol.cmi.jndi;
52
53 import java.util.Properties JavaDoc;
54
55 import javax.naming.CompoundName JavaDoc;
56 import javax.naming.Name JavaDoc;
57 import javax.naming.NameParser JavaDoc;
58 import javax.naming.NamingException JavaDoc;
59
60 class FlatNameParser implements NameParser JavaDoc {
61     static Properties JavaDoc syntax = new Properties JavaDoc();
62     static {
63         syntax.put("jndi.syntax.direction", "flat");
64         syntax.put("jndi.syntax.ignorecase", "false");
65     }
66     public Name JavaDoc parse(String JavaDoc name) throws NamingException JavaDoc {
67         return new CompoundName JavaDoc(name, syntax);
68     }
69 }
70
Popular Tags