19.3.4. Edit a Thread Pool

JBoss Administrators can edit Thread Pools using the Management Console and the CLI.

Procedure 19.13. Edit a Thread Pool using the Management Console

  1. Login

    Login to the Management Console.
  2. Navigate to the EJB3 Thread Pools Tab

    Click on Profile in the top right, expand the Container item in the Profile panel on the left and select EJB 3. Then select the Thread Pools tab from the main panel.
    EJB3 Thread Pools Tab

    Figure 19.8. EJB3 Thread Pools Tab

  3. Select the Thread Pool to Edit

    Select the thread pool you wish to edit from the list.
  4. Click the Edit button

    The fields in the Details area are now editable.
  5. Edit Details

    Edit the details you want to change. Only the Thread Factory, Max Threads, Keepalive Timeout, and Keepalive Timeout Unit values can be edited.
  6. Save or Cancel

    Click the Save button if you are satisfied with the changes, or click the Cancel link if you want to discard the changes.

Procedure 19.14. Edit a thread pool using the CLI

  1. Launch the CLI tool and connect to your server. Refer to Section 3.5.4, “Connect to a Managed Server Instance Using the Management CLI”.
  2. Use the write_attribute operation with the following syntax for each attribute of the thread pool to be changed.
    /subsystem=ejb3/thread-pool=THREADPOOLNAME:write-attribute(name="ATTRIBUTE", value="VALUE")
    • Replace THREADPOOLNAME with the name of the thread pool.
    • Replace ATTRIBUTE with the name of the attribute to be edited. The attributes that can be edited in this way are keepalive-time, max-threads, and thread-factory.
    • Replace VALUE with the required value of the attribute.
  3. Use the read-resource operation to confirm the changes to the thread pool.
    /subsystem=ejb3/thread-pool=THREADPOOLNAME:read-resource

Important

When changing the value of the keepalive-time attribute with the CLI the required value is an object representation. It has the following syntax.
/subsystem=ejb3/thread-pool=THREADPOOLNAME:write-attribute(name="keepalive-time", value={"time" => "VALUE","unit" => "UNIT"}

Example 19.10. Set the Maxsize Value of a Thread Pool using the CLI

[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=HSThreads:write-attribute(name="max-threads", value="50")
{"outcome" => "success"}
[standalone@localhost:9999 /]

Example 19.11. Set the keepalive-time Time Value of a Thread Pool using the CLI

[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=HSThreads:write-attribute(name="keepalive-time", value={"time"=>"150"})
{"outcome" => "success"}
[standalone@localhost:9999 /]