public class ExecuteCommand extends ActionCommandBase
Invoke the appropriate Command for this request. If the
context's ActionConfig has no command property
defined, no action will be taken. If the specified command cannot be
found, a warning will be logged, but processing will continue. Depending
on how the chain is configured, this can be used in place of an
Action or as a method of performing pre-processing.
If used instead of an action, the command which is looked up should put an ActionForward into the context, unless it has already dealt with the response.
| Constructor and Description |
|---|
ExecuteCommand() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(ActionContext actionCtx)
If the
context is "valid", lookup a command and execute
it. |
protected org.apache.commons.chain.Command |
getCommand(ActionContext context)
Find the
ActionConfig in the current context and, if it
is properly configured, lookup the appropriate commons-chain
command. |
protected org.apache.commons.chain.Command |
getCommand(java.lang.String commandName,
java.lang.String catalogName)
Retrieve the specified Command from the specified Catalog.
|
protected boolean |
shouldProcess(ActionContext context)
Evaluate the current context to see if a command should even be
executed.
|
executepublic boolean execute(ActionContext actionCtx) throws java.lang.Exception
If the context is "valid", lookup a command and execute
it.
execute in interface ActionCommandexecute in class ActionCommandBaseactionCtx - The Context for the current requestexecute method,
if executed, or false if it was not executed.java.lang.Exception - on any errorprotected boolean shouldProcess(ActionContext context)
Evaluate the current context to see if a command should even be executed.
context - A valid ActionContextprotected org.apache.commons.chain.Command getCommand(ActionContext context)
Find the ActionConfig in the current context and, if it
is properly configured, lookup the appropriate commons-chain
command.
context - A valid ActionContextCommand to execute, or null if none is specified
or if the specified command cannot be found.protected org.apache.commons.chain.Command getCommand(java.lang.String commandName,
java.lang.String catalogName)
Retrieve the specified Command from the specified Catalog.
commandName - The Command to retrieve.catalogName - The Catalog to search.Copyright © 2000–2024 Apache Software Foundation. All rights reserved.