1 28 29 package com.caucho.ejb.burlap; 30 31 import com.caucho.ejb.RemoteExceptionWrapper; 32 33 import javax.ejb.EJBHome ; 34 import javax.ejb.EJBObject ; 35 import javax.ejb.Handle ; 36 import javax.ejb.RemoveException ; 37 import java.rmi.RemoteException ; 38 39 42 public abstract class ObjectStub extends BurlapStub implements EJBObject { 43 protected transient Handle _handle; 44 45 48 abstract public String getHessianType(); 49 50 53 public Handle getHandle() 54 throws RemoteException 55 { 56 if (_handle == null) 57 _handle = new BurlapHandle(_url); 58 59 return _handle; 60 } 61 62 65 public EJBHome getEJBHome() 66 throws RemoteException 67 { 68 try { 69 return _client.getHomeStub(); 70 } catch (Exception e) { 71 throw new RemoteExceptionWrapper(e); 72 } 73 } 74 75 80 public boolean isIdentical(EJBObject obj) 81 throws RemoteException 82 { 83 return getHandle().equals(obj.getHandle()) || _ejb_isIdentical(obj); 84 } 85 86 89 public void remove() 90 throws RemoteException , RemoveException 91 { 92 _ejb_remove(); 93 } 94 95 98 public Object getPrimaryKey() 99 throws RemoteException 100 { 101 return _ejb_getPrimaryKey(); 103 } 104 105 protected EJBHome _ejb_getEJBHome() throws RemoteException 106 { 107 return null; 108 } 109 110 protected boolean _ejb_isIdentical(EJBObject obj) throws RemoteException 111 { 112 return false; 113 } 114 115 protected void _ejb_remove() throws RemoteException , RemoveException 116 { 117 } 118 119 protected Object _ejb_getPrimaryKey() throws RemoteException 120 { 121 return null; 122 } 123 } 124 | Popular Tags |