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

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

スクリプトによるセッション管理用アプリケーションの構成

このタスクでは、AdminConfig オブジェクトを使用して、アプリケーションの セッション・マネージャーを構成する例を示します。

始める前に

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

このタスクについて

AdminApp オブジェクトを使用して、アプリケーションの構成を設定できます。 ただし、AdminApp オブジェクトでは設定できない構成もいくつかあります。

プロシージャー

  1. アプリケーションのデプロイメント構成オブジェクトを識別して、 deployment 変数に割り当てます。 以下に例を示します。
    • Jacl を使用:
      set deployments [$AdminConfig getid /Deployment:myApp/]
    • Jython を使用:
      deployments = AdminConfig.getid('/Deployment:myApp/')
      print deployments
    各部の意味は、次のとおりです。
    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. アプリケーション・デプロイメント・オブジェクトを検索して appDeploy 変数に割り当てます。以下に例を示します。
    • Jacl を使用:
      set appDeploy [$AdminConfig showAttribute $deployments deployedObject]
    • Jython を使用:
      appDeploy = AdminConfig.showAttribute(deployments, 'deployedObject')
      print appDeploy
    各部の意味は、次のとおりです。
    set Jacl コマンドです。
    appDeploy 変数名です。
    $ 変数名を値で置換する Jacl 演算子です。
    AdminConfig WebSphere Application Server の構成を表すオブジェクトです。
    showAttribute AdminConfig コマンドです。
    deployments ステップ 1 で指定したデプロイメント・オブジェクトの ID を評価します。
    deployedObject 属性です。
    出力例:
    (cells/mycell/applications/myApp.ear/deployments/myApp|deployment.xml#ApplicationDeployment_1)
  3. セッション・マネージャーに設定できる属性のリストを取得するには、 attributes コマンドを使用します。以下に例を示します。
    • Jacl を使用:
      $AdminConfig attributes SessionManager
    • Jython を使用:
      print AdminConfig.attributes('SessionManager')
    各部の意味は、次のとおりです。
    $ 変数名を値で置換する Jacl 演算子です。
    AdminConfig WebSphere Application Server の構成を表すオブジェクトです。
    attributes AdminConfig コマンドです。
    SessionManager 属性です。
    出力例:
    "accessSessionOnTimeout Boolean"
    "allowSerializedSessionAccess Boolean"
    "context ServiceContext@"
    "defaultCookieSettings Cookie"
    "enable Boolean"
    "enableCookies Boolean"
    "enableProtocolSwitchRewriting Boolean"
    "enableSSLTracking Boolean"
    "enableSecurityIntegration Boolean"
    "enableUrlRewriting Boolean"
    "maxWaitTime Integer"
    "properties Property(TypedProperty)*"
    "sessionDRSPersistence DRSSettings"
    "sessionDatabasePersistence SessionDatabasePersistence"
    "sessionPersistenceMode ENUM(DATABASE, DATA_REPLICATION, NONE)"
    "tuningParams TuningParams"

    セッション管理のアプリケーションを構成するとき、それぞれの属性を指定することをお勧めします。

  4. セッション・マネージャーの属性をセットアップします。次の例では、 セッション・マネージャーに 4 つのトップレベル属性を設定します。 この例を変更して、セッション・マネージャーの他の属性を設定できます。 これには、DRSSettings、SessionDataPersistence、および TuningParms オブジェクト・タイプの ネストされた属性が含まれます。 それらのオブジェクト・タイプの属性をリストするには、 AdminConfig オブジェクトの attribute コマンドを使用します。
    • Jacl を使用:
      set attr1 [list enableSecurityIntegration true]
      set attr2 [list maxWaitTime 30]
      set attr3 [list sessionPersistenceMode NONE]
      set kuki [list maximumAge -1]
      set cookie [list $kuki]
      Set cookieSettings [list defaultCookieSettings $cookie]
      set attrs [list $attr1 $attr2 $attr3 $cookieSettings]
      set sessionMgr [list sessionManagement $attrs]
      
      Jacl を使用した出力例:
      sessionManagement {{enableSecurityIntegration true} {maxWaitTime 30} {sessionPersistenceMode NONE} 
      {defaultCookieSettings {{maximumAge -1}}}}
    • Jython を使用:
      attr1 = ['enableSecurityIntegration', 'true']
      attr2 = ['maxWaitTime', 30]
      attr3 = ['sessionPersistenceMode', 'NONE']
      kuki = ['maximumAge', -1] 
      cookie = [kuki]
      cookieSettings = ['defaultCookieSettings', cookie]
      attrs = [attr1, attr2, attr3, cookieSettings]
      sessionMgr = [['sessionManagement', attrs]]
      Jython を使用した出力例:
      [[sessionManagement, [[enableSecurityIntegration, true], [maxWaitTime, 30], [sessionPersistenceMode, NONE], 
      [defaultCookieSettings [[maximumAge, -1]]]]
    各部の意味は、次のとおりです。
    set Jacl コマンドです。
    attr1attr2attr3attrssessionMgr 変数名です。
    $ 変数名を値で置換する Jacl 演算子です。
    enableSecurityIntegration 属性です。
    true enableSecurityIntegration 属性の値です。
    maxWaitTime 属性です。
    30 maxWaitTime 属性の値です。
    sessionPersistenceMode 属性です。
    NONE sessionPersistenceMode 属性の値です。
  5. 以下のいずれかを実行します。
    • アプリケーションのセッション・マネージャーを作成します。以下に例を示します。
      • Jacl を使用:
        $AdminConfig create ApplicationConfig $appDeploy [list $sessionMgr]
      • Jython を使用:
        print AdminConfig.create('ApplicationConfig', appDeploy, sessionMgr)
      各部の意味は、次のとおりです。
      $ 変数名を値で置換する Jacl 演算子です。
      AdminConfig WebSphere Application Server の構成を表すオブジェクトです。
      create AdminConfig コマンドです。
      ApplicationConfig 属性です。
      appDeploy ステップ 2 で指定したデプロイ済みアプリケーションの ID を評価します。
      list Jacl コマンドです。
      sessionMgr ステップ 4 で指定したセッション・マネージャーの ID を評価します。
      出力例:
      (cells/mycell/applications/myApp.ear/deployments/myApp|deployment.xml#ApplicationConfig_1)
    • セッション・マネージャーがすでに存在する場合は、AdminConfig オブジェクトの modify コマンドを使用して、セッション・マネージャーの構成を更新します。 以下に例を示します。
      • Jacl を使用:
        set configs [lindex [$AdminConfig showAttribute $appDeploy configs] 0]
        set appConfig [lindex $configs 0]
        set SM [$AdminConfig showAttribute $appConfig sessionManagement]
        $AdminConfig modify $SM $attrs
      • Jython を使用:
        configs = AdminConfig.showAttribute (appDeploy, 'configs')
        appConfig = configs[1:len(configs)-1] 
        SM = AdminConfig.showAttribute (appConfig, 'sessionManagement') 
        AdminConfig.modify (SM, attrs)
  6. 構成の変更を保管します。詳しくは、wsadmin ツールによる構成変更の保管 の項目を参照してください。
  7. ノードを同期します (Network Deployment 環境の場合のみ)。 詳しくは、wsadmin ツールによるノードの同期化 の項目を参照してください。
タスク・トピック    

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

最終更新: Jan 21, 2008 9:12:22 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/txml_sessionmgt.html