tweed.invocation
Class CommandExecutor

java.lang.Object
  |
  +--tweed.invocation.CommandExecutor

public class CommandExecutor
extends java.lang.Object

This class helps the server executing a Command object with only its ExternalizedCommand as input/output parameter. It is intended only to be used when implementing a connectivity layer between client and server. Command implementors should not manipulate this class directly.

Version:
$Id$
Author:
Laurent Caillette

Constructor Summary
CommandExecutor(Context context)
           
 
Method Summary
 Command createCommand(java.lang.Class commandClass)
          Creates a new Command instance correctly configured.
 void execute(ExternalizedCommand externalizedCommand)
           
protected  java.lang.String getChildLoggerName()
          Returns the name of the child logger of Context's logger.
protected  Context getContext()
           
protected  org.apache.avalon.framework.logger.Logger getLogger()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandExecutor

public CommandExecutor(Context context)
Method Detail

getContext

protected final Context getContext()

getLogger

protected final org.apache.avalon.framework.logger.Logger getLogger()

getChildLoggerName

protected java.lang.String getChildLoggerName()
Returns the name of the child logger of Context's logger.

Returns:
the "command-executor" String.

execute

public void execute(ExternalizedCommand externalizedCommand)

createCommand

public Command createCommand(java.lang.Class commandClass)
Creates a new Command instance correctly configured. The exact behavior of a Command depends if the context is set to Client-side or Server-side.

Parameters:
commandClass - the concrete class of the Command to instantiate, cannot be null.
Returns:
a non-null Command instance.
Throws:
java.lang.RuntimeException - (wrapping an instantiation-related exception) if instantiation failed for some reason.


Copyright © 2003 Laurent Caillette. All Rights Reserved.