WebSphere Application Server for i5/OS, Version 6.1   
             オペレーティング・システム: i5/OS

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

スクリプトによるデプロイされたターゲットへのアプリケーションのロードの使用不可化

AdminConfig オブジェクトとスクリプトを使用して、デプロイされた ターゲットへのアプリケーションのロードを使用不可にできます。

始める前に

このタスクを開始する場合は、あらかじめ wsadmin ツールが稼働 している必要があります。 詳しくは、wsadmin スクリプト・クライアントの開始 の項目を参照してください。

このタスクについて

以下の例では、AdminConfig オブジェクトを使用して、デプロイされた ターゲットへのアプリケーションのロードを使用不可にしています。

プロシージャー

  1. アプリケーションのデプロイメント・オブジェクトを取得して、それを deployments 変数に割り当てます。例えば、次のようになります。
    • Jacl を使用:
      set deployments [$AdminConfig getid /Deployment:myApp/]
    • Jython を使用:
      deployments = AdminConfig.getid("/Deployment:myApp/")
    各部の意味は、次のとおりです。
    set Jacl コマンドです。
    deployments 変数名です。
    $ 変数名を値で置換する Jacl 演算子です。
    AdminConfig WebSphere Application Server の構成を表すオブジェクトです。
    getid AdminConfig コマンドです。
    Deployment 属性です。
    myApp 属性の値です。
    出力例:
    myApp(cells/mycell/applications/myApp.ear/deployments/myApp|deployment.xml#Deployment_1)
  2. アプリケーション内でのターゲット・マッピングを取得して、 targetMappings 変数に割り当てます。例えば、次のようになります。
    • Jacl を使用:
      set deploymentObj1 [$AdminConfig showAttribute $deployments deployedObject]
      set targetMap1 [lindex [$AdminConfig showAttribute $deploymentObj1 targetMappings] 0]
      出力例:
      (cells/mycell/applications/ivtApp.ear/deployments/ivtApp|deployment.xml#DeploymentTargetMapping_1)
    • Jython を使用:
      deploymentObj1 = AdminConfig.showAttribute(deployments, 'deployedObject')
      targetMap1 = AdminConfig.showAttribute(deploymentObj1, 'targetMappings')
      targetMap1 = targetMap1[1:len(targetMap1)-1].split(" ")
      print targetMap1
      
      出力例:
      ['(cells/mycell/applications/ivtApp.ear/deployments/ivtApp|deployment.xml#DeploymentTargetMapping_1)']
    各部の意味は、次のとおりです。
    set Jacl コマンドです。
    deploymentObj1 変数名です。
    $ 変数名を値で置換する Jacl 演算子です。
    AdminConfig WebSphere Application Server の構成を表すオブジェクトです。
    showAttribute AdminConfig コマンドです。
    deployments ステップ 1 で指定したデプロイメント・オブジェクトの ID を評価します。
    deployedObject 属性です。
    targetMap1 変数名です。
    targetMappings 属性です。
    lindex Jacl コマンドです。
    print Jython コマンドです。
  3. 以下のように、デプロイされた各ターゲットへのアプリケーショ ンのロードを使用不能にします。
    • Jacl を使用:
      foreach tm $targetMap1 {
            $AdminConfig modify $tm {{enable false}}
      }
    • Jython を使用:
      for targetMapping in targetMap1:
         AdminConfig.modify(targetMapping, [["enable", "false"]])
  4. 構成の変更を保管します。詳しくは、wsadmin ツールによる構成変更の保管 の項目を参照してください。



関連タスク
スクリプト管理のための AdminConfig オブジェクトの使用
関連資料
AdminConfig オブジェクトのコマンド
タスク・トピック    

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

最終更新: Jan 21, 2008 5:46:14 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.iseries.doc/info/iseries/ae/txml_appload.html