Modifying class loader modes for applications using wsadmin scripting

You can modify class loader modes for an application with scripting and the wsadmin tool.

Before you begin

There are two ways to complete this task. The example in this topic uses the AdminConfig object to create and configure a shared library. Alternatively, you can use the createSharedLibrary script in the AdminResources script library to configure shared libraries.

Scripting 程式庫提供一組自動執行最常見管理功能的程序。 您可以個別執行每個 Script 程序,也可以將若干程序結合起來,以快速開發新的 Script。

About this task

Attention: 如果應用程式在執行中,變更應用程式設定會使應用程式重新啟動。 在獨立式伺服器上,會在儲存變更之後重新啟動應用程式。 在多重伺服器產品上,會在儲存變更之後重新啟動應用程式,在安裝應用程式的節點上,檔案會同步化。 如果要控制多重伺服器產品上的同步化時機,請在「主控台」喜好設定頁面上取消選取與節點同步變更

Procedure

  1. 啟動 wsadmin Scripting 工具。
  2. Retrieve the configuration ID of the object that you want to modify and set it to the dep variable. For example:
    • Using Jacl:
      set dep [$AdminConfig getid /Deployment:ivtApp/]
    • Using Jython:
      dep = AdminConfig.getid('/Deployment:ivtApp/')
  3. Identify the deployed object and set it to the depObject variable. For example:
    • Using Jacl:
      set depObject [$AdminConfig showAttribute $dep deployedObject]
    • Using Jython:
      depObject = AdminConfig.showAttribute(dep, 'deployedObject')
  4. Identify the class loader and set it to the classldr variable. For example:
    • Using Jacl:
      set classldr [$AdminConfig showAttribute $depObject classloader]
    • Using Jython:
      classldr = AdminConfig.showAttribute(depObject, 'classloader')
  5. Show the current attribute values of the configuration object with the showall command, for example:
    • Using Jacl:
      $AdminConfig showall $classldr
      Example output:
      {libraries {}} {mode PARENT_FIRST}
    • Using Jython:
      print AdminConfig.showall(classldr)
      Example output:
      [libraries []] [mode PARENT_FIRST]
  6. Modify the attributes of the configuration object with the modify command, for example:
    • Using Jacl:
      $AdminConfig modify $classldr {{mode PARENT_LAST}}
    • Using Jython:
      AdminConfig.modify(classldr, [['mode', 'PARENT_LAST']])
  7. Save the configuration changes.
    請利用下列指令範例來儲存您的配置變更:
    AdminConfig.save()
  8. Verify the changes that you made to the attribute value with the showall command, for example:
    • Using Jacl:
      $AdminConfig showall $classldr
      Example output:
      {libraries {}} {mode PARENT_LAST}
    • Using Jython:
      AdminConfig.showall(classldr)
      Example output:
      [libraries []] [mode PARENT_LAST]

指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:18
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_classloader
檔名:txml_classloader.html