1 45 package org.openejb.client; 46 47 import java.lang.reflect.Method ; 48 import java.rmi.RemoteException ; 49 50 51 60 public class StatelessEJBObjectHandler extends EJBObjectHandler { 61 62 64 public Object registryId; 65 66 public StatelessEJBObjectHandler(){ 67 } 68 69 public StatelessEJBObjectHandler(EJBMetaDataImpl ejb, ServerMetaData server, ClientMetaData client){ 70 super(ejb, server, client); 71 } 72 73 public StatelessEJBObjectHandler(EJBMetaDataImpl ejb, ServerMetaData server, ClientMetaData client, Object primaryKey){ 74 super(ejb, server, client, primaryKey); 75 } 76 77 public static Object createRegistryId(Object primKey, Object deployId, String containerID){ 79 return "" + deployId + containerID; 80 } 81 82 public Object getRegistryId(){ 83 return null; 87 } 88 89 90 104 protected Object getPrimaryKey(Method method, Object [] args, Object proxy) throws Throwable { 105 throw new RemoteException ("Session objects are private resources and do not have primary keys"); 106 } 107 108 143 protected Object isIdentical(Method method, Object [] args, Object proxy) throws Throwable { 144 Object arg = ( args.length == 1 )? args[0]: null; 146 147 if ( arg == null || !(arg instanceof EJBObjectProxy) ) return Boolean.FALSE; 148 EJBObjectProxy proxy2 = (EJBObjectProxy)arg; 149 EJBObjectHandler that = proxy2.getEJBObjectHandler(); 150 return new Boolean ( this.ejb.deploymentID.equals(that.ejb.deploymentID) ); 151 } 152 153 protected Object remove(Method method, Object [] args, Object proxy) throws Throwable { 154 invalidateReference(); 156 return null; 157 } 158 159 } 160 | Popular Tags |