1 28 29 package com.caucho.ejb.hessian; 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 HessianStub implements EJBObject { 43 protected transient Handle _handle; 44 45 abstract public String getHessianType(); 46 47 50 public Handle getHandle() 51 throws RemoteException 52 { 53 if (_handle == null) 54 _handle = _client.createHandle(_url); 55 56 return _handle; 57 } 58 59 62 public EJBHome getEJBHome() 63 throws RemoteException 64 { 65 try { 66 return _client.getHomeStub(); 67 } catch (Exception e) { 68 throw new RemoteExceptionWrapper(e); 69 } 70 } 71 72 77 public boolean isIdentical(EJBObject obj) 78 throws RemoteException 79 { 80 return getHandle().equals(obj.getHandle()) || _ejb_isIdentical(obj); 81 } 82 83 86 public void remove() 87 throws RemoteException , RemoveException 88 { 89 _ejb_remove(); 90 } 91 92 95 public Object getPrimaryKey() 96 throws RemoteException 97 { 98 return _ejb_getPrimaryKey(); 100 } 101 102 protected EJBHome _ejb_getEJBHome() throws RemoteException 103 { 104 return null; 105 } 106 107 protected boolean _ejb_isIdentical(EJBObject obj) throws RemoteException 108 { 109 return false; 110 } 111 112 protected void _ejb_remove() throws RemoteException , RemoveException 113 { 114 } 115 116 protected Object _ejb_getPrimaryKey() throws RemoteException 117 { 118 return null; 119 } 120 } 121 | Popular Tags |