KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > naming > EJBNameParser


1 /*
2  *
3  * JOnAS: Java(TM) Open Application Server
4  * Copyright (C) 1999 Bull S.A.
5  * Contact: jonas-team@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or any later version.
11  *
12  * This library 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 library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer(s): ____________________________________.
23  * Contributor(s): ______________________________________.
24  *
25  * --------------------------------------------------------------------------
26  * $Id: EJBNameParser.java,v 1.2 2002/03/18 09:55:55 jonas Exp $
27  * --------------------------------------------------------------------------
28  */

29
30 package org.objectweb.jonas.naming;
31
32 import java.util.Properties JavaDoc;
33 import javax.naming.NameParser JavaDoc;
34 import javax.naming.Name JavaDoc;
35 import javax.naming.CompoundName JavaDoc;
36 import javax.naming.NamingException JavaDoc;
37
38 /**
39  * Basic name parser used for java:comp naming space
40  */

41 public class EJBNameParser implements NameParser JavaDoc {
42
43     static Properties JavaDoc syntax = new Properties JavaDoc();
44
45     static {
46         syntax.put("jndi.syntax.direction", "left_to_right");
47         syntax.put("jndi.syntax.separator", "/");
48         syntax.put("jndi.syntax.ignorecase", "false");
49     }
50
51     /**
52      * Parse a name into its components.
53      * @param name The non-null string name to parse.
54      * @return A non-null parsed form of the name using the naming convention
55      * of this parser.
56      * @exception NamingException If a naming exception was encountered.
57      */

58     public Name JavaDoc parse(String JavaDoc name) throws NamingException JavaDoc {
59         return new CompoundName JavaDoc(name, syntax);
60     }
61
62 }
63
Popular Tags