[jboss-cvs] JBossAS SVN: r57372 - in branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss: ejb invocation

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 2 22:02:19 EDT 2006


Author: ryan.campbell at jboss.com
Date: 2006-10-02 22:02:19 -0400 (Mon, 02 Oct 2006)
New Revision: 57372

Modified:
   branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/ejb/SecurityActions.java
   branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/invocation/InvokerInterceptor.java
Log:
ASPATCH-52: JBAS-3564: CallByValue is not marshalling certain data from CMP

Modified: branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/ejb/SecurityActions.java
===================================================================
--- branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/ejb/SecurityActions.java	2006-10-03 01:03:27 UTC (rev 57371)
+++ branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/ejb/SecurityActions.java	2006-10-03 02:02:19 UTC (rev 57372)
@@ -37,7 +37,7 @@
 import javax.security.jacc.PolicyContext;
 import javax.security.jacc.PolicyContextException;
   
-import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.MBeanProxy;
 import org.jboss.security.RunAsIdentity;
 import org.jboss.security.SecurityAssociation;
 
@@ -98,7 +98,7 @@
       }
       public Object run() throws Exception
       {
-         Object proxy = MBeanProxyExt.create(iface, name, server);
+         Object proxy = MBeanProxy.get(iface, name, server);
          Class[] ifaces = {iface};
          InvocationHandler secureHandler = new InvocationHandlerAction(proxy);
          Object secureProxy = Proxy.newProxyInstance(iface.getClassLoader(), ifaces, secureHandler);
@@ -145,7 +145,7 @@
       Object proxy;
       if( System.getSecurityManager() == null )
       {
-         proxy = MBeanProxyExt.create(iface, name, server);
+         proxy = MBeanProxy.get(iface, name, server);
       }
       else
       {

Modified: branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/invocation/InvokerInterceptor.java
===================================================================
--- branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/invocation/InvokerInterceptor.java	2006-10-03 01:03:27 UTC (rev 57371)
+++ branches/JBoss_4_0_4_GA_CP/server/src/main/org/jboss/invocation/InvokerInterceptor.java	2006-10-03 02:02:19 UTC (rev 57372)
@@ -28,6 +28,9 @@
 import java.lang.reflect.UndeclaredThrowableException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 import javax.transaction.Transaction;
 
@@ -306,14 +309,45 @@
 
     /**  It is too expensive to serialize this entire object just to get class isolation
          and MarshalledValues on local calls.
-         We are creating an in-memory copy without using serialization for that matter. */
-    private MarshalledInvocation createInvocationCopy(Invocation invocation, IMarshalledValue value) {
+         We are creating an in-memory copy without using serialization for that matter. 
+     * @throws ClassNotFoundException 
+     * @throws IOException */
+    private MarshalledInvocation createInvocationCopy(Invocation invocation, IMarshalledValue value) throws IOException, ClassNotFoundException {
+    	
+    		
         MarshalledInvocation invocationCopy = new MarshalledInvocation(invocation);
         invocationCopy.setMethod(null);
         invocationCopy.setMethodHash(MarshalledInvocation.calculateHash(invocation.getMethod()));
         invocationCopy.setMarshalledArguments(value);
         invocationCopy.setArguments(null);
+        
+    	InvocationContext copyContext = null;
+    	if (invocation.getInvocationContext()!=null)
+    	{
+    		copyContext = (InvocationContext)createMarshalledValueForCallByValue(invocation.getInvocationContext()).get();
+    	}
+        invocationCopy.setInvocationContext(copyContext);
+        
+        Map payLoad = invocation.getPayload();
+        Map payloadCopy = new HashMap();
+        
+        if (payLoad!=null && payLoad.size()!=0)
+        {
+        	
+            Iterator keys = payLoad.keySet().iterator();
+            while (keys.hasNext())
+            {
+               Object currentKey = keys.next();
+               Object valueSource = payLoad.get(currentKey);
+               
+               payloadCopy.put(currentKey,this.createMarshalledValueForCallByValue(valueSource));
+            }
+        }
 
+        invocationCopy.payload = payloadCopy;
+        
+        
+
         return invocationCopy;
     }
 




More information about the jboss-cvs-commits mailing list