apps/example1/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java [30:69]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class CountCommand implements Command<String, Object,
        WebContext<String, Object>> {

    private Log log = LogFactory.getLog(CountCommand.class);

    private int count;

    private String attribute = "count";

    /**
     * Return the request attribute name to store the count under.
     *
     * @return The name of the request attribute
     */
    public String getAttribute() {
        return attribute;
    }

    /**
     * Set the request attribute name to store the count under.
     *
     * @param attribute The name of the request attribute
     */
    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }

    /**
     * <p>Execute the command.</p>
     *
     * @param context The {@link Context} we are operating on
     * @return {@link Processing#CONTINUE} so that processing will continue.
     */
    public Processing execute(WebContext<String, Object> context) {
        count++;
        log.info("Executing: " + attribute + "=" + count);

        context.getSessionScope().put(attribute, new Integer(count));

        return Processing.CONTINUE;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



apps/example2/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java [29:69]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class CountCommand implements Command<String, Object,
        WebContext<String, Object>> {

    private Log log = LogFactory.getLog(CountCommand.class);

    private int count;

    private String attribute = "count";

    /**
     * Return the request attribute name to store the count under.
     *
     * @return The name of the request attribute
     */
    public String getAttribute() {
        return attribute;
    }

    /**
     * Set the request attribute name to store the count under.
     *
     * @param attribute The name of the request attribute
     */
    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }

    /**
     * <p>Execute the command.</p>
     *
     *
     * @param context The {@link org.apache.commons.chain2.Context} we are operating on
     * @return {@link Processing#CONTINUE} so that processing will continue.
     */
    public Processing execute(WebContext<String, Object> context) {
        count++;
        log.info("Executing: " + attribute + "=" + count);

        context.getSessionScope().put(attribute, new Integer(count));

        return Processing.CONTINUE;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



