1 28 29 package com.caucho.ejb.hessian; 30 31 import com.caucho.ejb.RemoteExceptionWrapper; 32 import com.caucho.ejb.protocol.AbstractHomeHandle; 33 import com.caucho.ejb.protocol.ClientContainer; 34 35 import javax.ejb.EJBHome ; 36 import java.rmi.RemoteException ; 37 38 41 public class HessianHomeHandle extends AbstractHomeHandle { 42 private transient ClientContainer client; 43 private transient EJBHome home; 44 45 private String url; 46 47 50 public HessianHomeHandle() {} 51 52 57 public HessianHomeHandle(String url) 58 { 59 this.url = url; 60 } 61 62 67 public HessianHomeHandle(EJBHome home, String url) 68 { 69 this.url = url; 70 71 this.home = home; 72 } 73 74 77 public EJBHome getEJBHome() 78 throws RemoteException 79 { 80 if (home == null) { 81 try { 82 home = HessianClientContainer.find(url).getHomeStub(); 83 } catch (Exception e) { 84 throw RemoteExceptionWrapper.create(e); 85 } 86 } 87 88 return home; 89 } 90 91 94 public String getServerId() 95 { 96 return url; 97 } 98 99 102 public String getURL(String protocol) 103 { 104 return url; 105 } 106 107 110 public String toString() 111 { 112 return url; 113 } 114 } 115 | Popular Tags |