1 28 29 package com.caucho.naming.burlap; 30 31 import com.caucho.burlap.client.BurlapProxyFactory; 32 import com.caucho.naming.AbstractModel; 33 34 import javax.naming.NamingException ; 35 import java.util.ArrayList ; 36 import java.util.List ; 37 38 41 public class BurlapModel extends AbstractModel { 42 private BurlapProxyFactory _proxyFactory = new BurlapProxyFactory(); 43 44 47 public BurlapModel() 48 { 49 } 50 51 54 protected AbstractModel create() 55 { 56 return new BurlapModel(); 57 } 58 59 66 public Object lookup(String name) 67 throws NamingException 68 { 69 if (name == null) 70 return null; 71 72 if (name.startsWith("burlap:")) 73 name = name.substring("burlap:".length()); 74 75 if (name.startsWith("//")) 76 name = "http:" + name; 77 78 try { 79 return _proxyFactory.create(name); 80 } catch (RuntimeException e) { 81 throw e; 82 } catch (Exception e) { 83 NamingException exn = new NamingException (e.toString()); 84 exn.initCause(e); 85 throw exn; 86 } 87 } 88 89 92 public List list() 93 { 94 return new ArrayList (); 95 } 96 } 97 | Popular Tags |