/*
 * $Header: /home/cvs/struts/xdocs/struts1.2/documentation/ja/src/share/org/apache/struts/action/PlugIn.java,v 1.5 2005/02/11 03:27:20 tatakaha Exp $
 * $Revision: 1.5 $
 * $Date: 2005/02/11 03:27:20 $
 *
 * Copyright 2000-2004 The Apache Software Foundation.
 * 
 * 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.apache.struts.action;


import javax.servlet.ServletException;
import org.apache.struts.config.ModuleConfig;


/**
 * <p><strong>PlugIn</strong>は、
 * アプリケーション起動やアプリケーション終了イベントについて通知する必要がある、
 * 特定モジュールのリソースまたはサービスのための設定用ラッパーです。
 * (この起動・終了イベントは、
 * {@link ActionServlet}インスタンスに応じ、
 * コンテナが<code>init</code>メソッドや<code>destroy</code>メソッドを呼ぶ時に一致します。)
 * アプリケーションライフサイクルを実行するための{@link ActionServlet}サブクラスを全く必要とすること無しに、
 * <code>PlugIn</code>オブジェクトは<code>struts-config.xml</code>ファイルの中で設定することができます。</p>
 * {@primary <p>A <strong>PlugIn</strong> is a configuration wrapper for a
 * module-specific resource or service that needs to be notified about
 * application startup and application shutdown events (corresponding to when
 * the container calls <code>init</code> and <code>destroy</code> on the
 * corresponding {@link ActionServlet} instance). <code>PlugIn</code> objects can be
 * configured in the <code>struts-config.xml</code> file, without the need
 * to subclass {@link ActionServlet} simply to perform application lifecycle
 * activities.</p>}
 *
 * <p>このインタフェースの実装は、
 * {@link ActionServlet}によって使われるため引数のないコンストラクタを持たねばなりません。
 * 設定は、
 * 標準のJavaBeansプロパティのセッターメソッドを用意することにより行うことができます。
 * これは、<code>init()</code>メソッドが呼ばれる前に、
 * 全てのセッターメソッドが呼ばれるためです。</p>
 * {@primary <p>Implementations of this interface must supply a zero-argument constructor
 * for use by {@link ActionServlet}. Configuration can be accomplished by
 * providing standard JavaBeans property setter methods, which will all have
 * been called before the <code>init()</code> method is invoked.</p>}
 *
 * <p>このインタフェースは、
 * Actionのサブクラスを含む全てのクラスに適用可能です。</p>
 * {@primary <p>This interface can be applied to any class, including an Action subclass</p>}
 *
 * @version $Revision: 1.5 $ $Date: 2005/02/11 03:27:20 $
 * @since Struts 1.1
 * @translator 棚澤 昌幸
 * @status firstdraft
 * @update 2005/1/31
 * @memo ブロックA
 */

public interface PlugIn {


    /**
     * <p>モジュールが終了する通知を受け取ります。</p>
     * {@primary <p>Receive notification that our owning module is being
     * shut down.</p>}
     */
    void destroy();


    /**
     * <p>モジュールが起動する通知を受け取ります。</p>
     * {@primary <p>Receive notification that the specified module is being
     * started up.</p>}
     *
     * @param servlet このウェッブアプリケーションの全てのモジュールを処理するActionServlet
     * {@primary @param servlet ActionServlet that is managing all the
     *  modules in this web application}
     * @param config このプラグインに関連付けられたモジュールのModuleConfig
     * {@primary @param config ModuleConfig for the module with which
     *  this plug-in is associated}
     *
     * @exception ServletException この<code>PlugIn</code>の初期化が成功できなかった場合
     * {@primary @exception ServletException if this <code>PlugIn</code> cannot
     *  be successfully initialized}
     */
    void init(ActionServlet servlet, ModuleConfig config)
        throws ServletException;


}
