View Javadoc

1   /*
2    * Copyright 2004-2008 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.cubby.controller;
17  
18  import java.lang.reflect.Method;
19  
20  import org.seasar.cubby.action.Action;
21  import org.seasar.cubby.action.ActionResult;
22  import org.seasar.cubby.action.Validation;
23  import org.seasar.cubby.dxo.FormDxo;
24  import org.seasar.framework.container.ComponentDef;
25  
26  /**
27   * アクションメソッドの実行時コンテキストです。
28   * 
29   * @author agata
30   * @author baba
31   * @since 1.0.0
32   */
33  public interface ActionContext {
34  
35  	/**
36  	 * このコンテキストを初期化します。
37  	 * 
38  	 * @param actionDef
39  	 *            アクションの定義
40  	 */
41  	void initialize(ActionDef actionDef);
42  
43  	/**
44  	 * このコンテキストが初期化されているかを示します。
45  	 * 
46  	 * @return このコンテキストが初期化されている場合は <code>true</code>、そうでない場合は
47  	 *         <code>false</code>
48  	 */
49  	boolean isInitialized();
50  
51  	/**
52  	 * このコンテキストが保持するアクションを実行します。
53  	 * 
54  	 * @return アクションの実行結果
55  	 * @throws Exception
56  	 *             アクションが例外をスローした場合
57  	 */
58  	ActionResult invoke() throws Exception;
59  
60  	/**
61  	 * アクションのコンポーネントの定義を取得します。
62  	 * 
63  	 * @return コンポーネントの定義
64  	 */
65  	ComponentDef getComponentDef();
66  
67  	/**
68  	 * アクションのオブジェクトを取得します。
69  	 * 
70  	 * @return アクションのオブジェクト
71  	 */
72  	Action getAction();
73  
74  	/**
75  	 * アクションメソッドを取得します。
76  	 * 
77  	 * @return アクションメソッド
78  	 */
79  	Method getMethod();
80  
81  	/**
82  	 * アクションの入力検証の定義を取得します。
83  	 * 
84  	 * @return アクションの入力検証の定義
85  	 */
86  	Validation getValidation();
87  
88  	/**
89  	 * アクションのフォームオブジェクトを取得します。
90  	 * 
91  	 * @return アクションのフォームオブジェクト
92  	 */
93  	Object getFormBean();
94  
95  	/**
96  	 * リクエストパラメータとフォームオブジェクトを変換する DXO を取得します
97  	 * 
98  	 * @return リクエストパラメータとフォームオブジェクトを変換する DXO
99  	 */
100 	FormDxo getFormDxo();
101 
102 }