tweed.invocation
Class LoopbackInvoker

java.lang.Object
  |
  +--tweed.invocation.CommandInvoker
        |
        +--tweed.invocation.LoopbackInvoker

public class LoopbackInvoker
extends CommandInvoker

This invoker calls a CommandExecutor which resides in the same VM. Travel of the ExternalizedCommand between client and server is simulated with serialization / deserialization in memory.

This is especially useful for building tests. Command implementors should not manipulate this class directly.

Version:
$Id$
Author:
Laurent Caillette

Field Summary
 
Fields inherited from class tweed.invocation.CommandInvoker
CHILDLOGGER_NAME
 
Constructor Summary
LoopbackInvoker(Context context)
           
 
Method Summary
protected  ExternalizedCommand doInvoke(ExternalizedCommand externalizedCommand)
           
 CommandExecutor getExecutor()
           
 void setExecutor(CommandExecutor executor)
           
protected  ExternalizedCommand simulateTravel(ExternalizedCommand externalizedCommand)
          Serializes / deserializes ExternalizedCommand in memory to simulate travel between client and server.
 
Methods inherited from class tweed.invocation.CommandInvoker
getContext, getLogger, invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoopbackInvoker

public LoopbackInvoker(Context context)
Method Detail

getExecutor

public CommandExecutor getExecutor()

setExecutor

public void setExecutor(CommandExecutor executor)

simulateTravel

protected ExternalizedCommand simulateTravel(ExternalizedCommand externalizedCommand)
                                      throws java.io.IOException
Serializes / deserializes ExternalizedCommand in memory to simulate travel between client and server.

Parameters:
externalizedCommand -
Returns:
an other instance of the ExternalizedCommand passed in input, after serialization /deserialization.
java.io.IOException

doInvoke

protected ExternalizedCommand doInvoke(ExternalizedCommand externalizedCommand)
                                throws java.io.IOException
Specified by:
doInvoke in class CommandInvoker
java.io.IOException


Copyright © 2003 Laurent Caillette. All Rights Reserved.