1 28 29 package com.caucho.ejb.burlap; 30 31 import com.caucho.ejb.RemoteExceptionWrapper; 32 import com.caucho.ejb.protocol.AbstractHomeHandle; 33 34 import javax.ejb.EJBHome ; 35 import java.rmi.RemoteException ; 36 37 40 public class BurlapHomeHandle extends AbstractHomeHandle { 41 private String _url; 42 private transient EJBHome _home; 43 44 47 public BurlapHomeHandle() {} 48 49 54 public BurlapHomeHandle(String url) 55 { 56 _url = url; 57 } 58 59 64 public BurlapHomeHandle(EJBHome home, String url) 65 { 66 _url = url; 67 68 _home = home; 69 } 70 71 74 public String getServerId() 75 { 76 return _url; 77 } 78 79 82 public EJBHome getEJBHome() 83 throws RemoteException 84 { 85 if (_home == null) { 86 try { 87 _home = BurlapClientContainer.find(_url).getHomeStub(); 88 } catch (Exception e) { 89 throw RemoteExceptionWrapper.create(e); 90 } 91 } 92 93 return _home; 94 } 95 96 99 public String getURL(String protocol) 100 { 101 return _url; 102 } 103 104 107 public String getURL() 108 { 109 return _url; 110 } 111 112 117 public boolean equals(Object b) 118 { 119 if (! (b instanceof BurlapHomeHandle)) 120 return false; 121 122 BurlapHomeHandle handle = (BurlapHomeHandle) b; 123 124 return _url.equals(handle._url); 125 } 126 127 130 public int hashCode() 131 { 132 return _url.hashCode(); 133 } 134 135 138 public String toString() 139 { 140 return _url; 141 } 142 } 143 | Popular Tags |