[jbosscache-commits] JBoss Cache SVN: r8530 - core/trunk/src/main/java/org/jboss/cache/interceptors.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Aug 1 02:48:09 EDT 2012


Author: dereed
Date: 2012-08-01 02:48:07 -0400 (Wed, 01 Aug 2012)
New Revision: 8530

Modified:
   core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
Log:
[JBCACHE-1617] Skip unmarshalling of return values that will be discarded when making a remote call


Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java	2012-08-01 03:30:08 UTC (rev 8529)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java	2012-08-01 06:48:07 UTC (rev 8530)
@@ -26,6 +26,7 @@
 import org.jboss.cache.CacheException;
 import org.jboss.cache.InvocationContext;
 import org.jboss.cache.commands.VisitableCommand;
+import org.jboss.cache.commands.read.GravitateDataCommand;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.interceptors.base.CommandInterceptor;
@@ -313,7 +314,20 @@
    {
       InvocationContext ctxt = invocationContextContainer.get();
       ctxt.setOriginLocal(false);
-      return cacheCommand.acceptVisitor(ctxt, firstInChain);
+
+      // JBCACHE-1617 Don't unmarshall return values that are discarded by the only caller
+      // ReplicateCommand anyways (everything but GravitateDataCommand)
+      boolean originalBypassUnmarshalling = ctxt.isBypassUnmarshalling();
+      if ( ! ( cacheCommand instanceof GravitateDataCommand ) )
+         ctxt.setBypassUnmarshalling(true);
+      try
+      {  
+         return cacheCommand.acceptVisitor(ctxt, firstInChain);
+      }
+      finally
+      {
+         ctxt.setBypassUnmarshalling(originalBypassUnmarshalling);
+      }
    }
 
    /**



More information about the jbosscache-commits mailing list