Package org.apache.struts.chain.commands
Class ExecuteCommand
java.lang.Object
org.apache.struts.chain.commands.ActionCommandBase
org.apache.struts.chain.commands.ExecuteCommand
- All Implemented Interfaces:
org.apache.commons.chain.Command<ActionContext>
,ActionCommand
- Direct Known Subclasses:
ExecuteForwardCommand
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.
-
Field Summary
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
execute_
(ActionContext actionCtx) If thecontext
is "valid", lookup a command and execute it.protected org.apache.commons.chain.Command
<ActionContext> getCommand
(String commandName, String catalogName) Retrieve the specified Command from the specified Catalog.protected org.apache.commons.chain.Command
<ActionContext> getCommand
(ActionContext context) Find theActionConfig
in the current context and, if it is properly configured, lookup the appropriatecommons-chain
command.protected boolean
shouldProcess
(ActionContext context) Evaluate the current context to see if a command should even be executed.Methods inherited from class org.apache.struts.chain.commands.ActionCommandBase
execute
-
Constructor Details
-
ExecuteCommand
public ExecuteCommand()
-
-
Method Details
-
execute_
If thecontext
is "valid", lookup a command and execute it.- Specified by:
execute_
in classActionCommandBase
- Parameters:
actionCtx
- TheActionContext
for the current request- Returns:
- the result of the lookup command's
execute
method, if executed, orfalse
if it was not executed. - Throws:
Exception
- on any error
-
shouldProcess
Evaluate the current context to see if a command should even be executed.- Parameters:
context
- A valid ActionContext- Returns:
- TRUE if the pending Command should be executed
-
getCommand
Find theActionConfig
in the current context and, if it is properly configured, lookup the appropriatecommons-chain
command.- Parameters:
context
- A valid ActionContext- Returns:
- a
Command
to execute, or null if none is specified or if the specified command cannot be found.
-
getCommand
protected org.apache.commons.chain.Command<ActionContext> getCommand(String commandName, String catalogName) Retrieve the specified Command from the specified Catalog.- Parameters:
commandName
- The Command to retrieve.catalogName
- The Catalog to search.- Returns:
- Instantiated Command, or null
-