/* * Copyright 2004-2006 the Seasar Foundation and the Others. * * 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.seasar.framework.container; /** * コンポーネントの生成、 配備、 取得および、 外部コンポーネントへの依存コンポーネントのインジェクションを行う機能を提供するインターフェースです。 * *
* このインターフェースを実装するクラスは、 {@link InstanceDef コンポーネントインスタンス定義}に応じて、 * 以下のような機能を提供します。 *
* それぞれの{@link InstanceDef コンポーネントインスタンス定義}と有効なメソッドの対応表を以下に示します。
コンポーネントインスタンス定義と有効なメソッドとの関係 (○:有効、 ×:無効) | *|||||
---|---|---|---|---|---|
- | *メソッド | *||||
{@link InstanceDef コンポーネントインスタンス定義} | *{@link #deploy()} | *{@link #injectDependency(Object)} | *{@link #init()} | *{@link #destroy()} | *|
シングルトン | *{@link org.seasar.framework.container.deployer.InstanceSingletonDef singleton} | *{@link org.seasar.framework.container.deployer.SingletonComponentDeployer#deploy() ○} | *× | *{@link org.seasar.framework.container.deployer.SingletonComponentDeployer#init() ○} | *{@link org.seasar.framework.container.deployer.SingletonComponentDeployer#destroy() ○} | *
プロトタイプ | *{@link org.seasar.framework.container.deployer.InstancePrototypeDef prototype} | *{@link org.seasar.framework.container.deployer.PrototypeComponentDeployer#deploy() ○} | *× | *× | *× | *
外部コンテキスト | *{@link org.seasar.framework.container.deployer.InstanceApplicationDef application} | *{@link org.seasar.framework.container.deployer.ApplicationComponentDeployer#deploy() ○} | *× | *× | *× | *
{@link org.seasar.framework.container.deployer.InstanceRequestDef request} | *{@link org.seasar.framework.container.deployer.RequestComponentDeployer#deploy() ○} | *× | *× | *× | *|
{@link org.seasar.framework.container.deployer.InstanceSessionDef session} | *{@link org.seasar.framework.container.deployer.SessionComponentDeployer#deploy() ○} | *× | *× | *× | *|
外部コンポーネント | *{@link org.seasar.framework.container.deployer.InstanceOuterDef outer} | *× | *{@link org.seasar.framework.container.deployer.OuterComponentDeployer#injectDependency(Object) ○} | *× | *× | *
outerComponent
に対し、 この{@link ComponentDeployer}の{@link ComponentDef コンポーネント定義}に基づいて、
* S2コンテナ上のコンポーネントをインジェクションします。
*
* @param outerComponent
* 外部コンポーネント
*
* @see org.seasar.framework.container.deployer.OuterComponentDeployer#injectDependency(Object)
*/
public void injectDependency(Object outerComponent);
/**
* コンポーネントインスタンスを生成します。
*
* {@link InstanceDef コンポーネントインスタンス定義}がsingleton
の場合には、
* {@AspectDef アスペクト}を適用したインスタンスの生成、 配備、 プロパティ設定の後に、
* {@link InitMethodDef initMethod}が呼ばれます。
*
* {@link InstanceDef コンポーネントインスタンス定義}がsingleton
の場合には、
* {@link DestroyMethodDef destoryMethod}が呼ばれます。
*