1 22 package org.objectweb.petals.jbi.registry.mock; 23 24 import java.util.Hashtable ; 25 import java.util.Map ; 26 27 import javax.naming.Binding ; 28 import javax.naming.Context ; 29 import javax.naming.InitialContext ; 30 import javax.naming.Name ; 31 import javax.naming.NameClassPair ; 32 import javax.naming.NameParser ; 33 import javax.naming.NamingException ; 34 35 39 public class MockInitialContext extends InitialContext { 40 41 private MockContext context; 42 43 public MockInitialContext() throws NamingException { 44 super(); 45 context = new MockContext(); 46 } 47 48 public Object addToEnvironment(String propName, Object propVal) 49 throws NamingException { 50 return context.addToEnvironment(propName, propVal); 51 } 52 53 public void bind(Name name, Object obj) throws NamingException { 54 context.bind(name, obj); 55 } 56 57 public void bind(String name, Object obj) throws NamingException { 58 context.bind(name, obj); 59 } 60 61 public void close() throws NamingException { 62 context.close(); 63 } 64 65 public Name composeName(Name name, Name prefix) throws NamingException { 66 return context.composeName(name, prefix); 67 } 68 69 public String composeName(String name, String prefix) 70 throws NamingException { 71 return context.composeName(name, prefix); 72 } 73 74 public Context createSubcontext(Name name) throws NamingException { 75 return context.createSubcontext(name); 76 } 77 78 public Context createSubcontext(String name) throws NamingException { 79 return context.createSubcontext(name); 80 } 81 82 public void destroySubcontext(Name name) throws NamingException { 83 context.destroySubcontext(name); 84 } 85 86 public void destroySubcontext(String name) throws NamingException { 87 context.destroySubcontext(name); 88 } 89 90 public boolean equals(Object obj) { 91 return context.equals(obj); 92 } 93 94 public Map <String , Object > getBindings() { 95 return context.getBindings(); 96 } 97 98 public Hashtable <?, ?> getEnvironment() throws NamingException { 99 return context.getEnvironment(); 100 } 101 102 public String getNameInNamespace() throws NamingException { 103 return context.getNameInNamespace(); 104 } 105 106 public NameParser getNameParser(Name name) throws NamingException { 107 return context.getNameParser(name); 108 } 109 110 public NameParser getNameParser(String name) throws NamingException { 111 return context.getNameParser(name); 112 } 113 114 public int hashCode() { 115 return context.hashCode(); 116 } 117 118 public MockNamingEnumeration<NameClassPair > list(Name name) 119 throws NamingException { 120 return context.list(name); 121 } 122 123 public MockNamingEnumeration<NameClassPair > list(String name) 124 throws NamingException { 125 return context.list(name); 126 } 127 128 public MockNamingEnumeration<Binding > listBindings(Name name) 129 throws NamingException { 130 return context.listBindings(name); 131 } 132 133 public MockNamingEnumeration<Binding > listBindings(String name) 134 throws NamingException { 135 return context.listBindings(name); 136 } 137 138 public Object lookup(Name name) throws NamingException { 139 return context.lookup(name); 140 } 141 142 public Object lookup(String name) throws NamingException { 143 return context.lookup(name); 144 } 145 146 public Object lookupLink(Name name) throws NamingException { 147 return context.lookupLink(name); 148 } 149 150 public Object lookupLink(String name) throws NamingException { 151 return context.lookupLink(name); 152 } 153 154 public void rebind(Name name, Object obj) throws NamingException { 155 context.rebind(name, obj); 156 } 157 158 public void rebind(String name, Object obj) throws NamingException { 159 context.rebind(name, obj); 160 } 161 162 public Object removeFromEnvironment(String propName) throws NamingException { 163 return context.removeFromEnvironment(propName); 164 } 165 166 public void rename(Name oldName, Name newName) throws NamingException { 167 context.rename(oldName, newName); 168 } 169 170 public void rename(String oldName, String newName) throws NamingException { 171 context.rename(oldName, newName); 172 } 173 174 public void setBindings(Map <String , Object > bindings) { 175 context.setBindings(bindings); 176 } 177 178 public String toString() { 179 return context.toString(); 180 } 181 182 public void unbind(Name name) throws NamingException { 183 context.unbind(name); 184 } 185 186 public void unbind(String name) throws NamingException { 187 context.unbind(name); 188 } 189 190 } 191 | Popular Tags |