1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.struts.chain.commands;
19
20 import org.apache.commons.logging.Log;
21 import org.apache.commons.logging.LogFactory;
22 import org.apache.commons.chain.Context;
23 import org.apache.struts.chain.contexts.ActionContext;
24
25 /***
26 * <p>Simple abstract class which avoids frequent casting to
27 * <code>ActionContext</code> in commands explicitly intended for use with
28 * that class.</p>
29 */
30 public abstract class ActionCommandBase implements ActionCommand {
31
32 /***
33 * <p> Provide Commons Logging instance for this class. </p>
34 */
35 private static final Log LOG =
36 LogFactory.getLog(ActionCommandBase.class);
37
38
39 public abstract boolean execute(ActionContext actionContext)
40 throws Exception;
41
42
43 public boolean execute(Context context)
44 throws Exception {
45 if (LOG.isDebugEnabled()) {
46 LOG.debug("Executing " + getClass().getName());
47 }
48 return execute((ActionContext) context);
49 }
50 }