User: fleury
Date: 00/10/16 16:37:00
Modified: src/main/org/jboss/ejb/plugins/jrmp/interfaces
EntityProxy.java StatefulSessionProxy.java
StatelessSessionProxy.java
Log:
take care of the EJBObject.getEJBHome() on the proxy in the client ( we lookup the
naming)
Revision Changes Path
1.19 +12 -2
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/EntityProxy.java
Index: EntityProxy.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/EntityProxy.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- EntityProxy.java 2000/09/26 20:18:53 1.18
+++ EntityProxy.java 2000/10/16 23:37:00 1.19
@@ -9,8 +9,10 @@
import java.io.IOException;
import java.rmi.MarshalledObject;
import java.lang.reflect.Method;
+import javax.naming.InitialContext;
import javax.ejb.EJBObject;
+import javax.ejb.EJBHome;
import org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker;
import org.jboss.ejb.CacheKey;
@@ -21,7 +23,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.18 $
+* @version $Revision: 1.19 $
*/
public class EntityProxy
extends GenericProxy
@@ -36,6 +38,7 @@
static Method getPrimaryKey;
static Method getHandle;
+ static Method getEJBHome;
static Method isIdentical;
static Method toStr;
static Method eq;
@@ -48,7 +51,8 @@
// EJB methods
getPrimaryKey = EJBObject.class.getMethod("getPrimaryKey", new Class[0]);
getHandle = EJBObject.class.getMethod("getHandle", new Class[0]);
- isIdentical = EJBObject.class.getMethod("isIdentical", new Class[] {
EJBObject.class });
+ getEJBHome = EJBObject.class.getMethod("getEJBHome", new Class[0]);
+ isIdentical = EJBObject.class.getMethod("isIdentical", new Class[] {
EJBObject.class });
// Object methods
toStr = Object.class.getMethod("toString", new Class[0]);
@@ -121,6 +125,12 @@
{
return cacheKey.id;
}
+
+ else if (m.equals(getEJBHome))
+ {
+ return (EJBHome) new InitialContext().lookup(name);
+ }
+
else if (m.equals(isIdentical))
{
return new
Boolean(((EJBObject)args[0]).getPrimaryKey().equals(cacheKey.id));
1.16 +12 -1
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulSessionProxy.java
Index: StatefulSessionProxy.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulSessionProxy.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- StatefulSessionProxy.java 2000/08/18 03:21:02 1.15
+++ StatefulSessionProxy.java 2000/10/16 23:37:00 1.16
@@ -9,8 +9,10 @@
import java.io.IOException;
import java.lang.reflect.Method;
import java.rmi.MarshalledObject;
+import javax.naming.InitialContext;
import javax.ejb.EJBObject;
+import javax.ejb.EJBHome;
import javax.naming.Name;
import org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker;
@@ -21,7 +23,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class StatefulSessionProxy
extends GenericProxy
@@ -36,6 +38,7 @@
static Method getPrimaryKey;
static Method getHandle;
+ static Method getEJBHome;
static Method isIdentical;
static Method toStr;
static Method eq;
@@ -48,6 +51,7 @@
// EJBObject methods
getPrimaryKey = EJBObject.class.getMethod("getPrimaryKey", new Class[0]);
getHandle = EJBObject.class.getMethod("getHandle", new Class[0]);
+ getEJBHome = EJBObject.class.getMethod("getEJBHome", new Class[0]);
isIdentical = EJBObject.class.getMethod("isIdentical", new Class[] {
EJBObject.class });
// Object methods
@@ -104,6 +108,13 @@
{
return new StatefulHandleImpl(name, id);
}
+
+
+ else if (m.equals(getEJBHome))
+ {
+ return (EJBHome) new InitialContext().lookup(name);
+ }
+
else if (m.equals(getPrimaryKey))
{
1.11 +13 -2
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatelessSessionProxy.java
Index: StatelessSessionProxy.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatelessSessionProxy.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- StatelessSessionProxy.java 2000/08/16 18:09:47 1.10
+++ StatelessSessionProxy.java 2000/10/16 23:37:00 1.11
@@ -9,9 +9,11 @@
import java.lang.reflect.Method;
import java.rmi.MarshalledObject;
+import javax.naming.InitialContext;
+import javax.naming.Name;
import javax.ejb.EJBObject;
-import javax.naming.Name;
+import javax.ejb.EJBHome;
import org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker;
@@ -21,7 +23,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.10 $
+* @version $Revision: 1.11 $
*/
public class StatelessSessionProxy
extends GenericProxy
@@ -34,6 +36,7 @@
static Method getPrimaryKey;
static Method getHandle;
+ static Method getEJBHome;
static Method isIdentical;
static Method toStr;
static Method eq;
@@ -46,6 +49,7 @@
// EJBObject methods
getPrimaryKey = EJBObject.class.getMethod("getPrimaryKey", new
Class[0]);
getHandle = EJBObject.class.getMethod("getHandle", new
Class[0]);
+ getEJBHome = EJBObject.class.getMethod("getEJBHome", new
Class[0]);
isIdentical = EJBObject.class.getMethod("isIdentical", new
Class[] { EJBObject.class });
// Object methods
@@ -125,6 +129,13 @@
// are equal within a home
return name;
}
+
+
+ else if (m.equals(getEJBHome))
+ {
+ return (EJBHome) new InitialContext().lookup(name);
+ }
+
else if (m.equals(isIdentical))
{
// All stateless beans are identical within a home, if the
names are equal we are equal