User: ejort
Date: 01/12/31 01:20:06
Modified: src/main/org/jboss/proxy/ejb EntityProxy.java HomeProxy.java
StatefulSessionProxy.java
StatelessSessionProxy.java
Log:
Include the transaction on bean-2-bean invocations
Revision Changes Path
1.2 +13 -11 jboss/src/main/org/jboss/proxy/ejb/EntityProxy.java
Index: EntityProxy.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/proxy/ejb/EntityProxy.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EntityProxy.java 2001/12/19 07:20:36 1.1
+++ EntityProxy.java 2001/12/31 09:20:05 1.2
@@ -29,7 +29,7 @@
/**
* An EJB entity bean proxy class.
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.1 $
+* @version $Revision: 1.2 $
*
* <p><b>2001/11/19: marcf</b>
* <ol>
@@ -135,21 +135,23 @@
}
}
public Invocation createInvocation(CacheKey id, Method m, Object[] args)
+ throws Exception
{
Invocation invocation = new Invocation(new HashMap());
-
+
invocation.setContainer(objectName);
invocation.setType("remote");
invocation.setId(id);
invocation.setMethod(m);
- invocation.setArguments(args);
-
+ invocation.setArguments(args);
+ invocation.setTransaction(getTransaction());
+
return invocation;
}
// Package protected ---------------------------------------------
-
+
// Protected -----------------------------------------------------
-
+
/**
* Externalization support.
*
@@ -163,7 +165,7 @@
super.writeExternal(out);
out.writeObject(cacheKey);
}
-
+
/**
* Externalization support.
*
@@ -177,11 +179,11 @@
{
super.readExternal(in);
cacheKey = (CacheKey)in.readObject();
-
+
// Private -------------------------------------------------------
-
+
// Inner classes -------------------------------------------------
}
}
-
-
\ No newline at end of file
+
+
1.2 +21 -19 jboss/src/main/org/jboss/proxy/ejb/HomeProxy.java
Index: HomeProxy.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/proxy/ejb/HomeProxy.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HomeProxy.java 2001/12/19 07:20:36 1.1
+++ HomeProxy.java 2001/12/31 09:20:05 1.2
@@ -38,7 +38,7 @@
* The client-side proxy for an EJB Home object.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.1 $
+* @version $Revision: 1.2 $
*
* <p><b>2001/11/21: marcf</b>
* <ol>
@@ -49,7 +49,7 @@
extends GenericProxy
{
// Constants -----------------------------------------------------
-
+
/** Serial Version Identifier. */
// private static final long serialVersionUID = 432426690456622923L;
@@ -159,10 +159,10 @@
else if (m.equals(REMOVE_BY_HANDLE)) {
// First get the EJBObject
EJBObject object = ((Handle) args[0]).getEJBObject();
-
+
// remove the object from here
object.remove();
-
+
// Return Void
return Void.TYPE;
}
@@ -170,15 +170,15 @@
// Session beans must throw RemoveException (EJB 1.1, 5.3.2)
if (ejbMetaData.isSession())
throw new RemoveException("Session beans cannot be removed by primary
key.");
-
+
// The trick is simple we trick the container in believe it
// is a remove() on the instance
Object id = new CacheKey(args[0]);
-
+
// create an invocation for the new format
-
+
Invocation invocation = new Invocation(new HashMap());
-
+
invocation.setContainer(objectName);
invocation.setId(id);
invocation.setType("remote");
@@ -186,31 +186,33 @@
invocation.setArguments(EMPTY_ARGS);
return invoke(invocation);
}
-
-
+
+
// If not taken care of, go on and call the container
- else {
-
+ else {
+
// Create an Invocation
-
+
return invoke(createInvocation(m, args));
}
}
-
-
+
+
public Invocation createInvocation(Method m, Object[] arguments)
+ throws Exception
{
-
+
Invocation invocation = new Invocation(new HashMap());
-
+
invocation.setContainer(objectName);
invocation.setType("home");
invocation.setMethod(m);
invocation.setArguments(arguments);
-
+ invocation.setTransaction(getTransaction());
+
return invocation;
}
-
+
/**
* Externalization support.
*
1.2 +11 -9 jboss/src/main/org/jboss/proxy/ejb/StatefulSessionProxy.java
Index: StatefulSessionProxy.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/proxy/ejb/StatefulSessionProxy.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatefulSessionProxy.java 2001/12/19 07:20:36 1.1
+++ StatefulSessionProxy.java 2001/12/31 09:20:05 1.2
@@ -30,7 +30,7 @@
* An EJB stateful session bean proxy class.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.1 $
+* @version $Revision: 1.2 $
*
* <p><b>2001/11/23: marcf</b>
* <ol>
@@ -49,7 +49,7 @@
/** JBoss generated identifier. */
protected Object id;
-
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -107,17 +107,17 @@
else if (m.equals(HASH_CODE)) {
return new Integer(id.hashCode());
}
-
+
// Implement local EJB calls
else if (m.equals(GET_HANDLE)) {
return new StatefulHandleImpl(jndiName,invoker.getServerHostName(), id);
}
else if (m.equals(GET_EJB_HOME)) {
-
+
return getEJBHome();
}
else if (m.equals(GET_PRIMARY_KEY)) {
-
+
return id;
}
else if (m.equals(IS_IDENTICAL)) {
@@ -125,14 +125,15 @@
// See above, this is not correct but works for now (do jboss1.0 PKHolder
hack in here)
return isIdentical(args[0], id);
}
-
+
// If not taken care of, go on and call the container
else {
return invoke(createInvocation(id, m, args));
}
}
-
- public Invocation createInvocation(Object id, Method m, Object[] args)
+
+ public Invocation createInvocation(Object id, Method m, Object[] args)
+ throws Exception
{
Invocation invocation = new Invocation(new HashMap());
invocation.setContainer(objectName);
@@ -140,7 +141,8 @@
invocation.setId(id);
invocation.setMethod(m);
invocation.setArguments(args);
-
+ invocation.setTransaction(getTransaction());
+
return invocation;
}
1.2 +8 -6 jboss/src/main/org/jboss/proxy/ejb/StatelessSessionProxy.java
Index: StatelessSessionProxy.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/proxy/ejb/StatelessSessionProxy.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatelessSessionProxy.java 2001/12/19 07:20:36 1.1
+++ StatelessSessionProxy.java 2001/12/31 09:20:05 1.2
@@ -18,7 +18,7 @@
* An EJB stateless session bean proxy class.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.1 $
+* @version $Revision: 1.2 $
*
* <p><b>2001/11/23: marcf</b>
* <ol>
@@ -104,21 +104,23 @@
// if the names are equal we are equal
return isIdentical(args[0], jndiName);
}
-
+
// If not taken care of, go on and call the container
else {
return invoke(createInvocation(m, args));
}
}
-
- public Invocation createInvocation(Method m, Object[] args)
+
+ public Invocation createInvocation(Method m, Object[] args)
+ throws Exception
{
Invocation invocation = new Invocation(new HashMap());
-
+
invocation.setContainer(objectName);
invocation.setType("remote");
invocation.setMethod(m);
- invocation.setArguments(args);
+ invocation.setArguments(args);
+ invocation.setTransaction(getTransaction());
return invocation;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development