<commit_before>/*
 * Copyright 2002-2004 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.web.flow;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * An action that executes controller, mediator (bridge), and/or command-like
 * behavior. Actions typically delegate down to the service-layer to perform
 * business operations, and/or prep views with dynamic model data for rendering.
 * They act as a bridge between the web-tier (browser/views) and the middle-tier
 * (service layer).
 * <p>
 * Action implementations are typically singletons instantiated and managed by
 * Spring to take advantage of Spring's powerful configuration and dependency
 * injection (wiring) capabilities. Actions can also be directly instantiated
 * for use im a standalone test environment and parameterized with mocks or
 * stubs, as they are simple POJOs.
 * <p>
 * Note: because Actions are singletons, take care not to store and/or modify
 * caller-specific state. The Action execute method always runs in its own
 * thread, so make you deal only with local data or internal, thread-safe
 * services.
 * 
 * @author <NAME>
 * @author <NAME>
 */
public interface Action {

	/**
	 * Execute this action. Action execution will occur in the context of the
	 * current request. Execution is typically triggered in production when an
	 * <code>ActionState</code> is entered in an ongoing
	 * <code>FlowExecution</code> for a specific <code>Flow</code>
	 * definition.
	 * <p>
	 * Note: The <code>MutableAttributesAccessor</code> model argument to this
	 * method provides access to the <b>data model </b> of the active flow
	 * session. All attributes in the flow model are considered in "flow scope";
	 * that is, they exist for the life of the flow session and will be cleaned
	 * up when the flow session ends. All attributes in the flow model are
	 * automatically exported for convenient access by the views.
	 * <p>
	 * Note: The flow model should not be used as a general purpose cache; but
	 * rather as a context for data needed locally by the flows this action
	 * partcipates in. For example, it would be inappropriate to stuff large
	 * collections of objects (like those returned to support a search results
	 * view) into the flow model. Instead, put such result collections in the
	 * request, and ensure you execute the action again each time you wish to
	 * view those results. 2nd level caches are much better cache solutions.
	 * 
	 * @param request The current http request, enabling access to request
	 *        parameters and/or attributes if neccessary
	 * @param response The http response, enabling direct response writing by
	 *        the action if neccessary
	 * @param model The data model for the current flow session ("flow scope")
	 * @return A logical result outcome, used as grounds for a transition in the
	 *         current state
	 * @throws Exception An <b>unrecoverable </b> exception occured; note: any
	 *         recoverable exceptions should be caught and an appropriate result
	 *         outcome returned.
	 */
	public ActionResult execute(HttpServletRequest request, HttpServletResponse response,
			MutableAttributesAccessor model) throws Exception;
}<commit_msg>JavaDoc.<commit_after>/*
 * Copyright 2002-2004 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.web.flow;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * An action that executes controller, mediator (bridge), and/or command-like
 * behavior. Actions typically delegate down to the service-layer to perform
 * business operations, and/or prep views with dynamic model data for rendering.
 * They act as a bridge between the web-tier (browser/views) and the middle-tier
 * (service layer).
 * <p>
 * Action implementations are typically singletons instantiated and managed by
 * Spring to take advantage of Spring's powerful configuration and dependency
 * injection (wiring) capabilities. Actions can also be directly instantiated
 * for use in a standalone test environment and parameterized with mocks or
 * stubs, as they are simple POJOs.
 * <p>
 * Note: because Actions are singletons, take care not to store and/or modify
 * caller-specific state. The Action execute method always runs in its own
 * thread, so make sure you deal only with local data or internal, thread-safe
 * services.
 * 
 * @author <NAME>
 * @author <NAME>
 */
public interface Action {

	/**
	 * Execute this action. Action execution will occur in the context of the
	 * current request. Execution is typically triggered in production when an
	 * <code>ActionState</code> is entered in an ongoing
	 * <code>FlowExecution</code> for a specific <code>Flow</code>
	 * definition.
	 * <p>
	 * Note: The <code>MutableAttributesAccessor</code> model argument to this
	 * method provides access to the <b>data model</b> of the active flow
	 * session. All attributes in the flow model are considered in "flow scope";
	 * that is, they exist for the life of the flow session and will be cleaned
	 * up when the flow session ends. All attributes in the flow model are
	 * automatically exported for convenient access by the views.
	 * <p>
	 * Note: The flow model should not be used as a general purpose cache; but
	 * rather as a context for data needed locally by the flows this action
	 * partcipates in. For example, it would be inappropriate to stuff large
	 * collections of objects (like those returned to support a search results
	 * view) into the flow model. Instead, put such result collections in the
	 * request, and ensure you execute the action again each time you wish to
	 * view those results. 2nd level caches are much better cache solutions.
	 * 
	 * @param request The current http request, enabling access to request
	 *        parameters and/or attributes if neccessary
	 * @param response The http response, enabling direct response writing by
	 *        the action if neccessary
	 * @param model The data model for the current flow session ("flow scope")
	 * @return A logical result outcome, used as grounds for a transition in the
	 *         current state
	 * @throws Exception An <b>unrecoverable</b> exception occured, either
	 *         checked or unchecked; note: any recoverable exceptions should be
	 *         caught and an appropriate result outcome returned.
	 */
	public ActionResult execute(HttpServletRequest request, HttpServletResponse response,
			MutableAttributesAccessor model) throws Exception;
}
{'fraction_non_alphanumeric': 0.06322664924885696, 'fraction_numerical': 0.0033964728935336383, 'mean_word_length': 3.860952380952381, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '250483', 'n_tokens_mistral': 1911, 'n_tokens_neox': 1788, 'n_words': 1005}