1 package org.wamblee.support.jndi;
3 import java.util.HashMap;
6 import javax.naming.InitialContext;
7 import javax.naming.Name;
8 import javax.naming.NamingException;
10 public class StubInitialContext extends InitialContext {
11 private Map<String, Object> bindings = new HashMap<String, Object>();
13 public StubInitialContext() throws NamingException {
18 public void bind(String name, Object obj) throws NamingException {
19 bindings.put(name, obj);
23 public Object lookup(String name) throws NamingException {
24 return bindings.get(name);
28 public Object lookup(Name name) throws NamingException {
29 return super.lookup(name.toString());