/* * 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; /** *
* コンポーネントのインスタンスをどのように管理するのかを定義します。 *
*
* コンポーネントインスタンス定義の種類は「singleton
」、「prototype
」、「application
」、「request
」、「session
」、「outer
」があります。
*
singleton
(default)prototype
application
request
session
outer
* diconファイルではcomponentタグのinstance属性で指定します。
* Tigerアノテーションでは@Componentのinstance値で指定します。
* backport175アノテーションでは@org.seasar.framework.container.annotation.backport175.Componentのinstance値で指定します。
* コンポーネントインスタンス定義を省略した場合はsingleton
を指定したことになります。
*
「application
」、「request
」、「session
」を使う場合は、Webコンテナ上で{@link org.seasar.framework.container.servlet.S2ContainerListener}・{@link org.seasar.framework.container.servlet.S2ContainerServlet}のいずれかと{@link org.seasar.framework.container.filter.S2ContainerFilter}を設定する必要があります。
*
singleton
」を表す定数です。
*/
String SINGLETON_NAME = "singleton";
/**
* コンポーネントインスタンス定義「prototype
」を表す定数です。
*/
String PROTOTYPE_NAME = "prototype";
/**
* コンポーネントインスタンス定義「application
」を表す定数です。
*/
String APPLICATION_NAME = "application";
/**
* コンポーネントインスタンス定義「request
」を表す定数です。
*/
String REQUEST_NAME = "request";
/**
* コンポーネントインスタンス定義「session
」を表す定数です。
*/
String SESSION_NAME = "session";
/**
* コンポーネントインスタンス定義「outer
」を表す定数です。
*/
String OUTER_NAME = "outer";
/**
* コンポーネントインスタンス定義の文字列表現を返します。
*
* @return コンポーネントインスタンス定義
*/
String getName();
/**
* コンポーネントインスタンス定義に基づいた{@link ComponentDeployer}を返します。{@link ComponentDeployer}は、コンポーネント定義componentDef
のインスタンスを生成したりDIを行ないます。
*
* @param componentDef
* コンポーネント定義
* @return {@link ComponentDeployer}オブジェクト
*/
ComponentDeployer createComponentDeployer(ComponentDef componentDef);
}