Configuring work manager custom properties using the wsadmin tool

You can use the wsadmin tool to set custom properties for the work manager.

About this task

The createDaemonThreads custom property controls whether new threads created by a managed thread factory are daemons. The default value is false and means that new threads are not created as daemons.

The lateWorkTime custom property represents the number of seconds beyond which late-starting work must cause an informational message to be logged. The informational message is logged once per work manager. The default value is 60 seconds and a value of 0 disables this property.

The lateAlarmTime custom property represents the number of seconds beyond which a late-firing alarm must cause an informational message to be logged. The informational message is logged once per work manager. The default value is 5 seconds and a value of 0 disables this property.

Procedure

  1. Launch the wsadmin scripting tool using the Jython scripting language.
  2. Identify the application server, and assign it to the server variable. Use the AdminConfig object, and the getid command to retrieve the configuration ID of the server and assign it to the <varname> variable:
    • Using Jacl:
      set serv1 [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
    • Using Jython:
      serv1 = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
  3. Identify the work manager that belongs to the server, and assign it to the work manager variable. Use the AdminConfig object, the list command, and the server variable to retrieve the work manager and assign it to the <varname> variable:
    • Using Jacl:
      set workmanager1 [$AdminConfig list WorkManagerInfo $serv1]
    • Using Jython:
      workmanager1 = AdminConfig.list('WorkManagerInfo', 'serv1')
  4. Create a new J2EEResourcePropertySet property set for the work manager, and assign it to the work manager property set variable. Use the AdminConfig object, the create command, and the work manager variable to create a new J2EEResourcePropertySet and assign it to the <varname> variable:
    • Using Jacl:
      set workmanagerpropset1 [$AdminConfig create J2EEResourcePropertySet $workmanager1 {}]
    • Using Jython:
      workmanagerpropset1 = AdminConfig.create('J2EEResourcePropertySet', 'workmanager1', [])
  5. Create a new J2EEResourceProperty for the J2EEResourcePropertySet, and assign it to the work manager property variable.
    Use the AdminConfig object, the create command, and the property set variable to create a new J2EEResourceProperty for the lateWorkTime custom property and assign it to the <varname> variable:
    • Using Jacl:
      set workmanagerproperty1 [$AdminConfig create J2EEResourceProperty $workmanagerpropset1 {{name "lateWorkTime"}
       {value "120"} {description "Custom lateWorkTime"} {type "java.lang.String"} {required "false"}}]
    • Using Jython:
      workmanagerproperty1 = AdminConfig.create('J2EEResourceProperty', 'workmanagerpropset1', '[[name "lateWorkTime"]
       [value "120"] [description "Custom lateWorkTime"] [type "java.lang.String"] [required "false"]]')

    The following parameters exist for the new J2EEResourcePropertyproperty:

    Name

    lateWorkTime

    Value

    Number of seconds

    Description

    Specify a description

    Type

    Select java.lang.String

    Use the AdminConfig object, the create command, and the property set variable to create a new J2EEResourceProperty for the lateAlarmTime custom property and assign it to the <varname> variable:
    • Using Jacl:
      set workmanagerproperty2 [$AdminConfig create J2EEResourceProperty $workmanagerpropset1 {{name "lateAlarmTime"}
       {value "10"} {description "Custom lateAlarmTime"} {type "java.lang.String"} {required "false"}}]
    • Using Jython:
      workmanagerproperty2 = AdminConfig.create('J2EEResourceProperty', 'workmanagerpropset1', '[[name "lateAlarmTime"]
       [value "10"] [description "Custom lateAlarmTime"] [type "java.lang.String"] [required "false"]]')

    The following parameters exist for the new J2EEResourcePropertyproperty:

    Name

    lateAlarmTime

    Value

    Number of seconds

    Description

    Specify a description

    Type

    Select java.lang.String

    Use the AdminConfig object, the create command, and the property set variable to create a new J2EEResourceProperty for the createDaemonThreads custom property and assign it to the <varname> variable:
    • Using Jacl:
      set workmanagerproperty3 [$AdminConfig create J2EEResourceProperty $workmanagerpropset1 {{name "createDaemonThreads"} {value "true"} {description "Custom createDaemonThreads"} {type "java.lang.String"} {required "false"}}]
    • Using Jython:
      workmanagerproperty3 = AdminConfig.create('J2EEResourceProperty', 'workmanagerpropset1', '[[name "createDaemonThreads"] [value "true"] [description "Custom createDaemonThreads"] [type "java.lang.String"] [required "false"]]')
    The following parameters exist for the new J2EEResourceProperty property:
    Name createDaemonThreads
    Value True or False
    Description Specify a description
    Type Select java.lang.String
  6. Save the configuration changes.
    Enter the following command to save your changes:
    • Using Jacl:
      $AdminConfig save
    • Using Jython:
      AdminConfig.save()
  7. In a network deployment environment only, synchronize the node.
    Use the syncActiveNodes script in the AdminNodeManagement script library to propagate the changes to all active nodes, for example:
    • Using Jacl:
      $AdminNodeManagement syncActiveNodes
    • Using Jython:
      AdminNodeManagement.syncActiveNodes()

Results

You have created and configured custom properties for the work manager using the wsadmin tool.

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



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