1 45 package org.openejb.core.stateful; 46 47 48 import java.lang.reflect.Method ; 49 import java.rmi.RemoteException ; 50 51 import org.openejb.ProxyInfo; 52 import org.openejb.RpcContainer; 53 import org.openejb.core.ivm.EjbHomeProxyHandler; 54 import org.openejb.core.ivm.EjbObjectProxyHandler; 55 import org.openejb.util.proxy.ProxyManager; 56 57 66 public class StatefulEjbHomeHandler extends EjbHomeProxyHandler { 67 68 public StatefulEjbHomeHandler(RpcContainer container, Object pk, Object depID){ 69 super(container, pk, depID); 70 } 71 72 protected Object createProxy(ProxyInfo proxyInfo){ 73 Object proxy = super.createProxy(proxyInfo); 74 EjbObjectProxyHandler handler = (EjbObjectProxyHandler)ProxyManager.getInvocationHandler(proxy); 75 76 registerHandler(handler.getRegistryId(),handler); 78 79 return proxy; 80 81 } 82 83 84 96 protected Object findX(Method method, Object [] args, Object proxy) throws Throwable { 97 throw new UnsupportedOperationException ("Stateful beans may not have find methods"); 98 } 99 100 129 protected Object removeByPrimaryKey(Method method, Object [] args, Object proxy) throws Throwable { 130 throw new RemoteException ("Session objects are private resources and do not have primary keys"); 131 } 132 133 134 protected EjbObjectProxyHandler newEjbObjectHandler(RpcContainer container, Object pk, Object depID) { 135 return new StatefulEjbObjectHandler(container, pk, depID); 136 } 137 138 } 139 | Popular Tags |