/* * 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; /** *
* コンポーネントのインスタンスをS2コンテナ上でどのように管理するのかを定義します。 *
** コンポーネントインスタンス定義の種類には、以下のものがあります。 *
singleton
(default)prototype
application
request
session
outer
* インスタンス定義の指定方法には、以下のものがあります。 *
component
タグのinstance
属性で指定します。@
{@link org.seasar.framework.container.annotation.tiger.Component}のinstance
値で指定します。@
{@link org.seasar.framework.container.annotation.backport175.Component}のinstance
値で指定します。singleton
を指定したことになります。
*
*
* application
、 request
、 session
を使う場合は、
* {@link S2Container#init()}を行なう前に{@link ExternalContext}をS2コンテナに設定する必要があります。
*
* Webコンテナ用には{@link org.seasar.framework.container.impl.HttpServletExternalContext}が用意されています。
* {@link org.seasar.framework.container.servlet.S2ContainerListener}、
* {@link org.seasar.framework.container.servlet.S2ContainerServlet}のいずれかと{@link org.seasar.framework.container.filter.S2ContainerFilter}をweb.xmlに設定すれば、
* {@link org.seasar.framework.container.impl.HttpServletExternalContext}がS2コンテナに設定され、
* application
、 request
、 session
を使うことが出来るようになります。
*
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();
/**
* コンポーネントインスタンス定義に基づいた、コンポーネント定義componentDef
の{@link ComponentDeployer}を返します。
*
* @param componentDef
* コンポーネント定義
* @return {@link ComponentDeployer}オブジェクト
*/
ComponentDeployer createComponentDeployer(ComponentDef componentDef);
}