1 45 package org.openejb.client; 46 47 import java.lang.reflect.Method ; 48 import java.rmi.RemoteException ; 49 50 59 public class StatelessEJBHomeHandler extends EJBHomeHandler { 60 61 public StatelessEJBHomeHandler(){ 62 } 63 64 public StatelessEJBHomeHandler(EJBMetaDataImpl ejb, ServerMetaData server, ClientMetaData client){ 65 super(ejb, server, client); 66 } 67 68 80 protected Object findX(Method method, Object [] args, Object proxy) throws Throwable { 81 throw new UnsupportedOperationException ("Stateful beans may not have find methods"); 82 } 83 84 113 protected Object removeByPrimaryKey(Method method, Object [] args, Object proxy) throws Throwable { 114 throw new RemoteException ("Session objects are private resources and do not have primary keys"); 115 } 116 117 118 125 protected Object removeWithHandle(Method method, Object [] args, Object proxy) throws Throwable { 126 EJBObjectHandle handle = (EJBObjectHandle)args[0]; 128 129 if ( handle == null ) throw new NullPointerException ("The handle is null"); 131 132 EJBObjectHandler handler = (EJBObjectHandler)handle.ejbObjectProxy.getEJBObjectHandler(); 133 134 if ( !handler.ejb.deploymentID.equals(this.ejb.deploymentID) ){ 136 throw new IllegalArgumentException ("The handle is not from the same deployment"); 137 } 138 handler.invalidateReference(); 139 140 return null; 141 } 142 143 protected EJBObjectHandler newEJBObjectHandler() { 144 return new StatelessEJBObjectHandler(); 145 } 146 147 } 148 | Popular Tags |