1 21 22 package uk.org.primrose.pool.standalone; 23 24 import javax.naming.*; 25 import java.util.*; 26 public class PoolInitialContext implements Context { 27 Hashtable ht = new Hashtable(); 28 public PoolInitialContext() throws NamingException { 29 } 30 31 public PoolInitialContext(Hashtable env) throws NamingException { 32 } 33 34 49 public Object lookup(Name name) throws NamingException { 50 return lookup(name.toString()); 51 } 52 53 61 public Object lookup(String name) throws NamingException { 62 Object o = ht.get(name); 63 if (o == null) { 64 String [] parts = name.split("/"); 65 o = ht.get(parts[parts.length-1]); 66 } 67 68 if (o == null) { 69 throw new NamingException("Cannot find JNDI resource under name : " +name); 70 } 71 72 return o; 73 } 74 75 96 public void bind(Name name, Object obj) throws NamingException { 97 } 99 100 115 public void bind(String name, Object obj) throws NamingException { 116 if (ht.get(name) != null) { 118 throw new NameAlreadyBoundException(name +" is already bound under this context"); 119 } 120 ht.put(name, obj); 121 } 122 123 149 public void rebind(Name name, Object obj) throws NamingException { 150 } 152 153 167 public void rebind(String name, Object obj) throws NamingException { 168 ht.remove(obj); 169 ht.put(name, obj); 170 } 171 172 194 public void unbind(Name name) throws NamingException { 195 } 196 197 207 public void unbind(String name) throws NamingException { 208 ht.remove(name); 209 } 210 211 231 public void rename(Name oldName, Name newName) throws NamingException { 232 } 233 234 248 public void rename(String oldName, String newName) throws NamingException { 249 } 250 251 270 public NamingEnumeration list(Name name) throws NamingException { 271 return null; 272 } 273 274 286 public NamingEnumeration list(String name) throws NamingException { 287 return null; 288 } 289 290 309 public NamingEnumeration listBindings(Name name) throws NamingException { 310 return null; 311 } 312 313 325 public NamingEnumeration listBindings(String name) throws NamingException { 326 return null; 327 } 328 329 363 public void destroySubcontext(Name name) throws NamingException { 364 } 365 366 379 public void destroySubcontext(String name) throws NamingException { 380 } 381 382 403 public Context createSubcontext(Name name) throws NamingException { 404 return null; 405 } 406 407 422 public Context createSubcontext(String name) throws NamingException { 423 return null; 424 } 425 426 440 public Object lookupLink(Name name) throws NamingException { 441 return null; 442 } 443 444 455 public Object lookupLink(String name) throws NamingException { 456 return null; 457 } 458 459 478 public NameParser getNameParser(Name name) throws NamingException { 479 return null; 480 } 481 482 492 public NameParser getNameParser(String name) throws NamingException { 493 return null; 494 } 495 496 530 public Name composeName(Name name, Name prefix) throws NamingException { 531 return null; 532 } 533 534 546 public String composeName(String name, String prefix) throws NamingException { 547 return null; 548 } 549 550 568 public Object addToEnvironment(String propName, Object propVal) throws NamingException { 569 return null; 570 } 571 572 587 public Object removeFromEnvironment(String propName) throws NamingException { 588 return null; 589 } 590 591 607 public Hashtable getEnvironment() throws NamingException { 608 return null; 609 } 610 611 622 public void close() throws NamingException { 623 } 624 625 645 public String getNameInNamespace() throws NamingException { 646 return null; 647 } 648 649 } 650 | Popular Tags |