| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Seasar.Framework.Container\IS2Container.cs | - | - | - | - |
|
1 | #region Copyright | |
2 | /* | |
3 | * Copyright 2005 the Seasar Foundation and the Others. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | |
14 | * either express or implied. See the License for the specific language | |
15 | * governing permissions and limitations under the License. | |
16 | */ | |
17 | #endregion | |
18 | ||
19 | using System; | |
20 | using System.Web; | |
21 | using System.Web.SessionState; | |
22 | ||
23 | namespace Seasar.Framework.Container | |
24 | { | |
25 | /// <summary> | |
26 | /// コンポーネントを管理するDIコンテナのインターフェース | |
27 | /// </summary> | |
28 | public interface IS2Container : IMetaDefAware | |
29 | { | |
30 | ||
31 | /// <summary> | |
32 | /// キーを指定してコンポーネントを取得します。 | |
33 | /// キーと一致するコンポーネント名を持つコンポーネントを取得します。 | |
34 | /// </summary> | |
35 | /// <param name="componentKey">コンポーネントを取得するためのキー</param> | |
36 | /// <returns>コンポーネント</returns> | |
37 | Object GetComponent(object componentKey); | |
38 | ||
39 | /// <summary> | |
40 | /// 外部コンポーネントにプロパティ・インジェクション、 | |
41 | /// メソッド・インジェクションを実行します。 | |
42 | /// 外部コンポーネントと互換性のあるコンポーネント定義を利用します。 | |
43 | /// instanceモードが"outer"と定義されたコンポーネントのみ有効です。 | |
44 | /// </summary> | |
45 | /// <param name="outerComponent">外部コンポーネント</param> | |
46 | void InjectDependency(Object outerComponent); | |
47 | ||
48 | /// <summary> | |
49 | /// 外部コンポーネントにプロパティ・インジェクション、 | |
50 | /// メソッド・インジェクションを実行します。 | |
51 | /// 外部コンポーネント定義のキーと互換性のある | |
52 | /// コンポーネント定義を利用します。 | |
53 | /// instanceモードが"outer"と定義されたコンポーネントのみ有効です。 | |
54 | /// </summary> | |
55 | /// <param name="outerComponent">外部コンポーネント</param> | |
56 | /// <param name="componentType">外部コンポーネント定義のキー(Type)</param> | |
57 | void InjectDependency(Object outerComponent,Type componentType); | |
58 | ||
59 | /// <summary> | |
60 | /// 外部コンポーネントにプロパティ・インジェクション、 | |
61 | /// メソッド・インジェクションを実行します。 | |
62 | /// 外部コンポーネント定義のキーと一致する名前のコンポーネント定義を | |
63 | /// 取得します。 | |
64 | /// instanceモードが"outer"と定義されたコンポーネントのみ有効です。 | |
65 | /// </summary> | |
66 | /// <param name="outerComponent">外部コンポーネント</param> | |
67 | /// <param name="componentName">外部コンポーネント定義のキー(名前)</param> | |
68 | void InjectDependency(Object outerComponent,string componentName); | |
69 | ||
70 | /// <summary> | |
71 | /// オブジェクトをコンポーネントとして登録します。 | |
72 | /// キーはオブジェクトのクラスになります。 | |
73 | /// </summary> | |
74 | /// <param name="component">コンポーネントとして登録するオブジェクト</param> | |
75 | void Register(Object component); | |
76 | ||
77 | /// <summary> | |
78 | /// オブジェクトを名前付きコンポーネントとして登録します。 | |
79 | /// </summary> | |
80 | /// <param name="component">コンポーネントとして登録するオブジェクト</param> | |
81 | /// <param name="componentName">コンポーネント名</param> | |
82 | void Register(Object component,string componentName); | |
83 | ||
84 | /// <summary> | |
85 | /// Typeをコンポーネント定義として登録します | |
86 | /// </summary> | |
87 | /// <param name="componentType">コンポーネントのType</param> | |
88 | void Register(Type componentType); | |
89 | ||
90 | /// <summary> | |
91 | /// Typeを名前付きコンポーネント定義として登録します。 | |
92 | /// </summary> | |
93 | /// <param name="componentType">コンポーネントのType</param> | |
94 | /// <param name="componentName">コンポーネント名</param> | |
95 | void Register(Type componentType,string componentName); | |
96 | ||
97 | /// <summary> | |
98 | /// コンポーネント定義を登録します。 | |
99 | /// </summary> | |
100 | /// <param name="componentDef">登録するコンポーネント定義</param> | |
101 | void Register(IComponentDef componentDef); | |
102 | ||
103 | /// <summary> | |
104 | /// コンポーネント定義の数を取得します。 | |
105 | /// </summary> | |
106 | int ComponentDefSize{get;} | |
107 | ||
108 | /// <summary> | |
109 | /// 番号を指定してコンポーネント定義を取得します。 | |
110 | /// </summary> | |
111 | /// <param name="index">番号</param> | |
112 | /// <returns>コンポーネント定義</returns> | |
113 | IComponentDef GetComponentDef(int index); | |
114 | ||
115 | /// <summary> | |
116 | /// 指定したキーからコンポーネント定義を取得します。 | |
117 | /// </summary> | |
118 | /// <param name="componentName">コンポーネントのキー</param> | |
119 | /// <returns>コンポーネント定義</returns> | |
120 | IComponentDef GetComponentDef(object key); | |
121 | ||
122 | /// <summary> | |
123 | /// 指定したキーのコンポーネント定義を持っているか判定します。 | |
124 | /// </summary> | |
125 | /// <param name="componentKey">コンポーネントのキー</param> | |
126 | /// <returns>存在するならtrue</returns> | |
127 | bool HasComponentDef(object componentKey); | |
128 | ||
129 | /// <summary> | |
130 | /// rootのコンテナで、pathに対応するコンテナが既にロードされて | |
131 | /// いるかを返します。 | |
132 | /// </summary> | |
133 | /// <param name="path">パス</param> | |
134 | /// <returns>ロードされていたらtrue</returns> | |
135 | bool HasDescendant(string path); | |
136 | ||
137 | /// <summary> | |
138 | /// rootのコンテナで、指定したパスに対応するロード済みのコンテナを | |
139 | /// 取得します。 | |
140 | /// </summary> | |
141 | /// <param name="path"></param> | |
142 | /// <returns></returns> | |
143 | IS2Container GetDescendant(string path); | |
144 | ||
145 | /// <summary> | |
146 | /// rootのコンテナに、ロード済みのコンテナを登録します。 | |
147 | /// </summary> | |
148 | /// <param name="descendant"></param> | |
149 | void RegisterDescendant(IS2Container descendant); | |
150 | ||
151 | /// <summary> | |
152 | /// 子コンテナをincludeします。 | |
153 | /// </summary> | |
154 | /// <param name="child">includeする子コンテナ</param> | |
155 | void Include(IS2Container child); | |
156 | ||
157 | /// <summary> | |
158 | /// 子コンテナの数を取得します。 | |
159 | /// </summary> | |
160 | int ChildSize{get;} | |
161 | ||
162 | /// <summary> | |
163 | /// 番号を指定して子コンテナを取得します | |
164 | /// </summary> | |
165 | /// <param name="index">子コンテナの番号</param> | |
166 | /// <returns>子コンテナ</returns> | |
167 | IS2Container GetChild(int index); | |
168 | ||
169 | /// <summary> | |
170 | /// コンテナを初期化します。 | |
171 | /// 子コンテナを持つ場合、子コンテナを全て初期化した後、自分を初期化します。 | |
172 | /// </summary> | |
173 | void Init(); | |
174 | ||
175 | /// <summary> | |
176 | /// 名前空間 | |
177 | /// </summary> | |
178 | string Namespace{set;get;} | |
179 | ||
180 | /// <summary> | |
181 | /// 設定ファイルのパス | |
182 | /// </summary> | |
183 | string Path{set;get;} | |
184 | ||
185 | /// <summary> | |
186 | /// ルートのコンテナ | |
187 | /// </summary> | |
188 | IS2Container Root{set;get;} | |
189 | ||
190 | /// <summary> | |
191 | /// コンテナの終了処理を行います。 | |
192 | /// 子コンテナを持つ場合、自分の終了処理を実行した後、 | |
193 | /// 子コンテナ全ての終了処理を行います。 | |
194 | /// </summary> | |
195 | void Destroy(); | |
196 | ||
197 | /// <summary> | |
198 | /// HTTPのレスポンス | |
199 | /// </summary> | |
200 | HttpResponse Response { get; } | |
201 | ||
202 | /// <summary> | |
203 | /// HTTPのリクエスト | |
204 | /// </summary> | |
205 | HttpRequest Request { get; } | |
206 | ||
207 | /// <summary> | |
208 | /// HTTPのセッション | |
209 | /// </summary> | |
210 | HttpSessionState Session { get; } | |
211 | ||
212 | /// <summary> | |
213 | /// アプリケーションの基本クラス | |
214 | /// </summary> | |
215 | HttpApplication HttpApplication { get; } | |
216 | ||
217 | /// <summary> | |
218 | /// HTTP 要求に関する HTTP 固有のすべての情報 | |
219 | /// </summary> | |
220 | HttpContext HttpContext { set;get; } | |
221 | } | |
222 | } | |
223 |
|