1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.jndi;
20
21
22 import java.util.Hashtable;
23 import java.util.Properties;
24
25 import javax.naming.CompoundName;
26 import javax.naming.Context;
27 import javax.naming.Name;
28 import javax.naming.NameParser;
29 import javax.naming.NamingException;
30
31 import org.eclipse.jetty.jndi.local.localContextRoot;
32 import org.eclipse.jetty.util.log.Logger;
33
34
35
36
37
38
39
40
41
42
43
44
45 public class InitialContextFactory implements javax.naming.spi.InitialContextFactory
46 {
47 private static Logger __log = NamingUtil.__log;
48
49 public static class DefaultParser implements NameParser
50 {
51 static Properties syntax = new Properties();
52 static
53 {
54 syntax.put("jndi.syntax.direction", "left_to_right");
55 syntax.put("jndi.syntax.separator", "/");
56 syntax.put("jndi.syntax.ignorecase", "false");
57 }
58 public Name parse (String name)
59 throws NamingException
60 {
61 return new CompoundName (name, syntax);
62 }
63 };
64
65
66
67
68
69
70
71
72
73
74
75
76
77 public Context getInitialContext(Hashtable env)
78 {
79 __log.debug("InitialContextFactory.getInitialContext()");
80
81 Context ctx = new localContextRoot(env);
82 if(__log.isDebugEnabled())__log.debug("Created initial context delegate for local namespace:"+ctx);
83
84 return ctx;
85 }
86 }