WebSphere Application Server - Express, Version 6.1   
             オペレーティング・システム: AIX , HP-UX, Linux, Solaris, Windows, Windows Vista

             目次と検索結果のパーソナライズ化

DConfigBeans を使用したモジュールのカスタマイズ

Java 2 Platform, Enterprise Edition (J2EE) Deployment API Specification (JSR-88) の DConfigBean クラスを使用して、 デプロイメント中に J2EE アプリケーションまたはスタンドアロン・モジュールを構成できます。

始める前に

このトピックでは、JSR-88 用 の WebSphere Application Server サポートを使用して、 WebSphere Application Server プラットフォームが提供するアプリケーション・サーバー 上に J2EE モジュールをデプロイ (インストール) していることを前提とします。

JSR-88 仕様および DConfigBean クラスの使用については、http://java.sun.com/j2ee/tools/deployment/ をご覧ください。

このタスクについて

JSR-88 の DConfigBean クラスは、デプロイメント中に、J2EE アプリケーションおよびモジュールのプラットフォーム固有の構成に対する JavaBean ベースのサポートを提供します。コードは DConfigBean インスタンスを検査して、プラットフォーム固有の構成属性を取得できます。WebSphere Application Server が提供する DConfigBean インスタンスには、java.util.Hashtable オブジェクトの配列を持つ単一の属性が含まれます。ハッシュ・テーブル項目には、コードが値を取得および設定できる構成属性が含まれます。

プロシージャー

  1. JSR-88 を使用してアプリケーション・サーバー に J2EE モジュールをインストールするコードを記述します。
  2. JSR-88 デプロイメント中に WebSphere Application Server によって生成される DConfigBeans にアクセスするコードを記述します。ユーザー (またはデプロイヤー) は、 アクセスした DConfigBeans インスタンスをカスタマイズできます。 以下の疑似コードは 、J2EE ツール・プロバイダーが、JSR-88 デプロイメント中に WebSphere Application Server によって 生成された DConfigBean インスタンス属性を取得し、その属性の値を設定する方法を示します。
    import javax.enterprise.deploy.model.*;
    import javax.enterprise.deploy.spi.*;
    {
    DeploymentConfiguration dConfig = ___; // Get from DeploymentManager
    DDBeanRoot ddRoot = ___;               // Provided by J2EE tool
    
    // Obtain root bean.
    DConfigBeanRoot dcRoot = dConfig.getDConfigBeanRoot(dr);
    
    // Configure DConfigBean.
    configureDCBean (dcRoot);
    }
    
    // Get children from DConfigBeanRoot and configure each child.
    method configureDCBean (DConfigBean dcBean)
    {
       // Get DConfigBean attributes for a given archive.
       BeanInfo bInfo = Introspector.getBeanInfo(dcBean.getClass());
       IndexedPropertyDescriptor ipDesc = 
          (IndexedPropertyDescriptor)bInfo.getPropertyDescriptors()[0];
    
       // Get the 0th table.
       int index = 0;
       Hashtable tbl = (Hashtable) 
          ipDesc.getIndexedReadMethod().invoke
             (dcBean, new Object[]{new Integer(index)});
    
       while (tbl != null)
       {
          // Iterate over the hashtable and set values for attributes.
    
          // Set the table back into the DCBean.
          ipDesc.getIndexedWriteMethod().invoke
             (dcBean, new Object[]{new Integer(index), tbl}); 
    
          // Get the next entry in the indexed property
          tbl = (Hashtable)
             ipDesc.getIndexedReadMethod().invoke
                (dcBean, new Object[]{new Integer(++index)});
       }
    }
    



関連タスク
J2EE アプリケーション・ファイルのインストール
JSR-88 を使用した J2EE モジュールのインストール
関連情報
J2EE Application Deployment Specification
タスク・トピック    

ご利用条件 | フィードバック

最終更新: Jan 21, 2008 6:25:35 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/trun_app_jsr88_config.html