Class NonDelegatingCommand

java.lang.Object
org.apache.commons.chain.impl.NonDelegatingCommand
All Implemented Interfaces:
Command<Context>
Direct Known Subclasses:
AddingCommand, DelegatingCommand, DispatchLookupCommandTestCase.TestCommand, ExceptionCommand, NonDelegatingFilter

public class NonDelegatingCommand extends Object implements Command<Context>
Implementation of Command that simply logs its identifier and returns.
Version:
$Revision$ $Date$
Author:
Craig R. McClanahan
  • Field Details

    • id

      protected String id
      The identifier to log for this Command instance
  • Constructor Details

    • NonDelegatingCommand

    • NonDelegatingCommand

      Construct an instance that will log the specified identifier
      Parameters:
      id - identifier to log for this Command instance
  • Method Details

    • setId

      public void setId(String id)
    • execute

      public boolean execute(Context context) throws Exception
      Execution method for this Command
      Specified by:
      execute in interface Command<Context>
      Parameters:
      context - The Context to be processed by this Command
      Returns:
      true if the processing of this Context has been completed, or false if the processing of this Context should be delegated to a subsequent Command in an enclosing Chain
      Throws:
      Exception - general purpose exception return to indicate abnormal termination
      IllegalArgumentException - if context is null
    • log

      protected void log(Context context, String id)
      Log the specified id into a StringBuffer attribute named "log" in the specified context, creating it if necessary.
      Parameters:
      context - The Context into which we log the identifiers
      id - The identifier to be logged