User: oberg
Date: 00/08/15 23:44:49
Modified: src/main/org/jboss/ejb/plugins/jrmp/server
JRMPContainerInvoker.java
Log:
Made proxies implement Externalizable as a performance fix.
Added MarshalledObject wrapping on return values to fix classloader problems
Revision Changes Path
1.15 +14 -11
jboss/src/main/org/jboss/ejb/plugins/jrmp/server/JRMPContainerInvoker.java
Index: JRMPContainerInvoker.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/server/JRMPContainerInvoker.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- JRMPContainerInvoker.java 2000/08/14 19:30:41 1.14
+++ JRMPContainerInvoker.java 2000/08/16 06:44:48 1.15
@@ -71,7 +71,7 @@
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien
Alborini</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.14 $
+ * @version $Revision: 1.15 $
*/
public abstract class JRMPContainerInvoker
extends RemoteServer
@@ -91,7 +91,7 @@
protected HashMap beanMethodInvokerMap;
protected HashMap homeMethodInvokerMap;
-
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -123,7 +123,7 @@
public abstract Collection getEntityCollection(Collection ids);
// ContainerRemote implementation --------------------------------
- public Object invokeHome(MarshalledObject mimo)
+ public MarshalledObject invokeHome(MarshalledObject mimo)
throws Exception
{
ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
@@ -141,8 +141,8 @@
if (tx == null)
tx = container.getTransactionManager().getTransaction();
- return invokeHome(rmi.getMethod(), rmi.getArguments(), tx,
- rmi.getPrincipal(), rmi.getCredential() );
+ return new MarshalledObject(invokeHome(rmi.getMethod(),
rmi.getArguments(), tx,
+ rmi.getPrincipal(), rmi.getCredential() ));
} catch (Exception e)
{
e.printStackTrace();
@@ -153,24 +153,27 @@
}
}
- public Object invoke(MarshalledObject mimo)
+ public MarshalledObject invoke(MarshalledObject mimo)
throws Exception
{
ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(container.getClassLoader());
-
+
try
{
RemoteMethodInvocation rmi = (RemoteMethodInvocation)mimo.get();
rmi.setMethodMap(beanMethodInvokerMap);
-
Transaction tx = rmi.getTransaction();
// MF FIXME: there should be no implicit thread passing of the transaction
if (tx == null)
tx = container.getTransactionManager().getTransaction();
-
- return invoke(rmi.getId(), rmi.getMethod(), rmi.getArguments(), tx,
- rmi.getPrincipal(), rmi.getCredential() );
+
+ Object id = rmi.getId();
+ Method m = rmi.getMethod();
+ Object[] args = rmi.getArguments();
+
+ return new MarshalledObject(invoke(id, m, args, tx,
+ rmi.getPrincipal(), rmi.getCredential()));
} finally
{
Thread.currentThread().setContextClassLoader(oldCl);