|
From: Tom E. <tom...@jb...> - 2006-07-07 19:49:32
|
User: telrod
Date: 06/07/07 15:49:30
Modified: src/main/org/jboss/remoting/transport/local
LocalClientInvoker.java
Log:
JBREM-320 - convert pass by value to be handled by local client invoker instead of making remote call.
Revision Changes Path
1.13 +22 -3 JBossRemoting/src/main/org/jboss/remoting/transport/local/LocalClientInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalClientInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/local/LocalClientInvoker.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- LocalClientInvoker.java 23 May 2006 17:47:50 -0000 1.12
+++ LocalClientInvoker.java 7 Jul 2006 19:49:30 -0000 1.13
@@ -43,12 +43,13 @@
* same JVM as the callback server.
*
* @author <a href="mailto:te...@vo...">Tom Elrod</a>
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public class LocalClientInvoker extends AbstractInvoker implements BidirectionalClientInvoker
{
private ServerInvoker serverInvoker;
private boolean isConnected = false;
+ private boolean byValue = false;
public LocalClientInvoker(InvokerLocator locator)
{
@@ -60,6 +61,12 @@
super(locator, configuration);
}
+ public LocalClientInvoker(InvokerLocator locator, Map configuration, boolean byValue)
+ {
+ super(locator, configuration);
+ this.byValue = byValue;
+ }
+
/**
* transport a request against a remote ServerInvoker
*
@@ -74,12 +81,19 @@
log.trace("Using local client invoker for invocation.");
}
+ InvocationRequest localInvocation = invocation;
+
+ if(byValue)
+ {
+ localInvocation = marshallInvocation(localInvocation);
+ }
+
Object ret = null;
if(serverInvoker != null)
{
try
{
- ret = serverInvoker.invoke(invocation);
+ ret = serverInvoker.invoke(localInvocation);
}
catch (ServerInvoker.InvalidStateException invalidStateEx)
{
@@ -109,7 +123,7 @@
if(newServerInvoker != null)
{
serverInvoker = newServerInvoker;
- ret = serverInvoker.invoke(invocation);
+ ret = serverInvoker.invoke(localInvocation);
}
else
{
@@ -126,6 +140,11 @@
return ret;
}
+ protected InvocationRequest marshallInvocation(InvocationRequest localInvocation)
+ {
+ return null;
+ }
+
/**
* subclasses must provide this method to return true if their remote connection is connected and
* false if disconnected. in some transports, such as SOAP, this method may always return true, since the
|