01: /*
02: *
03: * JOnAS: Java(TM) Open Application Server
04: * Copyright (C) 1999 Bull S.A.
05: * Contact: jonas-team@objectweb.org
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * 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 278 2002-03-18 09:55:55Z jonas $
27: * --------------------------------------------------------------------------
28: */
29:
30: package org.objectweb.jonas.naming;
31:
32: import java.util.Properties;
33: import javax.naming.NameParser;
34: import javax.naming.Name;
35: import javax.naming.CompoundName;
36: import javax.naming.NamingException;
37:
38: /**
39: * Basic name parser used for java:comp naming space
40: */
41: public class EJBNameParser implements NameParser {
42:
43: static Properties syntax = new Properties();
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 parse(String name) throws NamingException {
59: return new CompoundName(name, syntax);
60: }
61:
62: }
|