1 45 46 47 package org.openejb.core.stateful; 48 49 50 import java.lang.reflect.Method ; 51 import java.rmi.RemoteException ; 52 53 import org.openejb.RpcContainer; 54 import org.openejb.core.ivm.EjbObjectProxyHandler; 55 import org.openejb.util.proxy.ProxyManager; 56 57 66 public class StatefulEjbObjectHandler extends EjbObjectProxyHandler { 67 68 public StatefulEjbObjectHandler(RpcContainer container, Object pk, Object depID){ 69 super(container, pk, depID); 70 } 71 72 public Object getRegistryId(){ 73 return primaryKey; 74 } 75 76 77 91 protected Object getPrimaryKey(Method method, Object [] args, Object proxy) throws Throwable { 92 throw new RemoteException ("Session objects are private resources and do not have primary keys"); 93 } 94 95 130 protected Object isIdentical(Method method, Object [] args, Object proxy) throws Throwable { 131 checkAuthorization(method); 132 EjbObjectProxyHandler handler = (EjbObjectProxyHandler)ProxyManager.getInvocationHandler(proxy); 133 return new Boolean ( primaryKey.equals(handler.primaryKey) ); 134 } 135 136 protected Object remove(Method method, Object [] args, Object proxy) throws Throwable { 137 checkAuthorization(method); 138 Object value = container.invoke(deploymentID, method, args, primaryKey, getThreadSpecificSecurityIdentity()); 139 invalidateAllHandlers(getRegistryId()); 141 return value; 142 } 143 144 } 145 | Popular Tags |